[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070216064825.GA2829@in.ibm.com>
Date: Fri, 16 Feb 2007 12:18:25 +0530
From: Srivatsa Vaddagiri <vatsa@...ibm.com>
To: Oleg Nesterov <oleg@...sign.ru>
Cc: Gautham R Shenoy <ego@...ibm.com>, akpm@...l.org,
paulmck@...ibm.com, mingo@...e.hu, 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
On Wed, Feb 14, 2007 at 10:47:42PM +0300, Oleg Nesterov wrote:
> > 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.
I agree we need to have all threads frozen for hotplug. Only exception I
have found is kthread workqueue, which needs to be active after
freeze_processes(). stop_machine and CPU_UP_PREPARE/kthread_create()
depend on it to work.
A worker thread (like kthread workqueue), which has exempted itself from
hotplug-freeze, should essentially be prepared to get preempted any time and
made to run on any cpu. If that is the case, do you see any problems in having
the if () statement above?
> > +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.
Without this, thread cleanup (cwq->should_stop)/create(CPU_UP_PREPARE) becomes
racy
--
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