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: <Pine.LNX.4.58.0801260804230.16244@gandalf.stny.rr.com>
Date:	Sat, 26 Jan 2008 08:07:49 -0500 (EST)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
cc:	Pavel Machek <pavel@....cz>, LKML <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...e.hu>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Christoph Hellwig <hch@...radead.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
	Gregory Haskins <ghaskins@...ell.com>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Thomas Gleixner <tglx@...utronix.de>,
	Tim Bird <tim.bird@...sony.com>,
	Sam Ravnborg <sam@...nborg.org>,
	"Frank Ch. Eigler" <fche@...hat.com>,
	Jan Kiszka <jan.kiszka@...mens.com>,
	John Stultz <johnstul@...ibm.com>,
	Arjan van de Ven <arjan@...radead.org>,
	Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH 01/23 -v6] printk - dont wakeup klogd with interrupts
 disabled


On Sat, 26 Jan 2008, Peter Zijlstra wrote:
> >
> > I guess you are going to kill me... but
> >
> > CPU0					CPU1
> > if (!runqueue_is_locked()) {
> > 					locks runqueue
> > 	wake_up_klogd
> >
> > ....and we are dead. What is needed here is
> > "wake_up_klogd_if_you_can()" or something, that does trylock (atomic).
> >
> > ....but even this version is better than status quo, I'd say.
>
> Well, if cpu1 holds the lock, and cpu0 wants it, there should only be
> contention, I'm not seeing how this would deadlock.
>
> The deadlock problem was when cpu0 was already holding the rq->lock and
> wants to take it again.

Correct. The only race that this patch has is that there's a slight chance
you wont wake up the klogd when you could.

  CPU0 						CPU1

					locks_runqueue(cpu0)

  if (!runqueue_is_locked())
     [fails and klogd not woken]


But this is rare and pretty harmless. But it can be trivally fixed and
should be. But I'll rename the API to

   current_has_runqueue_lock()

This way we know exactly why it returns what it returns.

-- Steve

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