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: <CAOMGZ=EBmgqgwrOmzqJaiGBmyoN7zG5AOEmeQ7LRymY65pHFqw@mail.gmail.com>
Date:	Wed, 27 Jul 2016 11:36:19 +0200
From:	Vegard Nossum <vegard.nossum@...il.com>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	Vegard Nossum <vegard.nossum@...cle.com>,
	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Rusty Russel <rusty@...tcorp.com.au>
Subject: Re: [PATCH] sched/core: make "Preemption disabled at" message more useful

On 27 July 2016 at 11:15, Ingo Molnar <mingo@...nel.org> wrote:
>
> * Vegard Nossum <vegard.nossum@...cle.com> wrote:
[...]

> These two blocks could be merged trivially, avoiding an #ifdef pair ...

>> @@ -7541,6 +7550,9 @@ EXPORT_SYMBOL(__might_sleep);
>>  void ___might_sleep(const char *file, int line, int preempt_offset)
>>  {
>>       static unsigned long prev_jiffy;        /* ratelimiting */
>> +#ifdef CONFIG_DEBUG_PREEMPT
>> +     unsigned long preempt_disable_ip;
>> +#endif
>>
>>       rcu_sleep_check(); /* WARN_ON_ONCE() by default, no rate limit reqd. */
>>       if ((preempt_count_equals(preempt_offset) && !irqs_disabled() &&
>> @@ -7551,6 +7563,11 @@ void ___might_sleep(const char *file, int line, int preempt_offset)
>>               return;
>>       prev_jiffy = jiffies;
>>
>> +#ifdef CONFIG_DEBUG_PREEMPT
>> +     /* Save this before calling printk(), since that will clobber it */
>> +     preempt_disable_ip = current->preempt_disable_ip;
>> +#endif
>
> Ditto.

I'm assuming you want to declare and initialise preempt_disable_ip at
once here, but it generates slightly worse code since it dereferences
current->preempt_disable_ip in the "fast path" (i.e. a sleeping
function is NOT called from an invalid context).

If you really prefer that I've attached an updated patch.

Let me know if I misunderstood :-)


Vegard

View attachment "0001-sched-core-make-Preemption-disabled-at-message-more-.patch" of type "text/x-patch" (3284 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ