From: Feng Tang <feng.tang@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Suresh Siddha <suresh.b.siddha@intel.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC] tick: Emphasize tck_broadcast_on_off could only be called for host cpu
Date: Tue, 14 Aug 2012 21:21:50 +0800 [thread overview]
Message-ID: <20120814212150.1a5400b0@feng-i7> (raw)
In-Reply-To: <1343721441-28148-1-git-send-email-feng.tang@intel.com>
On Tue, 31 Jul 2012 15:57:21 +0800
Feng Tang <feng.tang@intel.com> wrote:
> With current tick_do_broadcast_on_off() and tick_broadcast_on_off(),
> it only cares host cpu, and doesn't really support to make the on/off
> for another target CPU as it seems to be. So remove the unneeded
> online check and add a WARN to notify user who doesn't know this
> new usage model.
>
> Next step should be to remove those cases that sends the BROADCAST
> ON/OFF/FORCE msg on one cpu for another CPU, if this patch is reviewed
> to be ok.
>
> Signed-off-by: Feng Tang <feng.tang@intel.com>
> Cc: Suresh Siddha <suresh.b.siddha@intel.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> ---
> kernel/time/tick-broadcast.c | 15 +--------------
> kernel/time/tick-common.c | 6 +++++-
> kernel/time/tick-internal.h | 4 ++--
> 3 files changed, 8 insertions(+), 17 deletions(-)
>
> diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
> index f113755..0433274 100644
> --- a/kernel/time/tick-broadcast.c
> +++ b/kernel/time/tick-broadcast.c
> @@ -204,7 +204,7 @@ static void tick_handle_periodic_broadcast(struct clock_event_device *dev)
> * Powerstate information: The system enters/leaves a state, where
> * affected devices might stop
> */
> -static void tick_do_broadcast_on_off(unsigned long *reason)
> +void tick_broadcast_on_off(unsigned long *reason)
> {
> struct clock_event_device *bc, *dev;
> struct tick_device *td;
> @@ -266,19 +266,6 @@ out:
> }
>
> /*
> - * Powerstate information: The system enters/leaves a state, where
> - * affected devices might stop.
> - */
> -void tick_broadcast_on_off(unsigned long reason, int *oncpu)
> -{
> - if (!cpumask_test_cpu(*oncpu, cpu_online_mask))
> - printk(KERN_ERR "tick-broadcast: ignoring broadcast for "
> - "offline CPU #%d\n", *oncpu);
> - else
> - tick_do_broadcast_on_off(&reason);
> -}
> -
> -/*
> * Set the periodic handler depending on broadcast on/off
> */
> void tick_set_periodic_handler(struct clock_event_device *dev, int broadcast)
> diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
> index da6c9ec..950c635 100644
> --- a/kernel/time/tick-common.c
> +++ b/kernel/time/tick-common.c
> @@ -362,6 +362,8 @@ static void tick_resume(void)
> static int tick_notify(struct notifier_block *nb, unsigned long reason,
> void *dev)
> {
> + int *cpu = dev;
> +
> switch (reason) {
>
> case CLOCK_EVT_NOTIFY_ADD:
> @@ -370,7 +372,9 @@ static int tick_notify(struct notifier_block *nb, unsigned long reason,
> case CLOCK_EVT_NOTIFY_BROADCAST_ON:
> case CLOCK_EVT_NOTIFY_BROADCAST_OFF:
> case CLOCK_EVT_NOTIFY_BROADCAST_FORCE:
> - tick_broadcast_on_off(reason, dev);
> + WARN((*cpu != smp_processor_id()),
> + "BROADCAST ON/OFF/FORCE should only be fired for host CPU\n");
> + tick_broadcast_on_off(&reason);
> break;
>
> case CLOCK_EVT_NOTIFY_BROADCAST_ENTER:
> diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h
> index 4e265b9..40e4a8b 100644
> --- a/kernel/time/tick-internal.h
> +++ b/kernel/time/tick-internal.h
> @@ -90,7 +90,7 @@ static inline bool tick_broadcast_oneshot_available(void) { return false; }
> extern int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu);
> extern int tick_check_broadcast_device(struct clock_event_device *dev);
> extern int tick_is_broadcast_device(struct clock_event_device *dev);
> -extern void tick_broadcast_on_off(unsigned long reason, int *oncpu);
> +extern void tick_broadcast_on_off(unsigned long *reason);
> extern void tick_shutdown_broadcast(unsigned int *cpup);
> extern void tick_suspend_broadcast(void);
> extern int tick_resume_broadcast(void);
> @@ -115,7 +115,7 @@ static inline int tick_device_uses_broadcast(struct clock_event_device *dev,
> return 0;
> }
> static inline void tick_do_periodic_broadcast(struct clock_event_device *d) { }
> -static inline void tick_broadcast_on_off(unsigned long reason, int *oncpu) { }
> +static inline void tick_broadcast_on_off(unsigned long *reason) { }
> static inline void tick_shutdown_broadcast(unsigned int *cpup) { }
> static inline void tick_suspend_broadcast(void) { }
> static inline int tick_resume_broadcast(void) { return 0; }
Ping for comments.
Thanks,
Feng
prev parent reply other threads:[~2012-08-14 13:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-31 7:57 [PATCH RFC] tick: Emphasize tck_broadcast_on_off could only be called for host cpu Feng Tang
2012-08-14 13:21 ` Feng Tang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120814212150.1a5400b0@feng-i7 \
--to=feng.tang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox