This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/6] Optimize number of accesses to *adapt_count in lock elision code.
- From: Andi Kleen <andi at firstfloor dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 02 Sep 2013 14:07:25 -0700
- Subject: Re: [PATCH 1/6] Optimize number of accesses to *adapt_count in lock elision code.
- Authentication-results: sourceware.org; auth=none
- References: <20130902075228 dot GA4792 at linux dot vnet dot ibm dot com> <20130902075808 dot GA4997 at linux dot vnet dot ibm dot com>
Dominik Vogt <vogt@linux.vnet.ibm.com> writes:
> The changes to the original patches before 2.18 led to semantical changes of
> the adapt_count argument. In the current code, *adapt_count cannot fall below
> zero. When elision is attempted, *adapt_count is always exactly zero. This
> fact can be exploited to reduce the number of accesses to *adapt_count and to
> simplify updating *adapt_count.
First in hardware <= is exactly the same performance as ==
I don't think the > 0 changes are correct. Previously it was a edge
trigger, you made it a level trigger, which is very different.
Also the compiler takes care of CSEing anyways, no need to
do it manually.
Nack.
-Andi
--
ak@linux.intel.com -- Speaking for myself only