lkml.org 
[lkml]   [2015]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] hrtimer: Replace cpu_base->active_bases with a direct check of the active list

* Peter Zijlstra <peterz@infradead.org> wrote:

> On Thu, Apr 09, 2015 at 08:28:41AM +0200, Ingo Molnar wrote:
> > Btw., does cpu_base->active_bases even make sense? hrtimer bases are
> > fundamentally percpu, and to check whether there are any pending
> > timers is a very simple check:
> >
> > base->active->next != NULL
> >
>
> Yeah, that's 3 pointer dereferences from cpu_base, iow you traded a
> single bit test on an already loaded word for 3 potential cacheline
> misses.

But the clock bases are not aligned to cachelines, and we have 4 of
them. So in practice when we access one, we'll load the next one
anyway.

Furthermore the simplification is measurable, and a fair bit of it is
in various fast paths. I'd rather trade a bit of a cacheline footprint
for less overall complexity and faster code.

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-04-09 09:41    [W:0.246 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site