On Thu, Apr 05, 2007 at 02:53:56PM +0400, Oleg Nesterov wrote:
Not a bad idea.
Yes, that looks feasible and nice. But I remember making this change for
some subtle reason which I cannot recollect now.
Well, in this case this is not racy. Remember, we're doing a
thaw_process(p) in CPU_DEAD where p *is* frozen for cpu hotplug. So
the where we might call a freeze_process(p) after we do a thaw_process
doesn't seem to be feasible.
But I agree, we should definitely all thaw_process within kthread_stop.
Why the check kthread_should_stop() refrigerator() ?
As vatsa mentioned, we would be doing
task_lock(p);
freezer_exempt(p, FE_ALL); /* Doesn't exist as of now, but we can work
it out */
thaw_process(p);
task_unlock(p);
wait_for_completion();
So we are serializing the whole thing with task_lock() right?
This needs an extra field! We're supposed to be miserly when it comes to
adding new fields to task_struct, now aren't we :-)
Completely. Working on it now.
--
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"
-