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] [day] [month] [year] [list]
Message-ID: <20070423191942.GA301@tv-sign.ru>
Date:	Mon, 23 Apr 2007 23:19:42 +0400
From:	Oleg Nesterov <oleg@...sign.ru>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	Gautham Shenoy <ego.lkml@...il.com>,
	LKML <linux-kernel@...r.kernel.org>, Pavel Machek <pavel@....cz>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Gautham R Shenoy <ego@...ibm.com>,
	Srivatsa Vaddagiri <vatsa@...ibm.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [RFC][PATCH][EXPERIMENTAL] CPU hotplug with frozen tasks

On 04/16, Rafael J. Wysocki wrote:
>
> Appended is the updated version of the patch (in addition to the changes
> mentioned above I've eliminated the magic constant 0x0008 from cpu.c by
> changing the new definitions in notifier.h).

Most sub-systems doesn't care about CPU_TASKS_FROZEN bit. Take for example
workqueue.c,

> --- linux-2.6.21-rc7.orig/kernel/workqueue.c	2007-04-16 23:05:17.000000000 +0200
> +++ linux-2.6.21-rc7/kernel/workqueue.c	2007-04-16 23:05:45.000000000 +0200
> @@ -757,6 +757,7 @@ static int __devinit workqueue_cpu_callb
>  
>  	switch (action) {
>  	case CPU_UP_PREPARE:
> +	case CPU_UP_PREPARE_FROZEN:
>  		mutex_lock(&workqueue_mutex);
>  		/* Create a new workqueue thread for it. */
>  		list_for_each_entry(wq, &workqueues, list) {
> @@ -768,6 +769,7 @@ static int __devinit workqueue_cpu_callb
>  		break;
>  
>  	case CPU_ONLINE:
> +	case CPU_ONLINE_FROZEN:
>  		/* Kick off worker threads. */
>  		list_for_each_entry(wq, &workqueues, list) {
>  			struct cpu_workqueue_struct *cwq;
> @@ -780,6 +782,7 @@ static int __devinit workqueue_cpu_callb
>  		break;
>  
>  	case CPU_UP_CANCELED:
> +	case CPU_UP_CANCELED_FROZEN:
>  		list_for_each_entry(wq, &workqueues, list) {
>  			if (!per_cpu_ptr(wq->cpu_wq, hotcpu)->thread)
>  				continue;
> @@ -792,14 +795,17 @@ static int __devinit workqueue_cpu_callb
>  		break;
>  
>  	case CPU_DOWN_PREPARE:
> +	case CPU_DOWN_PREPARE_FROZEN:
>  		mutex_lock(&workqueue_mutex);
>  		break;
>  
>  	case CPU_DOWN_FAILED:
> +	case CPU_DOWN_FAILED_FROZEN:
>  		mutex_unlock(&workqueue_mutex);
>  		break;
>  
>  	case CPU_DEAD:
> +	case CPU_DEAD_FROZEN:
>  		list_for_each_entry(wq, &workqueues, list)
>  			cleanup_workqueue_thread(wq, hotcpu);
>  		list_for_each_entry(wq, &workqueues, list)

I think it is better to add

	action &= ~CPU_TASKS_FROZEN;

at the head of workqueue_cpu_callback() instead. I think this way
you can make this patch a lot simpler and smaller.

Oleg.

-
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