[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130905141305.GB24274@osiris>
Date: Thu, 5 Sep 2013 16:13:05 +0200
From: Heiko Carstens <heiko.carstens@...ibm.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Tony Luck <tony.luck@...el.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lockref: remove cpu_relax() again
On Thu, Sep 05, 2013 at 03:18:14PM +0200, Heiko Carstens wrote:
> d472d9d9 "lockref: Relax in cmpxchg loop" added a cpu_relax() call to the
> CMPXCHG_LOOP() macro. However to me it seems to be wrong since it is very
> likely that the next round will succeed (or the loop will be left).
> Even worse: cpu_relax() is very expensive on s390, since it means yield
> "my virtual cpu to the hypervisor". So we are talking of several 1000 cycles.
>
> In fact some measurements show the bad impact of the cpu_relax() call on
> s390 using Linus' test case that "stats()" like mad:
>
> Without converting s390 to lockref:
> Total loops: 81236173
>
> After converting s390 to lockref:
> Total loops: 31896802
>
> After converting s390 to lockref but with removed cpu_relax() call:
> Total loops: 86242190
All of those should have been "converting s390 to ARCH_USE_CMPXCHG_LOCKREF"
instead of "to lockref" of course .. ;)
--
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