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


Groups > linux.kernel > #1428678

Re: [PATCH 1/5] sched,time: count actually elapsed irq & softirq time

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] sched,time: count actually elapsed irq & softirq time
Date 2016-06-22 12:50 +0200
Message-ID <rMNTj-2fc-3@gated-at.bofh.it> (permalink)
References <rKI1H-25D-7@gated-at.bofh.it> <rKI1H-25D-21@gated-at.bofh.it> <rMBp8-2Kp-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 21/06/2016 23:21, Peter Zijlstra wrote:
> cputime_to_jiffies is a division, could we not avoid that by doing
> something like:
> 
> 	irq_jiffies = min(irq, jiffies_to_cputime(max_jiffies));
> 	while (irq_jiffies > cputime_one_jiffy) {
> 		irq_jiffies -= cputime_one_jiffy;
> 		cpustat[CPUTIME_IRQ] += cputime_one_jiffy;
> 	}
> 
> assuming that the loop is 'rare' etc.. If not, only do the division on
> that same > cputime_one_jiffy condition.

It's a division by a constant, it ought to become a multiplication.  For
64-bit it will, and context tracking is only enabled for 64-bit.

BTW, for 32-bit there's a monster of a macro to turn do_div with
constant divisor into multiplications in include/asm-generic/div64.h.
However, x86-32 doesn't use it.

Paolo

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


Thread

[PATCH 1/5] sched,time: count actually elapsed irq & softirq time riel@redhat.com - 2016-06-16 18:10 +0200
  Re: [PATCH 1/5] sched,time: count actually elapsed irq & softirq time kbuild test robot <lkp@intel.com> - 2016-06-16 18:30 +0200
  Re: [PATCH 1/5] sched,time: count actually elapsed irq & softirq time Peter Zijlstra <peterz@infradead.org> - 2016-06-21 23:30 +0200
    Re: [PATCH 1/5] sched,time: count actually elapsed irq & softirq  time Rik van Riel <riel@redhat.com> - 2016-06-22 00:30 +0200
    Re: [PATCH 1/5] sched,time: count actually elapsed irq & softirq time Paolo Bonzini <pbonzini@redhat.com> - 2016-06-22 12:50 +0200
      Re: [PATCH 1/5] sched,time: count actually elapsed irq & softirq time Peter Zijlstra <peterz@infradead.org> - 2016-06-22 13:00 +0200

csiph-web