[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1705190903100.16894@east.gentwo.org>
Date: Fri, 19 May 2017 09:04:30 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: Andy Lutomirski <luto@...capital.net>
cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: Virtually Mapped Stacks: Do not disable interrupts
On Thu, 18 May 2017, Andy Lutomirski wrote:
> On Wed, May 17, 2017 at 8:58 AM, Christoph Lameter <cl@...ux.com> wrote:
> > The reason to disable interrupts seems to be to avoid switching
> > to a different processor while handling per cpu data using
> > individual loads and stores. If we use per cpu RMV primitives
> > we will not have to disable interrupts.
>
> I like this, except that those primitives can be quite expensive, I
> think, and they're being called in a loop. What if you first did a
> this_cpu_read() to see if the value in the cache slot might be useful
> before doing the heavyweight exchange?
These operations are not expensive because they are unlocked operations
(in constrast to the usuual "lock cmpxchg") and do not
require coherency to be guaranteed between processors. That is why they
were made available because they are so much cheaper.
Powered by blists - more mailing lists