[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191125224119.GA37611@dennisz-mbp.dhcp.thefacebook.com>
Date: Mon, 25 Nov 2019 17:41:19 -0500
From: Dennis Zhou <dennis@...nel.org>
To: Dennis Zhou <dennis@...nel.org>
Cc: Ben Dooks <ben.dooks@...ethink.co.uk>,
linux-kernel@...ts.codethink.co.uk, Tejun Heo <tj@...nel.org>,
Christoph Lameter <cl@...ux.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] percpu: add __percpu to SHIFT_PERCPU_PTR
On Thu, Oct 17, 2019 at 02:13:01PM -0400, Dennis Zhou wrote:
> 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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__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] <asn:3> *__p
> > mm/vmstat.c:825:29: got signed char *
> >
> > Signed-off-by: Ben Dooks <ben.dooks@...ethink.co.uk>
> > ---
> > Cc: Dennis Zhou <dennis@...nel.org>
> > Cc: Tejun Heo <tj@...nel.org>
> > Cc: Christoph Lameter <cl@...ux.com>
> > Cc: linux-kernel@...r.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
Hi Ben,
I've reverted this commit. After spending a little more time on it, I
don't think this is the fix we want because after we call RELOC_HIDE,
we are shifting from __percpu to __kernel address spaces as we're adding
the offset here.
Thanks,
Dennis
Powered by blists - more mailing lists