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: <20070109015152.d5021254.akpm@osdl.org>
Date:	Tue, 9 Jan 2007 01:51:52 -0800
From:	Andrew Morton <akpm@...l.org>
To:	vatsa@...ibm.com
Cc:	Oleg Nesterov <oleg@...sign.ru>,
	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] flush_cpu_workqueue: don't flush an empty ->worklist

On Tue, 9 Jan 2007 15:03:02 +0530
Srivatsa Vaddagiri <vatsa@...ibm.com> wrote:

> On Mon, Jan 08, 2007 at 09:26:56PM -0800, Andrew Morton wrote:
> > That's not correct.  freeze_processes() will freeze *all* processes.
> 
> I am not arguing whether all processes will be frozen. However my question was 
> on the freeze point. Let me ask the question with an example:
> 
> rtasd thread (arch/powerpc/platforms/pseries/rtasd.c) executes this simple
> loop:
> 
> 
> static int rtasd(void *unused)
> {
> 
> 	i = first_cpu(cpu_online_map);
> 
> 	while (1) {
> 
> 		set_cpus_allowed(current, cpumask_of_cpu(i));	/* can block */
> 
> 		/* we should now be running on cpu i */
> 
> 		do_something_on_a_cpu(i);
> 		
> 		/* sleep for some time */
> 
> 		i = next_cpu(cpu, cpu_online_map);
> 	}
> 
> }
> 
> This thread makes absolutely -no- calls to try_to_freeze() in its lifetime.

Looks like a bug to me.  powerpc does appear to try to support the freezer.

> 1. Does this mean that the thread can't be frozen? (lets say that the
>    thread's PF_NOFREEZE is not set)

yup.  I'd expect the freeze_processes() call would fail if this thread is
running.

>    AFAICS it can still be frozen by sending it a signal and have the signal 
>    delivery code call try_to_freeze() ..

kernel threads don't take signals in the same manner as userspace.  A
kernel thread needs to explicitly poll, via

	if (signal_pending(current))
		do_something()

rtasd doesn't do that, and using signals in-kernel is considered lame.

> 2. If the thread can be frozen at any arbitrary point of its execution, then I 
>    dont see what prevents cpu_online_map from changing under the feet of rtasd 
>    thread, 

It cannot.
-
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