[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0000013dc6cf8f55-82165231-d5d6-4403-85fd-790899bfd49f-000000@email.amazonses.com>
Date: Mon, 1 Apr 2013 18:15:24 +0000
From: Christoph Lameter <cl@...ux.com>
To: Eric Dumazet <eric.dumazet@...il.com>
cc: RongQing Li <roy.qing.li@...il.com>,
Shan Wei <davidshan@...cent.com>, netdev@...r.kernel.org
Subject: Re: [PATCH] core: fix the use of this_cpu_ptr
On Mon, 1 Apr 2013, Eric Dumazet wrote:
> On Mon, 2013-04-01 at 15:21 +0000, Christoph Lameter wrote:
> > On Fri, 29 Mar 2013, RongQing Li wrote:
>
> > > flush_tasklet is not a percpu var, it is a member of percpu var.
> >
> > Well then it would be best to use this_cpu_read() instead of this_cpu_ptr.
> > It also will generate better code.
>
> I believe we already had this discussion in the past.
>
> flush_tasklet is a structure, and we need its address, not read its
> content.
>
> You can not use this_cpu_read() to get its address, and following
> code is fine.
>
> tasklet = &this_cpu_ptr(info->cache->percpu)->flush_tasklet;
that is confusing..
tasklet = this_cpu_ptr(&info->cache->percpu->flushtasklet)
this_cpu_ptr performs an address relocation. The address then is the one
of flushtasklet.
> Similar to this code in mm/page_alloc.c
>
> pcp = &this_cpu_ptr(zone->pageset)->pcp;
Yeah thats my (early) code using these features.
pcp = this_cpu_ptr(&zone->pageset->pcp)
I need to do a writeup on this one.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists