linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Q: do_notify_parent/do_notify_parent_cldstop && info.si_xtime
@ 2009-05-26 21:13 Oleg Nesterov
  2009-05-27  1:40 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2009-05-26 21:13 UTC (permalink / raw)
  To: Roland McGrath; +Cc: linux-kernel

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

Is this right?

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?

Ole.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Q: do_notify_parent/do_notify_parent_cldstop && info.si_xtime
  2009-05-26 21:13 Q: do_notify_parent/do_notify_parent_cldstop && info.si_xtime Oleg Nesterov
@ 2009-05-27  1:40 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2009-05-27  1:40 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: linux-kernel

> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-27  1:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-26 21:13 Q: do_notify_parent/do_notify_parent_cldstop && info.si_xtime Oleg Nesterov
2009-05-27  1:40 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).