mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [FOR REVIEW, PATCH 0/2] do_wait() cleanups.
Date: Wed,  6 May 2009 13:27:18 -0700 (PDT)	[thread overview]
Message-ID: <20090506202718.1B908FC39E@magilla.sf.frob.com> (raw)
In-Reply-To: Oleg Nesterov's message of  Wednesday, 6 May 2009 07:33:18 +0200 <20090506053318.GA31977@redhat.com>

> Also. This is completely off-topic wrt ptrace cleanups, but if we
> change do_wait() now perhaps it makes sense to optimize do_wait()
> in PIDTYPE_PID case. In this case we do not need to scan the lists,
> we can inspect the task directly. This change should be simple, but
> it will increase .text. Do you think it makes sense?

Yes, I think that's a worthwhile optimization in its own right.  In waitpid
calls using an explicit PID, it will be a huge help for both applications
with many other children and for applications with many threads (when the
waitpid caller does not happen to be the fork caller).  It looks like it
would be simple and cheap enough.

I doubt this would need much restructuring of the code (just a
short-circuit path that calls wait_consider_task from do_wait after
checking !task_detached(p) && !task_ptrace(p) && __WNOTHREAD ?
p->real_parent == current : same_thread_group(,p->real_parent)).
If that's true, then we can do this later after settling these
cleanups and ptrace stuff, perhaps along with the wakeup-avoidance
hack that never got finished.  That stuff is really just pure optimization
not inherently apropos to anything else.


Thanks,
Roland

      reply	other threads:[~2009-05-06 20:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-06  5:33 Oleg Nesterov
2009-05-06 20:27 ` Roland McGrath [this message]

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=20090506202718.1B908FC39E@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®