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


Groups > linux.kernel > #1525166

Re: [PATCH v2] tile: avoid using clocksource_cyc2ns with absolute cycle count

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2] tile: avoid using clocksource_cyc2ns with absolute cycle count
Date 2016-11-18 11:40 +0100
Message-ID <sEOKm-5WQ-13@gated-at.bofh.it> (permalink)
References (1 earlier) <sEedQ-76Q-9@gated-at.bofh.it> <sEexb-7dl-7@gated-at.bofh.it> <sEf0d-7BQ-25@gated-at.bofh.it> <sErE6-7my-25@gated-at.bofh.it> <sEOKm-5WQ-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 17, 2016 at 03:00:14PM -0500, Chris Metcalf wrote:
> On 11/17/2016 4:53 AM, Peter Zijlstra wrote:
> >On Wed, Nov 16, 2016 at 03:16:59PM -0500, Chris Metcalf wrote:
> >>PeterZ (cc'ed) then improved it to use __int128 math via
> >>mul_u64_u32_shr(), but that doesn't help tile; we only do one multiply
> >>instead of two, but the multiply is handled by an out-of-line call to
> >>__multi3, and the sched_clock() function ends up about 2.5x slower as
> >>a result.
> >Well, only if you set CONFIG_ARCH_SUPPORTS_INT128, otherwise it reduces
> >to 2 32x23->64 multiplications, of which one if conditional on there
> >actually being bits set in the high word of the u64 argument.
> 
> I didn't notice that.  It took me down an interesting rathole.
> 
> Obviously the branch optimization won't help on cycle counter values,
> since we blow out of the low 32 bits in the first few seconds of
> uptime.  So the conditional test won't help, but the 32x32
> multiply optimizations should.

Now, I don't quite remember things, but isn't it the idea to convert
cycle deltas and accumulate in ns? That way you most always convert
small values.

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


Thread

[PATCH v2] tile: avoid using clocksource_cyc2ns with absolute cycle count Chris Metcalf <cmetcalf@mellanox.com> - 2016-11-16 20:40 +0100
  Re: [PATCH v2] tile: avoid using clocksource_cyc2ns with absolute  cycle count John Stultz <john.stultz@linaro.org> - 2016-11-16 21:00 +0100
    Re: [PATCH v2] tile: avoid using clocksource_cyc2ns with absolute  cycle count John Stultz <john.stultz@linaro.org> - 2016-11-16 21:30 +0100
      Re: [PATCH v2] tile: avoid using clocksource_cyc2ns with absolute  cycle count John Stultz <john.stultz@linaro.org> - 2016-11-16 21:40 +0100
    Re: [PATCH v2] tile: avoid using clocksource_cyc2ns with absolute  cycle count Peter Zijlstra <peterz@infradead.org> - 2016-11-17 11:00 +0100
      Re: [PATCH v2] tile: avoid using clocksource_cyc2ns with absolute  cycle count Peter Zijlstra <peterz@infradead.org> - 2016-11-18 11:40 +0100
        Re: [PATCH v2] tile: avoid using clocksource_cyc2ns with absolute  cycle count Peter Zijlstra <peterz@infradead.org> - 2016-11-18 16:00 +0100

csiph-web