All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	peterz@infradead.org, efault@gmx.de, rjw@sisk.pl,
	jdike@addtoit.com, mingo@elte.hu,
	user-mode-linux-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] fix uml slowness caused by ptrace preemption bug on host
Date: Fri, 20 Mar 2009 14:51:47 +0100	[thread overview]
Message-ID: <20090320135147.GA20965@redhat.com> (raw)
In-Reply-To: <20090319233311.8B26BFC381@magilla.sf.frob.com>

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(&current->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.


  parent reply	other threads:[~2009-03-20 13:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19 22:23 [patch] fix uml slowness caused by ptrace preemption bug on host Miklos Szeredi
2009-03-19 23:33 ` Roland McGrath
2009-03-20  8:05   ` Miklos Szeredi
2009-03-20 14:04     ` Oleg Nesterov
2009-03-20 14:04       ` [uml-devel] " Oleg Nesterov
2009-03-20 13:51   ` Oleg Nesterov [this message]
2009-03-20  8:19 ` Peter Zijlstra
2009-03-20  8:27   ` Miklos Szeredi
2009-03-20  8:30     ` Ingo Molnar
2009-03-20  8:30       ` [uml-devel] " Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090320135147.GA20965@redhat.com \
    --to=oleg@redhat.com \
    --cc=efault@gmx.de \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rjw@sisk.pl \
    --cc=roland@redhat.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.