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: <27b69672-d96b-8b1f-bf5b-df8a5a74f6df@sandisk.com>
Date:	Wed, 3 Aug 2016 17:05:37 -0700
From:	Bart Van Assche <bart.vanassche@...disk.com>
To:	Oleg Nesterov <oleg@...hat.com>
CC:	Peter Zijlstra <peterz@...radead.org>,
	"mingo@...nel.org" <mingo@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"Johannes Weiner" <hannes@...xchg.org>, Neil Brown <neilb@...e.de>,
	Michael Shaver <jmshaver@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched: Avoid that __wait_on_bit_lock() hangs

On 08/03/2016 02:30 PM, Oleg Nesterov wrote:
> I too can't understand the problem. Perhaps you missed the fact that
> abort_exclusive_wait() does everything under wait_queue_head_t->lock ?
>
> [ ... ]
>
> But we do not care if we race with another try_to_wake_up(), or even with
> another exclusive wake_up_nr(wq)/whatever unless wq is the same.
>
> And if this wq is the same, then wake_up_nr() will do try_to_wake_up/autoremove
> either before or after abort_exclusive_wait(), wake_up_nr() takes the same
> wq->lock.
>
> And this means that abort_exclusive_wait() can't be called "After try_to_wake_up()"
> and "before autoremove_wake_function()".

Hello Oleg,

I had noticed that abort_exclusive_wait() locks and unlocks 
wait_queue_head_t->lock.

What I had overlooked is that if try_to_wake_up() is called (indirectly) 
by __wake_up_common() that then wait_queue_head_t->lock is held. 
However, not all try_to_wake_up() callers hold that lock. Since I'm not 
a scheduler expert I would appreciate it if someone who is more familiar 
with the scheduler could explain me how the two patches that I posted in 
the context of this e-mail thread can cause a behavior difference.

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ