Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758220AbbKSLOq (ORCPT ); Thu, 19 Nov 2015 06:14:46 -0500 Received: from www.linutronix.de ([62.245.132.108]:39501 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756140AbbKSLOp (ORCPT ); Thu, 19 Nov 2015 06:14:45 -0500 Date: Thu, 19 Nov 2015 12:14:01 +0100 (CET) From: Thomas Gleixner To: Russell King - ARM Linux cc: Marc Gonzalez , Daniel Lezcano , LKML , Mans Rullgard , Viresh Kumar , Nicolas Pitre , Tony Lindgren , Sebastian Frias Subject: Re: [PATCH] clocksource: Store reg field within struct clocksource In-Reply-To: <20151119110842.GX8644@n2100.arm.linux.org.uk> Message-ID: References: <564C8086.80804@sigmadesigns.com> <20151118172114.GS8644@n2100.arm.linux.org.uk> <20151119103645.GV8644@n2100.arm.linux.org.uk> <20151119110842.GX8644@n2100.arm.linux.org.uk> 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 Content-Length: 2226 Lines: 60 On Thu, 19 Nov 2015, Russell King - ARM Linux wrote: > On Thu, Nov 19, 2015 at 11:42:48AM +0100, Thomas Gleixner wrote: > > On Thu, 19 Nov 2015, Russell King - ARM Linux wrote: > > > The basic cause of this problem is the ____cacheline_aligned annotation > > > which effectively prevents wrapping struct clocksource to provide > > > implementation specific data. > > > > > > Maybe your idea is that struct clocksource should be bloated with all > > > implementation specific data in the long term? > > > > Certainly not. That mmio use case is sane enough, but you are right, > > that we should try to lift that ____cacheline_aligned restriction. > > I don't think the cache line alignment of struct clocksource matters > anymore - the core timekeeping code no longer uses struct clocksource > but instead uses struct timekeeper, which caches much of the data from > struct clocksource. The only member of struct clocksource which it > does access is max_cycles, which is more than 32 bytes into struct > clocksource. > > So, I see no reason to waste memory with all these struct clocksources > being bloated out to cacheline alignments. In addition, once > ____cacheline_aligned is removed, I see no reason for Marc's change > either. Right. I completely forgot that I rewrote the core part some time ago. I'm older than 50, so I'm entitled to use the beginning Alzheimer excuse. :) So yes, the alignment of the clocksource struct is not longer relevant. The case where we access clocksource->max_cycles is when CONFIG_DEBUG_TIMEKEEPING is enabled, which imposes worse performance problems to timekeeping than the extra cacheline. So the simple solution for this issue is indeed the one liner below. Thanks, tglx 8<------------------- --- tip.orig/include/linux/clocksource.h +++ tip/include/linux/clocksource.h @@ -95,7 +95,7 @@ struct clocksource { cycle_t wd_last; #endif struct module *owner; -} ____cacheline_aligned; +} /* * Clock source flags bits:: -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/