Re: [RFC PATCH(Experimental) 0/4] Freezer based Cpu-hotplug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday, 18 February 2007 00:42, Oleg Nesterov wrote:
> On 02/17, Rafael J. Wysocki wrote:
> >
> > On Saturday, 17 February 2007 22:34, Oleg Nesterov wrote:
> > > 
> > > 	static inline int is_user_space(struct task_struct *p)
> > > 	{
> > > 		return p->mm && !(p->flags & PF_BORROWED_MM);
> > > 	}
> > > 
> > > This doesn't look right. First, an exiting task has ->mm == NULL after
> > > do_exit()->exit_mm(). Probably not a problem. However, PF_BORROWED_MM
> > > check is racy without task_lock(), so we can have a false positive as
> > > well. Is it ok? We can freeze aio_wq prematurely.
> > 
> > Right now aio_wq is not freezeable (PF_NOFREEZE).
> 
> Right now yes, but we are going to change this?

Well, is there any more reliable (and not racy) method of differentiating
between kernel threads and user space processes?

> > > 				cancel_freezing(p);
> > > 				continue;
> > > 
> > > Is it right? Shouldn't we increment "todo" counter?
> > 
> > No.  It would be wrong to do that, because TASK_TRACED tasks with frozen
> > parents cannot be frozen any further.
> 
> TASK_TRACED task could be woken by SIGKILL. cancel_freezing() clears TIF_FREEZE.
> The task may start do_exit() when try_to_freeze_tasks() returns "success".
> Probably not a problem.

Yup.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux