lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55BFDD66.2010302@hp.com>
Date:	Mon, 03 Aug 2015 17:30:14 -0400
From:	Waiman Long <waiman.long@...com>
To:	Davidlohr Bueso <dave@...olabs.net>
CC:	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	linux-kernel@...r.kernel.org, Scott J Norton <scott.norton@...com>,
	Douglas Hatch <doug.hatch@...com>
Subject: Re: [PATCH v4 2/7] locking/pvqspinlock: Add pending bit support

On 08/03/2015 02:37 PM, Davidlohr Bueso wrote:
> On Fri, 2015-07-31 at 22:21 -0400, Waiman Long wrote:
>>   /*
>> + * Try to acquire the lock and wait using the pending bit
>> + */
>> +static int pv_pending_lock(struct qspinlock *lock, u32 val)
> Sorry but, why did yo not rewrite the function as we had previously
> discussed. This is very confusing to read, the one I suggested follows a
> much nicer flow and purposely illustrates the intention. You also failed
> to address my loop semantics concerns altogether.
>
> Thanks,
> Davidlohr
>

I am sorry that I might have misinterpret what you wanted. Right now, 
the latest code have 3 loops in the pending function:
1. Waiting for pending locker to become lock holder
2. A loop to do the trylock or set the pending bit.
3. With the pending bit set, another loop to wait until the lock holder 
frees the lock.

The 2nd loop may be a bit confusing to look at. I will try to add more 
comment to clarify that. The second loop can return without calling 
clear_pending() because the pending bit will not be set until it breaks 
out of the loop.

I think it will make the code more complicated if we try to merge the 
2nd and 3rd loops.

Please let me know what kind of rewriting you have in mind.

Thanks,
Longman




--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ