From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Glauber Costa <glommer@parallels.com>,
linux-kernel@vger.kernel.org, paul@paulmenage.org,
lizf@cn.fujitsu.com, daniel.lezcano@free.fr,
jbottomley@parallels.com,
Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: Re: [RFD 4/9] Make total_forks per-cgroup
Date: Wed, 28 Sep 2011 14:42:18 +0200 [thread overview]
Message-ID: <20110928144218.6a4882e5@de.ibm.com> (raw)
In-Reply-To: <1317206124.20318.6.camel@twins>
On Wed, 28 Sep 2011 12:35:24 +0200
Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> On Wed, 2011-09-28 at 10:13 +0200, Martin Schwidefsky wrote:
> > On Wed, 28 Sep 2011 00:00:37 +0200
> > Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> >
> > > On Fri, 2011-09-23 at 19:20 -0300, Glauber Costa wrote:
> > > > @@ -1039,6 +1035,8 @@ static void posix_cpu_timers_init(struct task_struct *tsk)
> > > > INIT_LIST_HEAD(&tsk->cpu_timers[2]);
> > > > }
> > > >
> > > > +struct task_group *task_group(struct task_struct *p);
> > >
> > > That doesn't appear to be actually used in this file..
> > >
> > > Also, since there's already a for_each_possible_cpu() loop in that
> > > proc/stat function, would it yield some code improvement to make
> > > total_forks a cpu_usage_stat?
> > >
> > > I guess the whole cputime64_t crap gets in the way of that being
> > > natural...
> > >
> > > We could of course kill off the cputime64_t thing, its pretty pointless
> > > and its a u64 all over the board. I think Martin or Heiko created this
> > > stuff (although I might be wrong, my git tree doesn't go back that far).
> >
> > The reason to introduce cputime_t has been that different architecture
> > needed differently sized integers for their respective representation
> > of cputime. On x86-32 the number of ticks is recorded in a u32, on s390
> > we needed a u64 for the cpu timer values. cputime64_t is needed for
> > cpustat and other sums of cputime that would overflow a cputime_t
> > (in particular on x86-32 with the u32 cputime_t and the u64 cputime64_t).
> >
> > Now we would convert everything to u64 but that would cause x86-32 to
> > use 64-bit arithmetic for the tick counter. If that is acceptable I
> > can't say.
>
> Right, so the main point was about cputime64_t, we might as well use a
> u64 for that throughout and ditch the silly cputime64_$op() accessors
> and write normal code.
>
> But even if cputime_t differs between 32 and 64 bit machines, there is
> no reason actually use cputime_add(), C can do this.
>
> The only reason to use things like cputime_add() is if you use a non
> simple type, but that doesn't seem to be the case.
>
> So I think we can simplify the code lots by doing away with cputime64_t
> and all the cputime_*() functions. We can keep cputime_t, or we can use
> unsigned long, which I think will end up doing pretty much the same.
>
> That is, am I missing some added value of all this cputime*() foo?
C can do the math as long as the encoding of the cputime is simple enough.
Can we demand that a cputime value needs to be an integral type ?
What I did when I wrote all that stuff is to define cputime_t as a struct
that contains a single u64. That way I found all the places in the kernel
that used a cputime and could convert the code accordingly.
My fear is that if the cputime_xxx operations are removed, code will
sneak in again that just uses an unsigned long instead of a cputime_t.
That would break any arch that requires something bigger than a u32 for
its cputime. I really have to find my old debugging patch and see if we
already have bit rot in regard to cputime_t.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
next prev parent reply other threads:[~2011-09-28 12:43 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-23 22:20 [RFD 0/9] per-cgroup /proc/stat statistics Glauber Costa
2011-09-23 22:20 ` [RFD 1/9] Change cpustat fields to an array Glauber Costa
2011-09-27 21:00 ` Peter Zijlstra
2011-09-28 15:13 ` Glauber Costa
2011-09-28 15:23 ` Peter Zijlstra
2011-09-28 18:19 ` Glauber Costa
2011-09-28 19:09 ` Peter Zijlstra
2011-09-28 20:04 ` Glauber Costa
2011-10-01 17:47 ` Glauber Costa
2011-09-27 21:03 ` Peter Zijlstra
2011-09-28 15:14 ` Glauber Costa
2011-09-23 22:20 ` [RFD 2/9] Move /proc/stat logic inside sched.c Glauber Costa
2011-09-23 22:20 ` [RFD 3/9] Display /proc/stat information per cgroup Glauber Costa
2011-09-27 17:01 ` Balbir Singh
2011-09-27 18:42 ` Glauber Costa
2011-09-27 22:21 ` Peter Zijlstra
2011-09-28 15:22 ` Glauber Costa
2011-09-28 15:23 ` Glauber Costa
2011-09-27 21:48 ` Peter Zijlstra
2011-09-28 15:14 ` Glauber Costa
2011-09-27 21:52 ` Peter Zijlstra
2011-09-28 15:15 ` Glauber Costa
2011-09-23 22:20 ` [RFD 4/9] Make total_forks per-cgroup Glauber Costa
2011-09-27 22:00 ` Peter Zijlstra
2011-09-28 8:13 ` Martin Schwidefsky
2011-09-28 10:35 ` Peter Zijlstra
2011-09-28 12:42 ` Martin Schwidefsky [this message]
2011-09-28 12:53 ` Peter Zijlstra
2011-09-28 15:29 ` Glauber Costa
2011-09-28 15:33 ` Peter Zijlstra
2011-09-28 15:35 ` Glauber Costa
2011-09-28 15:37 ` Peter Zijlstra
2011-09-28 15:39 ` Glauber Costa
2011-09-28 15:28 ` Glauber Costa
2011-09-28 15:27 ` Glauber Costa
2011-09-28 15:26 ` Glauber Costa
2011-09-23 22:20 ` [RFD 5/9] per-cgroup boot time Glauber Costa
2011-09-23 22:20 ` [RFD 6/9] Report steal time for cgroup Glauber Costa
2011-09-23 22:20 ` [RFD 7/9] provide a version of cpuacct statistics inside cpu cgroup Glauber Costa
2011-09-23 22:20 ` [RFD 8/9] provide a version of cpuusage " Glauber Costa
2011-09-23 22:20 ` [RFD 9/9] Change CPUACCT to default n Glauber Costa
2011-09-27 22:11 ` [RFD 0/9] per-cgroup /proc/stat statistics Peter Zijlstra
2011-09-28 15:21 ` Glauber Costa
2011-09-28 15:27 ` Peter Zijlstra
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=20110928144218.6a4882e5@de.ibm.com \
--to=schwidefsky@de.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=daniel.lezcano@free.fr \
--cc=glommer@parallels.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jbottomley@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=paul@paulmenage.org \
/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
Powered by JetHome