lkml.org 
[lkml]   [2011]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 8/5] llist: Remove cpu_relax() usage in cmpxchg loops
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@chello.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.

-Andi


\
 
 \ /
  Last update: 2011-09-12 16:25    [W:0.080 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site