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]
Message-ID: <47BF4AC5.7070507@gmail.com>
Date:	Fri, 22 Feb 2008 17:20:53 -0500
From:	Gregory Haskins <gregory.haskins.ml@...il.com>
To:	Pavel Machek <pavel@....cz>
CC:	Gregory Haskins <ghaskins@...ell.com>, mingo@...e.hu,
	a.p.zijlstra@...llo.nl, tglx@...utronix.de, rostedt@...dmis.org,
	linux-rt-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	bill.huey@...il.com, kevin@...man.org, cminyard@...sta.com,
	dsingleton@...sta.com, dwalker@...sta.com, npiggin@...e.de,
	dsaxena@...xity.net, ak@...e.de, gregkh@...e.de,
	sdietrich@...ell.com, pmorreale@...ell.com, mkohari@...ell.com
Subject: Re: [PATCH [RT] 11/14] optimize the !printk fastpath through the
 lock acquisition

Pavel Machek wrote:
> Hi!
> 
>> Decorate the printk path with an "unlikely()"
>>
>> Signed-off-by: Gregory Haskins <ghaskins@...ell.com>
>> ---
>>
>>  kernel/rtmutex.c |    8 ++++----
>>  1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
>> index 122f143..ebdaa17 100644
>> --- a/kernel/rtmutex.c
>> +++ b/kernel/rtmutex.c
>> @@ -660,12 +660,12 @@ rt_spin_lock_fastlock(struct rt_mutex *lock,
>>  		void fastcall (*slowfn)(struct rt_mutex *lock))
>>  {
>>  	/* Temporary HACK! */
>> -	if (!current->in_printk)
>> -		might_sleep();
>> -	else if (in_atomic() || irqs_disabled())
>> +	if (unlikely(current->in_printk) && (in_atomic() || irqs_disabled()))
>>  		/* don't grab locks for printk in atomic */
>>  		return;
>>  
>> +	might_sleep();
> 
> I think you changed the code here... you call might_sleep() in
> different cases afaict.

Agreed, but it's still correct afaict.  I added an extra might_sleep() 
to a path that really might sleep.  I should have mentioned that in the 
header.

In any case, its moot.  Andi indicated this patch is probably a no-op so 
I was considering dropping it on the v2 pass.

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ