Re: [patch] fix uml slowness caused by ptrace preemption bug onhost

From: Peter Zijlstra
Date: Fri Mar 20 2009 - 04:20:43 EST


On Thu, 2009-03-19 at 23:23 +0100, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi@xxxxxxx>
>
> This patch fixes bug #12208.
>
> This turned out to be not a scheduler regression, but an already
> existing problem in ptrace being triggered by subtle scheduler
> changes.
>
> The problem is this:
>
> - task A is ptracing task B
> - task B stops on a trace event
> - task A is woken up and preempts task B
> - task A calls ptrace on task B, which does ptrace_check_attach()
> - this calls wait_task_inactive(), which sees that task B is still on the runq
> - task A goes to sleep for a jiffy
> - ...
>
> Since UML does lots of the above sequences, those jiffies quickly add
> up to make it slow as hell.
>
> This patch solves this by not scheduling on preempt_enable() after
> ptrace_stop() has woken up the tracer.

Nice,.. however did you find this?

Ingo is looking at changing wait_task_inactive() to not be quite so
stupid. I'll let him respond with more details when he's done poking at
the code :-)


--
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/