[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070214194742.GA301@tv-sign.ru>
Date: Wed, 14 Feb 2007 22:47:42 +0300
From: Oleg Nesterov <oleg@...sign.ru>
To: Gautham R Shenoy <ego@...ibm.com>
Cc: akpm@...l.org, paulmck@...ibm.com, mingo@...e.hu, vatsa@...ibm.com,
dipankar@...ibm.com, venkatesh.pallipadi@...el.com,
linux-kernel@...r.kernel.org, rjw@...k.pl
Subject: Re: [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@...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