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: Q: do_notify_parent/do_notify_parent_cldstop && info.si_xtime
Date: Tue, 26 May 2009 18:40:19 -0700 (PDT)	[thread overview]
Message-ID: <20090527014019.52814FC36B@magilla.sf.frob.com> (raw)
In-Reply-To: Oleg Nesterov's message of  Tuesday, 26 May 2009 23:13:06 +0200 <20090526211306.GA7065@redhat.com>

> do_notify_parent() reports .si_Xtime = tsk->Xtime + signal->Xtime,
> but do_notify_parent_cldstop() uses .si_Xtime =  tsk->Xtime.
> 
> Is this right?

si_utime and si_stime are not standardized fields, so there is no
completely clear definition of "right" for these.

> Yes, tsk->Xtime + signal->Xtime does not make much sense for
> do_notify_parent_cldstop(), but reporting group_leader->Xtime
> (if not traced) doesn't look very right too. IOW, perhaps we
> need thread_group_cputime() here?

Solaris also has these fields, and a simple test on Solaris 10 indicates
that it does use the cumulative totals including dead threads for its
CLD_STOPPED SIGCHLDs.  That indeed makes sense to me for process job
control stop reports.

However, I think it makes sense to use just task->?time (as we do now) for
ptrace'd stops.  These notifications are per-thread.  Moreover, this is a
hot path in the context of a ptrace'd process.  thread_group_cputime() is
O(n) in the number of threads, so that would be a bad idea for anything
frequent.  (Real non-ptrace job control stops are not frequent like that.)

The caveats are that probably nobody cares about these values anyway but
any application that does care might already have adapted to the manifest
Linux behavior and be expecting leader-only (it doesn't seem likely to me).


Thanks,
Roland

      reply	other threads:[~2009-05-27  1:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26 21:13 Oleg Nesterov
2009-05-27  1:40 ` 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=20090527014019.52814FC36B@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®