Re: [patch] don't preempt not TASK_RUNNING tasks

From: Ingo Molnar
Date: Fri Mar 20 2009 - 07:41:02 EST



* Miklos Szeredi <miklos@xxxxxxxxxx> wrote:

> On Fri, 20 Mar 2009, Ingo Molnar wrote:
> > > > The first line of attack for this problem is making
> > > > wait_task_inactive() sucks less, which shouldn't be too hard,
> > > > that unconditional 1 jiffy sleep is simply retarded.
> > >
> > > I completely agree. However, I'd like to have a non-invasive
> > > solution that can go into current and stable kernels so UML users
> > > don't need to suffer any more.
> >
> > Agreed. task_unlock_no_resched() should do that i think.
>
> I don't see how that would help.

it more clearly expresses the need there, and we already have
_no_resched API variants (we add them on an as-needed basis).

Doing:

preempt_disable();
read_lock();
...
read_unlock();
preempt_enable_no_resched();

Really just open-codes read_unlock_no_resched() and uglifies the
code.

> ptrace_stop() specifically would need read_unlock_no_resched().
> But I'm reluctant to add more spinlock functions with all their
> variants...

if you worry about backportability, we can certainly add the easy
fix too, if it's followed by the more involved fix(es).

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