[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1315837433.26517.45.camel@twins>
Date: Mon, 12 Sep 2011 16:23:53 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Andi Kleen <andi@...stfloor.org>
Cc: Huang Ying <ying.huang@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH 8/5] llist: Remove cpu_relax() usage in cmpxchg loops
On Mon, 2011-09-12 at 16:23 +0200, Andi Kleen wrote:
> On Mon, Sep 12, 2011 at 04:05:58PM +0200, Peter Zijlstra wrote:
> > Subject: llist: Remove cpu_relax() usage in cmpxchg loops
> > From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> > Date: Mon Sep 12 15:50:49 CEST 2011
> >
> > Initial benchmarks show they're a net loss (2 socket wsm):
> >
>
> May still save power. however:
>
> > entry = cmpxchg(&head->first, old_entry, new);
> > if (entry == old_entry)
> > break;
> > - cpu_relax();
>
> You need at least a barrier() then, otherwise the compiler could
> change the memory order in the loop.
the cmpxchg is a full memory barrier and compiler barrier.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists