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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 25 Feb 2008 17:45:07 -0700
From:	"Gregory Haskins" <ghaskins@...ell.com>
To:	"Pavel Machek" <pavel@....cz>
Cc:	<a.p.zijlstra@...llo.nl>, <mingo@...e.hu>, <bill.huey@...il.com>,
	<rostedt@...dmis.org>, <kevin@...man.org>, <tglx@...utronix.de>,
	<cminyard@...sta.com>, <dsingleton@...sta.com>,
	<dwalker@...sta.com>, "Moiz Kohari" <MKohari@...ell.com>,
	"Peter Morreale" <PMorreale@...ell.com>,
	"Sven Dietrich" <SDietrich@...ell.com>, <dsaxena@...xity.net>,
	<acme@...hat.com>, <ak@...e.de>, <gregkh@...e.de>,
	<npiggin@...e.de>, <linux-kernel@...r.kernel.org>,
	<linux-rt-users@...r.kernel.org>
Subject: Re: [(RT RFC) PATCH v2 3/9] rearrange rt_spin_lock sleep

>>> On Mon, Feb 25, 2008 at  4:54 PM, in message
<20080225215454.GF2659@....ucw.cz>, Pavel Machek <pavel@....cz> wrote: 
> Hi!
> 
>> @@ -720,7 +728,8 @@ rt_spin_lock_slowlock(struct rt_mutex *lock)
>>  	 * saved_state accordingly. If we did not get a real wakeup
>>  	 * then we return with the saved state.
>>  	 */
>> -	saved_state = xchg(&current->state, TASK_UNINTERRUPTIBLE);
>> +	saved_state = current->state;
>> +	smp_mb();
>>  
>>  	for (;;) {
>>  		unsigned long saved_flags;
> 
> Please document what the barrier is good for.

Yeah, I think you are right that this isn't needed.  I think that is a relic from back when I was debugging some other problems.  Let me wrap my head around the implications of removing it, and either remove it or document appropriately.

> 
> Plus, you are replacing atomic operation with nonatomic; is that ok?

Yeah, I think so.  We are substituting a write with a read, and word reads are always atomic anyway IIUC (or is that only true on certain architectures)?  Note that we are moving the atomic-write to be done later in the update_current() calls.

-Greg



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