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
On Thu, 9 Apr 2015, 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
>
> So I'd rather suggest taking a direct look at the head, instead of
> calculating bit positions, masks, etc.
>
> Furthermore, we never actually use cpu_base->active_bases as a
> 'summary' value (which is the main point of bitmasks in general), so
> I'd remove that complication altogether.
>
> This would speed up various hrtimer primitives like
> hrtimer_remove()/add and simplify the code. It would be a net code
> shrink as well.

Well. You trade a bit more code against touching cache lines to figure
out whether the clock base has active timers or not. So for a lot of
scenarios where only clock monotonic is used you touch 3 cache lines
for nothing.

I'm about to send out a patch which actually makes better use of the
active_bases field without creating a code size explosion.

Thanks,

tglx


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