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: <20070104120216.GA19228@in.ibm.com>
Date:	Thu, 4 Jan 2007 17:32:16 +0530
From:	Srivatsa Vaddagiri <vatsa@...ibm.com>
To:	Oleg Nesterov <oleg@...sign.ru>
Cc:	Andrew Morton <akpm@...l.org>, David Howells <dhowells@...hat.com>,
	Christoph Hellwig <hch@...radead.org>,
	Ingo Molnar <mingo@...e.hu>,
	Linus Torvalds <torvalds@...l.org>,
	linux-kernel@...r.kernel.org, Gautham shenoy <ego@...ibm.com>
Subject: Re: [PATCH, RFC] reimplement flush_workqueue()

On Mon, Dec 18, 2006 at 01:34:16AM +0300, Oleg Nesterov wrote:
>  void fastcall flush_workqueue(struct workqueue_struct *wq)
>  {
> -	might_sleep();
> -
> +	mutex_lock(&workqueue_mutex);
>  	if (is_single_threaded(wq)) {
>  		/* Always use first cpu's area. */
> -		flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, singlethread_cpu),
> -					-1);
> +		flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, singlethread_cpu));
>  	} else {
>  		int cpu;
> 
> -		mutex_lock(&workqueue_mutex);
>  		for_each_online_cpu(cpu)


Can compiler optimizations lead to cpu_online_map being cached in a register 
while running this loop? AFAICS cpu_online_map is not declared to be
volatile. If it can be cached, then we have the danger of invoking 
flush_cpu_workqueue() on a dead cpu (because flush_cpu_workqueue drops
workqueue_mutex, cpu hp events can change cpu_online_map while we are in
flush_cpu_workqueue).

> -			flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, cpu), cpu);
> -		mutex_unlock(&workqueue_mutex);
> +			flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, cpu));


-- 
Regards,
vatsa
-
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