Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1331257 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2016-02-10 16:10 +0100 |
| Last post | 2016-02-10 19:20 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH] irq_work: unhide irq_work_queue_on declaration on non-SMP Arnd Bergmann <arnd@arndb.de> - 2016-02-10 16:10 +0100
Re: [PATCH] irq_work: unhide irq_work_queue_on declaration on non-SMP "Rafael J. Wysocki" <rafael@kernel.org> - 2016-02-10 16:30 +0100
Re: [PATCH] irq_work: unhide irq_work_queue_on declaration on non-SMP Mark Brown <broonie@kernel.org> - 2016-02-10 19:20 +0100
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-02-10 16:10 +0100 |
| Subject | [PATCH] irq_work: unhide irq_work_queue_on declaration on non-SMP |
| Message-ID | <r0Ez1-3Nr-25@gated-at.bofh.it> |
The cpufreq code uses 'if (IS_ENABLED(CONFIG_SMP))' to check
whether it should queue a task on the local CPU or a remote
one, however the irq_work_queue_on() function is not declared
when CONFIG_SMP is not set:
drivers/cpufreq/cpufreq_governor.c: In function 'gov_queue_irq_work':
drivers/cpufreq/cpufreq_governor.c:251:3: error: implicit declaration of function 'irq_work_queue_on' [-Werror=implicit-function-declaration]
irq_work_queue_on(&policy_dbs->irq_work, smp_processor_id());
This changes the conditional declaration so that irq_work_queue_on
just queues the irq work on the only available CPU when CONFIG_SMP
is not set, which is presumably what most people need anyway.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 0144fa03ef46 ("cpufreq: governor: Replace timers with utilization update callbacks")
diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h
index 47b9ebd4a74f..c9bde50ef317 100644
--- a/include/linux/irq_work.h
+++ b/include/linux/irq_work.h
@@ -33,9 +33,13 @@ void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
#define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { .func = (_f), }
bool irq_work_queue(struct irq_work *work);
-
#ifdef CONFIG_SMP
bool irq_work_queue_on(struct irq_work *work, int cpu);
+#else
+static inline bool irq_work_queue_on(struct irq_work *work, int cpu)
+{
+ return irq_work_queue(work);
+}
#endif
void irq_work_tick(void);
[toc] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rafael@kernel.org> |
|---|---|
| Date | 2016-02-10 16:30 +0100 |
| Message-ID | <r0ESm-3Vo-7@gated-at.bofh.it> |
| In reply to | #1331257 |
On Wed, Feb 10, 2016 at 4:07 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The cpufreq code uses 'if (IS_ENABLED(CONFIG_SMP))' to check
> whether it should queue a task on the local CPU or a remote
> one, however the irq_work_queue_on() function is not declared
> when CONFIG_SMP is not set:
>
> drivers/cpufreq/cpufreq_governor.c: In function 'gov_queue_irq_work':
> drivers/cpufreq/cpufreq_governor.c:251:3: error: implicit declaration of function 'irq_work_queue_on' [-Werror=implicit-function-declaration]
> irq_work_queue_on(&policy_dbs->irq_work, smp_processor_id());
>
> This changes the conditional declaration so that irq_work_queue_on
> just queues the irq work on the only available CPU when CONFIG_SMP
> is not set, which is presumably what most people need anyway.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 0144fa03ef46 ("cpufreq: governor: Replace timers with utilization update callbacks")
>
> diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h
> index 47b9ebd4a74f..c9bde50ef317 100644
> --- a/include/linux/irq_work.h
> +++ b/include/linux/irq_work.h
> @@ -33,9 +33,13 @@ void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
> #define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { .func = (_f), }
>
> bool irq_work_queue(struct irq_work *work);
> -
> #ifdef CONFIG_SMP
> bool irq_work_queue_on(struct irq_work *work, int cpu);
> +#else
> +static inline bool irq_work_queue_on(struct irq_work *work, int cpu)
> +{
> + return irq_work_queue(work);
> +}
> #endif
>
> void irq_work_tick(void);
I was thinking about this too, but then cpufreq will be the only user of it.
In any case can do it at any time later. :-)
Thanks,
Rafael
[toc] | [prev] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2016-02-10 19:20 +0100 |
| Message-ID | <r0HwS-5Rl-23@gated-at.bofh.it> |
| In reply to | #1331269 |
[Multipart message — attachments visible in raw view] — view raw
On Wed, Feb 10, 2016 at 04:27:42PM +0100, Rafael J. Wysocki wrote:
> > +#else
> > +static inline bool irq_work_queue_on(struct irq_work *work, int cpu)
> > +{
> > + return irq_work_queue(work);
> > +}
> > #endif
> I was thinking about this too, but then cpufreq will be the only user of it.
> In any case can do it at any time later. :-)
Well, there's currently only two other users of irq_work_queue_on()
anyway so that's a third of the userbase and it does seem the obvious
way to support any other future users that want to scale down to !SMP
cases painlessly.
Reviwed-by: Mark Brown <broonie@kernel.org>
FWIW.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web