From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
To: balbir@linux.vnet.ibm.com
Cc: Oleg Nesterov <oleg@redhat.com>,
Shailabh Nagar <nagar1234@in.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
John stultz <johnstul@us.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Roland McGrath <roland@redhat.com>,
Valdis.Kletnieks@vt.edu, linux-kernel@vger.kernel.org,
linux-s390@vger.kernel.org
Subject: Re: [patch v2 4/4] taskstats: Export "cdata_wait" CPU times with taskstats
Date: Mon, 06 Dec 2010 13:37:37 +0100 [thread overview]
Message-ID: <1291639057.1848.85.camel@holzheu-laptop> (raw)
In-Reply-To: <20101203073303.GS2746@balbir.in.ibm.com>
Hello Balbir,
On Fri, 2010-12-03 at 13:03 +0530, Balbir Singh wrote:
> * Oleg Nesterov <oleg@redhat.com> [2010-12-01 19:51:28]:
>
> > On 11/29, Michael Holzheu wrote:
[snip]
> > Say, taskstats_exit()->fill_stats()->bacct_add_tsk(). Every thread
> > does this, including the group_leader. But, it is possible that
> > group_leader exits first, before other threads. IOW, what
> > stats->ac_cXtime actually mean?
> >
>
> stats->ac_* time was designed only for tgid's to begin with,
You mean for tids (threads/tasks), no? stats->ac_* time is only reported
for threads in bacct_add_tsk() and not for tgids.
> so I am
> not sure if ac_cXtime makes sense for threads
I would suggest to do it the same way as /proc/<tgid>/tasks/<tid>/stat.
It reports the (same) cumulative time for each thread. See
do_task_stat() in fs/proc/array.c. So IMHO also for taskstats it makes
sense to include the cXtime for all threads and not only for the thread
group leader.
Also I would include tgid in taskstats so that userspace can group the
tasks into thread groups.
I am not sure regarding the aggregation for tgids in
TASKSTATS_CMD_ATTR_TGID and exit events with group_dead=1. Currently
only the delay accounting numbers are aggregated. If we would do it
like /proc/<tgid>/stat (do_task_stat() with whole=1) we also could
aggregate also the other values e.g. the CPU time.
I think the following tgid data would make sense to be returned for
TASKSTATS_CMD_ATTR_TGID and exit events with group_dead=1:
bacct_add_tsk():
----------------
ac_pid thread group leader (tsk->tgid)
ac_etime thread group leader
ac_btime thread group leader
ac_nice thread group leader
ac_sched thread group leader
ac_uid thread group leader
ac_gid thread group leader
ac_ppid thread group leader
ac_comm thread group leader
ac_exit_code thread group leader
ac_flags thread group leader
ac_utimescaled ??
ac_stimescaled ??
ac_utime sum for all live threads + cdata_threads
ac_stime sum for all live threads + cdata_threads
ac_minflt sum for all live threads + cdata_threads
ac_majflt sum for all live threads + cdata_threads
new:
ac_cutime cdata_wait
ac_cstime cdata_wait
ac_tgid thread group leader
xacct_add_tsk():
----------------
coremem ?
virtmem ?
hiwater_rss thread group leader
hiwater_vm thread group leader
read_char sum for all live threads + tsk->signal.ioac
write_char sum for all live threads + tsk->signal.ioac
read_syscalls sum for all live threads + tsk->signal.ioac
write_syscalls sum for all live threads + tsk->signal.ioac
read_bytes sum for all live threads + tsk->signal.ioac
write bytes sum for all live threads + tsk->signal.ioac
cancelled_write_bytes sum for all live threads + tsk->signal.ioac
If we leave everything as it currently is for tgid accounting, we
probably should also not include the cXtime for tgids and just include
the data for threads (TASKSTATS_CMD_ATTR_PID and task exit events).
What do you think?
Michael
next prev parent reply other threads:[~2010-12-06 12:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-29 16:42 [patch v2 0/4] taskstats: Improve cumulative time accounting Michael Holzheu
2010-11-29 16:42 ` [patch v2 1/4] taskstats: Introduce "struct cdata" Michael Holzheu
2010-11-29 16:42 ` [patch v2 2/4] taskstats: Introduce __account_cdata() function Michael Holzheu
2010-11-29 16:42 ` [patch v2 3/4] taskstats: Introduce kernel.full_cdata sysctl Michael Holzheu
2010-11-29 16:42 ` [patch v2 4/4] taskstats: Export "cdata_wait" CPU times with taskstats Michael Holzheu
2010-12-01 18:51 ` Oleg Nesterov
2010-12-02 16:34 ` Michael Holzheu
2010-12-06 9:06 ` Balbir Singh
2010-12-08 20:23 ` Oleg Nesterov
2010-12-10 13:26 ` Michael Holzheu
[not found] ` <20101211173931.GA8084@redhat.com>
2010-12-13 13:05 ` Michael Holzheu
2010-12-13 13:20 ` Michael Holzheu
2010-12-13 14:33 ` Oleg Nesterov
2010-12-13 16:42 ` Michael Holzheu
2010-12-03 7:33 ` Balbir Singh
2010-12-06 12:37 ` Michael Holzheu [this message]
2010-12-06 15:15 ` Balbir Singh
2010-12-07 10:45 ` Michael Holzheu
2010-12-08 20:39 ` Oleg Nesterov
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=1291639057.1848.85.camel@holzheu-laptop \
--to=holzheu@linux.vnet.ibm.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nagar1234@in.ibm.com \
--cc=oleg@redhat.com \
--cc=roland@redhat.com \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
/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®