Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1286092ybg; Fri, 18 Oct 2019 15:14:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDoM7TgFUh1WIiYPx6MSW0v96vA56/9I8wGxI47CYQepjYqOk+3uYCtUwIZyuHHGBPhpco X-Received: by 2002:a50:cbcd:: with SMTP id l13mr12155305edi.18.1571436871652; Fri, 18 Oct 2019 15:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571436871; cv=none; d=google.com; s=arc-20160816; b=lcYcey6/emeW/YmcaCXtexldNcDMGDz/y3Wa50UnzsHstdELo25djcglt9mORxmpN3 uncX+8/yw1iRSMz71uDVUl7/lttD6V4YgC6vr2XhCPtWce9V6uMZEaFsu5DOrm3uEWRS kFx8YDwq4SWCEZ2rkZPgtV5PKbSlZaMULq7m/UX59tl9S7eeAw/0ZxNEI6BjnZnnSQlF p8LSZA6Sm5TP6J4ySAm6dONGt1fKzmaTqXBgwMsdG+YgoZb90o4OlR8inio7MFPnIwzP 3y7SQ9hRZ+qSw7Sso7SKSeGb4L9uoHZ+82i2hS4T3UVkYp5EUb30zyqZLUvFfosh1b2W v6wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=uQJU8ci8oY6Kab1RQlvPMrQvM9tpnFR5fWTaEdpdtno=; b=F5gIZ4a3D473pDPtHMpwK2+FF+EZXckQ7LL0nHlQ2DvoFtJ4fKXRenohD5XDB+5pBG uoY4CJDeHla9RCOhAwTC6qrbLMMGRWmZ5MjEgw8IpkPKQCSMk+b1hjA2eqPdEa0kh9zv SB2M1iYZiDSgrMjeJ8T7dSjt1AUij51EYkcsepHaRHMVCzsfqTXN2TkXOrWLV5aynQcC ZRg50F9DWw2I61P4PBJkz9gBuJ6i2Xzx47sWxu5xcYzTrI+P4dzzHa0vTxF6zJfgZncH vGCXeJi6KBKh5dnTQb7xvJZYBTvct7vSGERVDOP1PHDQe4n0pTaQd08SHg0YRs8hd9EH AlQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si4238380ejw.340.2019.10.18.15.14.08; Fri, 18 Oct 2019 15:14:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438233AbfJQSNH (ORCPT + 99 others); Thu, 17 Oct 2019 14:13:07 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:36667 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395229AbfJQSNG (ORCPT ); Thu, 17 Oct 2019 14:13:06 -0400 Received: by mail-qt1-f193.google.com with SMTP id o12so4982530qtf.3 for ; Thu, 17 Oct 2019 11:13:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uQJU8ci8oY6Kab1RQlvPMrQvM9tpnFR5fWTaEdpdtno=; b=h0VkyBEm9O0btEGP/lHytb2SrfiXtOjU/gKvIMhy9TZyPl1NioOFDJk+aItTS7smgB h4o/ZHB/nTX6P2b4zMG/fjU7d8fic0yS5CqBkdxcFFoY/NAebzLnosBG3VJUkeNdb5Fo 628y03lQnaLhGACa5ggE+8JDHBDe2Z0nnHfKKi7cTEFBcNHDLF2DARe/0CGg7l79qQJG frFJGNUP76yIANeZr3TiDq/xXB65tGvFIFy8+0QYt2pGZOLSiMDENegiEl9rwYFPJlEd zMIvMF4rjCtbyv2QB2J4fx8ygpUwKMaulhGb1DXG7o2PWQHrQvYQalx9+6avl9pDKr5k cSNQ== X-Gm-Message-State: APjAAAVmRJuNnKAcro/OFuuTudIBLoiwxFizHIv3akWMc4tmktIb2EOH 8dytbn7hpB7DePZbxNGOm/OlxL4s X-Received: by 2002:ad4:4345:: with SMTP id q5mr5354801qvs.80.1571335985682; Thu, 17 Oct 2019 11:13:05 -0700 (PDT) Received: from dennisz-mbp.dhcp.thefacebook.com ([2620:10d:c091:500::2:ef38]) by smtp.gmail.com with ESMTPSA id p7sm1678886qkc.21.2019.10.17.11.13.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Oct 2019 11:13:03 -0700 (PDT) Date: Thu, 17 Oct 2019 14:13:01 -0400 From: Dennis Zhou To: Ben Dooks Cc: linux-kernel@lists.codethink.co.uk, Dennis Zhou , Tejun Heo , Christoph Lameter , linux-kernel@vger.kernel.org Subject: Re: [PATCH] percpu: add __percpu to SHIFT_PERCPU_PTR Message-ID: <20191017181301.GA32546@dennisz-mbp.dhcp.thefacebook.com> References: <20191015102615.11430-1-ben.dooks@codethink.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191015102615.11430-1-ben.dooks@codethink.co.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 15, 2019 at 11:26:15AM +0100, Ben Dooks wrote: > The SHIFT_PERCPU_PTR() returns a pointer used by a number > of functions that expect the pointer to be __percpu annotated > (sparse address space 3). Adding __percpu to this makes the > following sparse warnings go away. > > Note, this then creates the problem the __percup is marked > as noderef, which may need removing for some of the internal > functions, or to remove other warnings. > > mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:385:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:385:13: got signed char * > mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:385:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:385:13: got signed char * > mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:385:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:385:13: got signed char * > mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:385:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:385:13: got signed char * > mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:401:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:401:13: got signed char * > mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:401:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:401:13: got signed char * > mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:401:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:401:13: got signed char * > mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:401:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:401:13: got signed char * > mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:429:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:429:13: got signed char * > mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:429:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:429:13: got signed char * > mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:429:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:429:13: got signed char * > mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:429:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:429:13: got signed char * > mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:445:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:445:13: got signed char * > mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:445:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:445:13: got signed char * > mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:445:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:445:13: got signed char * > mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:445:13: expected signed char [noderef] [usertype] *__p > mm/vmstat.c:445:13: got signed char * > mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:763:29: expected signed char [noderef] *__p > mm/vmstat.c:763:29: got signed char * > mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:763:29: expected signed char [noderef] *__p > mm/vmstat.c:763:29: got signed char * > mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:763:29: expected signed char [noderef] *__p > mm/vmstat.c:763:29: got signed char * > mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:763:29: expected signed char [noderef] *__p > mm/vmstat.c:763:29: got signed char * > mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:825:29: expected signed char [noderef] *__p > mm/vmstat.c:825:29: got signed char * > mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:825:29: expected signed char [noderef] *__p > mm/vmstat.c:825:29: got signed char * > mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:825:29: expected signed char [noderef] *__p > mm/vmstat.c:825:29: got signed char * > mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces) > mm/vmstat.c:825:29: expected signed char [noderef] *__p > mm/vmstat.c:825:29: got signed char * > > Signed-off-by: Ben Dooks > --- > Cc: Dennis Zhou > Cc: Tejun Heo > Cc: Christoph Lameter > Cc: linux-kernel@vger.kernel.org > --- > include/linux/percpu-defs.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h > index a6fabd865211..a49b6c702598 100644 > --- a/include/linux/percpu-defs.h > +++ b/include/linux/percpu-defs.h > @@ -229,7 +229,7 @@ do { \ > * pointer value. The weird cast keeps both GCC and sparse happy. > */ > #define SHIFT_PERCPU_PTR(__p, __offset) \ > - RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)) > + RELOC_HIDE((typeof(*(__p)) __kernel __percpu __force *)(__p), (__offset)) > > #define per_cpu_ptr(ptr, cpu) \ > ({ \ > -- > 2.23.0 > Hello, I've applied it for-5.5. Thanks, Dennis