Re: [PATCH 00/36] cputime: Convert core use of cputime_t to nsecs
From: Martin Schwidefsky
Date: Mon Nov 21 2016 - 05:17:46 EST
On Mon, 21 Nov 2016 07:59:56 +0100
Martin Schwidefsky <schwidefsky@xxxxxxxxxx> wrote:
> On Fri, 18 Nov 2016 15:47:02 +0100
> Frederic Weisbecker <fweisbec@xxxxxxxxx> wrote:
>
> > On Fri, Nov 18, 2016 at 01:08:46PM +0100, Martin Schwidefsky wrote:
> > > On Thu, 17 Nov 2016 19:08:07 +0100
> > > Frederic Weisbecker <fweisbec@xxxxxxxxx> wrote:
> > >
> > > Now it has been proposed to implement lazy accounting to accumulate deltas
> > > and do the expensive conversions only infrequently. This is pretty straight-
> > > forward for account_user_time but to do this for the account_system_time
> > > function is more complicated. The function has to differentiate between
> > > guest/hardirq/softirq and pure system time. We would need to keep sums for
> > > each bucket and provide a separate function to add to each bucket. Like
> > > account_guest_time(), account_hardirq_time(), account_softirq_time() and
> > > account_system_time(). Then it is up to the arch code to sort out the details
> > > and call the accounting code once per jiffy for each of the buckets.
> >
> > That wouldn't be too hard really. The s390 code in vtime.c already does that.
>
> Yes, I agree that the accumulating change would not be too hard. Can I make the
> request that we try to get that done first before doing the cleanup ?
Played with the idea a bit, here is a prototype patch to do the delay system time
accounting for s390. It applies against the latest s390 features tree which you'll
find here
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
The details probably needs some more work but it works.
--