From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753564AbbBPSnw (ORCPT ); Mon, 16 Feb 2015 13:43:52 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:50200 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753303AbbBPSnv (ORCPT ); Mon, 16 Feb 2015 13:43:51 -0500 From: "Rafael J. Wysocki" To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@linutronix.de Subject: Re: [PATCH 07/35] clockevents: Make suspend/resume calls explicit Date: Mon, 16 Feb 2015 20:07:03 +0100 Message-ID: <43163258.EoKrB011eQ@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/3.19.0+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20150216122412.384801895@infradead.org> References: <20150216121435.203983131@infradead.org> <20150216122412.384801895@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, February 16, 2015 01:14:42 PM Peter Zijlstra wrote: > From: Thomas Gleixner > > clockevents_notify() is a leftover from the early design of the > clockevents facility. It's really not a notification mechanism, it's a > multiplex call. > > We are way better off to have explicit calls instead of this > monstrosity. Split out the suspend/resume() calls and invoke them > directly from the call sites. > > No locking required at this point because these calls happen with > interrupts disabled and a single cpu online. > > Signed-off-by: Thomas Gleixner > --- > arch/x86/xen/suspend.c | 11 ++++------- > include/linux/clockchips.h | 2 -- > include/linux/tick.h | 3 +++ > kernel/time/clockevents.c | 9 --------- > kernel/time/tick-common.c | 23 +++++++++++++++++++++-- > kernel/time/tick-internal.h | 3 ++- > kernel/time/timekeeping.c | 6 ++---- > 7 files changed, 32 insertions(+), 25 deletions(-) [cut] > Index: linux/include/linux/tick.h > =================================================================== > --- linux.orig/include/linux/tick.h > +++ linux/include/linux/tick.h > @@ -27,8 +27,11 @@ extern struct tick_device *tick_get_devi > > #ifdef CONFIG_GENERIC_CLOCKEVENTS > extern void __init tick_init(void); > +/* Should be core only, but XEN resume magic abuses this interface */ > +extern void tick_resume(void); > #else /* CONFIG_GENERIC_CLOCKEVENTS */ > static inline void tick_init(void) { } > +static inline void tick_resume(void) { } > #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ > > #ifdef CONFIG_TICK_ONESHOT [cut] > Index: linux/kernel/time/tick-common.c > =================================================================== > --- linux.orig/kernel/time/tick-common.c > +++ linux/kernel/time/tick-common.c > @@ -372,18 +372,37 @@ void tick_shutdown(unsigned int *cpup) > } > } > > +/** > + * tick_suspend - Suspend the tick and the broadcast device > + * > + * Called from syscore_suspend() via timekeeping_suspend with only one > + * CPU online and interrupts disabled. > + * > + * No locks required. Nothing can change the per cpu device. > + */ > void tick_suspend(void) > { > struct tick_device *td = this_cpu_ptr(&tick_cpu_device); > > clockevents_shutdown(td->evtdev); > + tick_suspend_broadcast(); > } > The above will slightly conflict with that commit of mine: http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=124cf9117c5f93cc5b324530b7e105b09c729d5d but that's not a big deal I guess. Rafael