From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934948AbbDIJv3 (ORCPT ); Thu, 9 Apr 2015 05:51:29 -0400 Received: from www.linutronix.de ([62.245.132.108]:45741 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933221AbbDIIxX (ORCPT ); Thu, 9 Apr 2015 04:53:23 -0400 Date: Thu, 9 Apr 2015 10:53:40 +0200 (CEST) From: Thomas Gleixner To: Ingo Molnar cc: Viresh Kumar , Ingo Molnar , Peter Zijlstra , linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Preeti U Murthy Subject: Re: [PATCH] hrtimer: Replace cpu_base->active_bases with a direct check of the active list In-Reply-To: <20150409062841.GB14259@gmail.com> Message-ID: References: <20150409062841.GB14259@gmail.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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