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, 19 Sep 2011 19:33:28 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Christoph Lameter <cl@...two.org>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Christoph Lameter <cl@...ux.com>
Subject: Re: [RFC][PATCH 4/5] printk: Have wake_up_klogd() use
 __this_cpu_write()

On Mon, 2011-09-19 at 16:54 -0500, Christoph Lameter wrote:
> On Mon, 19 Sep 2011, Steven Rostedt wrote:
> 
> > From: Steven Rostedt <srostedt@...hat.com>
> >
> > The wake up code that triggers klogd does not really matter which
> > CPU it enables the wake up on. Every CPU will be doing a printk_tick()
> > and check the current CPU. As long as one of the CPUs triggers the
> > wakeup we are fine. Use __this_cpu_write() instead of this_cpu_write()
> > to show that we do not care.
> 
> printk_needs_cpu() is always called from context where we have disabled
> interrupts therefore this is safe to do.

hehe, the patch is deceiving ;)

@@ -1225,7 +1225,7 @@ int printk_needs_cpu(int cpu)
 void wake_up_klogd(void)
 {
        if (waitqueue_active(&log_wait))



The printk_needs_cpu may be in the patch header there, but the real
function name happened to be in the call itself. "wake_up_klogd()".
Note, just because something is always in a location that preemption is
disabled, does not mean it should use the __this_cpu*() variants.
Because if things change, it may become a problem later on.

-- Steve

> 
> Reviewed-by: Christoph Lameter <cl@...two.org>


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