[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1504091050150.3845@nanos>
Date: Thu, 9 Apr 2015 10:53:40 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Ingo Molnar <mingo@...nel.org>
cc: Viresh Kumar <viresh.kumar@...aro.org>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
linaro-kernel@...ts.linaro.org, linux-kernel@...r.kernel.org,
Preeti U Murthy <preeti@...ux.vnet.ibm.com>
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists