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:	Tue, 19 Aug 2008 09:21:43 -0400
From:	Gregory Haskins <ghaskins@...ell.com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	mingo@...e.hu, rostedt@...dmis.org, tglx@...utronix.de,
	linux-kernel@...r.kernel.org, linux-rt-users@...r.kernel.org
Subject: Re: [PATCH RT 2/2] ftrace: fix elevated preempt_count in	wakeup-tracer

Peter Zijlstra wrote:
> On Tue, 2008-08-19 at 05:19 -0400, Gregory Haskins wrote:
>   
>> Suggested by Steve Rostedt to fix an observed "+1" in the preempt-count
>>
>> Signed-off-by: Gregory Haskins <ghaskins@...ell.com>
>> ---
>>
>>  kernel/trace/trace_sched_wakeup.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c
>> index c3a15bd..ae523fd 100644
>> --- a/kernel/trace/trace_sched_wakeup.c
>> +++ b/kernel/trace/trace_sched_wakeup.c
>> @@ -70,7 +70,9 @@ wakeup_tracer_call(unsigned long ip, unsigned long parent_ip)
>>  	if (task_cpu(wakeup_task) != cpu)
>>  		goto unlock;
>>  
>> +	preempt_enable_no_resched_notrace();
>>  	trace_function(tr, data, ip, parent_ip, flags);
>> +	preempt_disable_notrace();
>>     
>
> Is preempt_count > 1 at all times here?
>
> If not, it might drop to 0 and any interrupt might cause preemption -
> and its not obvious to me that that is actually correct.
>   
According to Steve, we are already in an interrupt-disabled section 
here, but I will defer to him.  He suggested I try this over an IRC 
conversation when I noticed a strange wakeup trace, and it seems to have 
solved the problem.

Im really sending this patch more of a reminder to Steve that he was 
going to fix this, rather than to accept my patch as is.  Of course I 
don't mind if it is accepted as is, and I can make the prologue/comments 
more descriptive if necessary.  But if Steve wants to do something like 
fold this into his ftrace series, that is fine too.  I just didn't want 
it to be forgotten ;)

-Greg



Download attachment "signature.asc" of type "application/pgp-signature" (258 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ