From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753270AbbDMHxq (ORCPT ); Mon, 13 Apr 2015 03:53:46 -0400 Received: from www.linutronix.de ([62.245.132.108]:58327 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752141AbbDMHxo (ORCPT ); Mon, 13 Apr 2015 03:53:44 -0400 Date: Mon, 13 Apr 2015 09:53:55 +0200 (CEST) From: Thomas Gleixner To: Preeti U Murthy cc: Peter Zijlstra , Ingo Molnar , Viresh Kumar , Ingo Molnar , linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hrtimer: Replace cpu_base->active_bases with a direct check of the active list In-Reply-To: <552B59C2.80709@linux.vnet.ibm.com> Message-ID: References: <20150409062841.GB14259@gmail.com> <20150409065730.GK27490@worktop.programming.kicks-ass.net> <20150409070917.GF14259@gmail.com> <20150409072038.GA30205@gmail.com> <20150409085859.GN5029@twins.programming.kicks-ass.net> <552B59C2.80709@linux.vnet.ibm.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 Mon, 13 Apr 2015, Preeti U Murthy wrote: > On 04/09/2015 02:48 PM, Thomas Gleixner wrote: > > On Thu, 9 Apr 2015, Peter Zijlstra wrote: > >> On Thu, Apr 09, 2015 at 09:20:39AM +0200, Ingo Molnar wrote: > >>> if at least one base is active (on my fairly standard system all cpus > >>> have at least one active hrtimer base all the time - and many cpus > >>> have two bases active), then we run hrtimer_get_softirq_time(), which > >>> dirties the cachelines of all 4 clock bases: > >>> > >>> base->clock_base[HRTIMER_BASE_REALTIME].softirq_time = xtim; > >>> base->clock_base[HRTIMER_BASE_MONOTONIC].softirq_time = mono; > >>> base->clock_base[HRTIMER_BASE_BOOTTIME].softirq_time = boot; > >>> base->clock_base[HRTIMER_BASE_TAI].softirq_time = tai; > >>> > >>> so in practice we not only touch every cacheline in every timer > >>> interrupt, but we _dirty_ them, even the inactive ones. > >>> > >> > >> Urgh we should really _really_ kill that entire softirq mess. > > > > That's the !highres part. We cannot kill that one unless we remove all > > support for machines which do not provide hardware for highres > > support. > > > > Now the softirq_time thing is an optimization which we added back in > > the days when hrtimer went into the tree and Roman complained about > > the base->get_time() invocation being overkill. > > > > The reasoning behing this was that low resolution systems do not need > > accurate time for the expiry and the forwarding because everything > > happens tick aligned. > > > > So for !HIGHRES we have: > > > > static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer) > > { > > return timer->base->softirq_time; > > } > > Why is this called softirq_time when the hrtimer is being serviced in > the hard irq context ? For historical reasons. Thanks, tglx