Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1541123

Re: [PATCH 09/10] s390/cputime: delayed accounting of system time

From Frederic Weisbecker <fweisbec@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 09/10] s390/cputime: delayed accounting of system time
Date 2016-12-13 15:40 +0100
Message-ID <sNWpk-2jB-29@gated-at.bofh.it> (permalink)
References (1 earlier) <sLdPI-4nv-9@gated-at.bofh.it> <sMEXv-2e3-3@gated-at.bofh.it> <sNw1P-37y-3@gated-at.bofh.it> <sNAoO-5UC-69@gated-at.bofh.it> <sNThM-wq-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Dec 13, 2016 at 12:13:22PM +0100, Martin Schwidefsky wrote:
> On Mon, 12 Dec 2016 16:02:30 +0100
> Frederic Weisbecker <fweisbec@gmail.com> wrote:
> 
> > On Mon, Dec 12, 2016 at 11:27:54AM +0100, Martin Schwidefsky wrote:
> > > 3) The call to vtime_flush in account_process_tick is done in irq context from
> > >    update_process_times. hardirq_offset==1 is also correct.  
> > 
> > Let's see this for example:
> > 
> > +       if ((tsk->flags & PF_VCPU) && (irq_count() - hardirq_offset == 0))
> > +               S390_lowcore.guest_timer += timer;
> > 
> > If the tick is interrupting guest, we have accounted the guest time on tick IRQ entry.
> > Now we are in the middle of the tick interrupt and since hardirq_offset is 1, we
> > are taking the above path by accounting half of the tick-IRQ time as guest, which is wrong,
> > it's actually IRQ time.
> 
> Hmm, you got me there. The system time from irq_enter until account_process_tick
> is reached is indeed IRQ time. It is not much but it is incorrect. The best fix
> would be to rip out the accounting of the system time from account_process_tick
> as irq_enter / irq_exit will do system time accounting anyway. To do that
> do_account_vtime needs to be split, because for the task switch we need to
> account the system time of the previous task.

Exactly!

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 09/10] s390/cputime: delayed accounting of system time Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-12-12 11:30 +0100
  Re: [PATCH 09/10] s390/cputime: delayed accounting of system time Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-12 16:10 +0100
    Re: [PATCH 09/10] s390/cputime: delayed accounting of system time Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-12-13 12:20 +0100
      Re: [PATCH 09/10] s390/cputime: delayed accounting of system time Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-12-13 14:30 +0100
        Re: [PATCH 09/10] s390/cputime: delayed accounting of system time Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-14 03:40 +0100
          Re: [PATCH 09/10] s390/cputime: delayed accounting of system time Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-12-20 15:20 +0100
            Re: [PATCH 09/10] s390/cputime: delayed accounting of system time Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-20 15:40 +0100
      Re: [PATCH 09/10] s390/cputime: delayed accounting of system time Frederic Weisbecker <fweisbec@gmail.com> - 2016-12-13 15:40 +0100

csiph-web