From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0362C43463 for ; Fri, 18 Sep 2020 20:29:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4C1562311B for ; Fri, 18 Sep 2020 20:29:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HOwkJz9c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C1562311B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 74ADA8E0001; Fri, 18 Sep 2020 16:29:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6FA176B0095; Fri, 18 Sep 2020 16:29:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 599A48E0001; Fri, 18 Sep 2020 16:29:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id 40C536B0093 for ; Fri, 18 Sep 2020 16:29:13 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 09117180AD815 for ; Fri, 18 Sep 2020 20:29:13 +0000 (UTC) X-FDA: 77277321786.27.oil42_0d0c50d2712e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id DA7623D668 for ; Fri, 18 Sep 2020 20:29:12 +0000 (UTC) X-HE-Tag: oil42_0d0c50d2712e X-Filterd-Recvd-Size: 4311 Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Sep 2020 20:29:12 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id e7so6207690qtj.11 for ; Fri, 18 Sep 2020 13:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zA0vgj4MEhN7seo0nt8TRqqpQ53wlISAhciKlAtPvC4=; b=HOwkJz9c3WOAfVav8KySepB69cP4Tpb1FVnfRTQdmWHQn0jpmEpAIasccrNxf0WM+s CvbNcuoS1TVSlJ1b7OecnaiI4QYtqHc+db2lbrnWdafYCT+PpmbuKXgEWGi738avmBu0 4j1O4cC5pfUD85v9O/dB48vWBZrovSrMJv+igfK6EtCT51ck0XysxKFQrm8LMUr7c6R8 GTFKupqVbDNxWq32L3OypEM3XYw8tsTZ0OgQqmF9tbZcsoGPMIzT8JaxozzK97gzvSSB oaaas32cILbzEjCuvrWgl7tYsaN/+iSbD4KOvcPA1dvc4fz03hx4XH+HGCh358ZvqARi vT0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=zA0vgj4MEhN7seo0nt8TRqqpQ53wlISAhciKlAtPvC4=; b=GyGi5q83aQEb9ZXFoPKM3zy0B0KFUoP6rhfFa1Do/zobeFqOPjlIP2bTs2o7sYjBgC /GOXlXeUmOhKi5P9Oi7cAiw1fKgWWLgvfpilE5/3Ddf5WfTcad7iyHYqkd2lfH+a0jcn 7ExG5oGzBug5cA5fjNb2rHbDo/qxmrnSMV++Wd7KGUuO4MAc0ymeSFxT3OiDzUKYU/1w gSGkHjc+2hA6/LNVSidfjM5gCDu91ca7QVQ2grVtxDS6y2Bx1YO5kiejyo7iCBzjAHgh /KVk8dZTX1NGlaYiDC0rHojhnmRrA7tlOtzrPu1S40SCvQl4Ysxe72jeLm65CElwgz9V Pwxw== X-Gm-Message-State: AOAM530tZYibr2QqSuJfHLUtt0IhVJOAek+6J1WAJuv7wEqfgfcleghD IgUwjI8x0F14ApA61+J6Z30= X-Google-Smtp-Source: ABdhPJzZJWrmdNiq23vSSEx1WKyiuXDANDMHJ1nEKgrpWX1VlxFg85RjNPR8ybTu5YzE5+qXGzBBLw== X-Received: by 2002:ac8:6ec2:: with SMTP id f2mr35754855qtv.159.1600460951789; Fri, 18 Sep 2020 13:29:11 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id v2sm2805612qkv.26.2020.09.18.13.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2020 13:29:11 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Fri, 18 Sep 2020 16:29:09 -0400 To: Linus Torvalds Cc: Matthew Wilcox , "Gustavo A. R. Silva" , Dennis Zhou , Tejun Heo , Christoph Lameter , Linux-MM , Linux Kernel Mailing List , Kees Cook Subject: Re: [GIT PULL] percpu fix for v5.9-rc6 Message-ID: <20200918202909.GA2946008@rani.riverdale.lan> References: <20200917204514.GA2880159@google.com> <20200918162305.GB25599@embeddedor> <20200918193426.GA15213@embeddedor> <20200918200252.GH32101@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Sep 18, 2020 at 01:14:54PM -0700, Linus Torvalds wrote: > On Fri, Sep 18, 2020 at 1:02 PM Matthew Wilcox wrote: > > > > I suppose it's not really necessary, we could do offsetof here, right? > > Yup, that would make a lot more sense. > > But right now, the sizeof() obviously silently works. In general (i.e. outside the implementation of the macro itself), what is the preferred way of getting the size of just the header? 1) offsetof(typeof(s),flex) 2) struct_size(s, flex, 0) 3) sizeof(s) 4) new macro that's easier to read than 1 or 2, but makes it clear what you're doing?