[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090320135147.GA20965@redhat.com>
Date: Fri, 20 Mar 2009 14:51:47 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Roland McGrath <roland@...hat.com>
Cc: Miklos Szeredi <miklos@...redi.hu>, peterz@...radead.org,
efault@....de, rjw@...k.pl, jdike@...toit.com, mingo@...e.hu,
user-mode-linux-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: Re: [patch] fix uml slowness caused by ptrace preemption bug on
host
On 03/19, Roland McGrath wrote:
>
> I'm no scheduler expert and I don't know whether the exact placement in
> your change is the optimal one.
Agreed, can't we do a bit more simple patch?
--- kernel/signal.c
+++ kernel/signal.c
@@ -1572,8 +1572,10 @@ static void ptrace_stop(int exit_code, i
spin_unlock_irq(¤t->sighand->siglock);
read_lock(&tasklist_lock);
if (may_ptrace_stop()) {
+ preempt_disable();
do_notify_parent_cldstop(current, CLD_TRAPPED);
read_unlock(&tasklist_lock);
+ preempt_enable_no_resched();
schedule();
} else {
/*
Yes, the task can be preempted right after spin_unlock(->siglock), but
this is unlikely. We need the "synchronous" wakeup, and this patch helps
as well.
Actually, I don't know which ptrace requests really need to make sure
the tracee was deactivated. Perhaps they can call wait_task_inactive()
themselves? I guess this is bad idea, but most of requests definitely
do not need wait_task_inactive().
Oleg.
--
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