lkml.org 
[lkml]   [2007]   [Feb]   [14]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 14 Feb 2007 22:47:42 +0300
FromOleg Nesterov <>
SubjectRe: [RFC PATCH(Experimental) 1/4] freezer-cpu-hotplug core
Gautham, I'll try to apply this patch and read the code on Sunday, right
now a couple of comments about workqueue.c changes.

On 02/14, Gautham R Shenoy wrote:
>
> --- hotplug.orig/kernel/workqueue.c
> +++ hotplug/kernel/workqueue.c
> @@ -368,6 +368,7 @@ static int worker_thread(void *__cwq)
>  	DEFINE_WAIT(wait);
>  	struct k_sigaction sa;
>  	sigset_t blocked;
> +	int bind_cpu = smp_processor_id();
> 
>  	if (!cwq->wq->freezeable)
>  		current->flags |= PF_NOFREEZE;
> @@ -392,8 +393,11 @@ static int worker_thread(void *__cwq)
>  	do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
> 
>  	for (;;) {
> -		if (cwq->wq->freezeable)
> +		if (cwq->wq->freezeable) {

Else? This is wrong. The change like this should start from making all
cwq->threads freezeable, otherwise it just doesn't work.

>  			try_to_freeze();
> +			if (cpu_is_offline(bind_cpu))
> +				goto wait_to_die;
> +		}
>
> ...
>
> +
> +wait_to_die:
> +	/* Wait for kthread_stop */
> +	set_current_state(TASK_INTERRUPTIBLE);
> +	while (!kthread_should_stop()) {
> +		schedule();
> +		set_current_state(TASK_INTERRUPTIBLE);
> +	}
> +	__set_current_state(TASK_RUNNING);
> +	return 0;
>  }

I believe this is not needed, see the comments for the next patch.

Oleg.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-02-14 20:51    [from the cache]
©2003-2008