diff mbox series

[2/4] sched/core: Export symbols used by cpuidle governors

Message ID 1637830481-21709-3-git-send-email-quic_mkshah@quicinc.com (mailing list archive)
State Rejected, archived
Headers show
Series Allow cpuidle governors to be compiled as modules | expand

Commit Message

Maulik Shah Nov. 25, 2021, 8:54 a.m. UTC
Export symbols that are used by cpuidle menu governor in preparation
to allow cpuidle governors to be compiled as modules.

Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
---
 kernel/sched/core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Peter Zijlstra Nov. 25, 2021, 9:35 a.m. UTC | #1
On Thu, Nov 25, 2021 at 02:24:39PM +0530, Maulik Shah wrote:
> Export symbols that are used by cpuidle menu governor in preparation
> to allow cpuidle governors to be compiled as modules.
> 
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Juri Lelli <juri.lelli@redhat.com>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
> ---
>  kernel/sched/core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 8cffe31..1d031e0 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -5047,6 +5047,7 @@ unsigned int nr_iowait_cpu(int cpu)
>  {
>  	return atomic_read(&cpu_rq(cpu)->nr_iowait);
>  }
> +EXPORT_SYMBOL(nr_iowait_cpu);

NACK, that function is batshit insane, exporting it serves nobody.
Maulik Shah Nov. 25, 2021, 1:31 p.m. UTC | #2
Hi Peter,

On 11/25/2021 3:05 PM, Peter Zijlstra wrote:
> On Thu, Nov 25, 2021 at 02:24:39PM +0530, Maulik Shah wrote:
>> Export symbols that are used by cpuidle menu governor in preparation
>> to allow cpuidle governors to be compiled as modules.
>>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Juri Lelli <juri.lelli@redhat.com>
>> Cc: Vincent Guittot <vincent.guittot@linaro.org>
>> Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
>> ---
>>   kernel/sched/core.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
>> index 8cffe31..1d031e0 100644
>> --- a/kernel/sched/core.c
>> +++ b/kernel/sched/core.c
>> @@ -5047,6 +5047,7 @@ unsigned int nr_iowait_cpu(int cpu)
>>   {
>>   	return atomic_read(&cpu_rq(cpu)->nr_iowait);
>>   }
>> +EXPORT_SYMBOL(nr_iowait_cpu);
> NACK, that function is batshit insane, exporting it serves nobody.
Thanks for the review.
Exporting is to serve cpuidle menu governor when its compiled as module 
(last patch in this series).

otherwise we get below error during compilation,
ERROR: modpost: "nr_iowait_cpu" [drivers/cpuidle/governors/menu.ko] 
undefined!

Do you suggest to use something else instead of this?
I think making this function inline and moving to linux/sched/stat.h 
(along with dependent data structures) may help but yet to try.

Thanks,
Maulik
Peter Zijlstra Nov. 26, 2021, 4:34 p.m. UTC | #3
On Thu, Nov 25, 2021 at 07:01:44PM +0530, Maulik Shah wrote:
> Hi Peter,
> 
> On 11/25/2021 3:05 PM, Peter Zijlstra wrote:
> > On Thu, Nov 25, 2021 at 02:24:39PM +0530, Maulik Shah wrote:
> > > Export symbols that are used by cpuidle menu governor in preparation
> > > to allow cpuidle governors to be compiled as modules.
> > > 
> > > Cc: Ingo Molnar <mingo@redhat.com>
> > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > Cc: Juri Lelli <juri.lelli@redhat.com>
> > > Cc: Vincent Guittot <vincent.guittot@linaro.org>
> > > Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
> > > ---
> > >   kernel/sched/core.c | 1 +
> > >   1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > > index 8cffe31..1d031e0 100644
> > > --- a/kernel/sched/core.c
> > > +++ b/kernel/sched/core.c
> > > @@ -5047,6 +5047,7 @@ unsigned int nr_iowait_cpu(int cpu)
> > >   {
> > >   	return atomic_read(&cpu_rq(cpu)->nr_iowait);
> > >   }
> > > +EXPORT_SYMBOL(nr_iowait_cpu);
> > NACK, that function is batshit insane, exporting it serves nobody.
> Thanks for the review.
> Exporting is to serve cpuidle menu governor when its compiled as module
> (last patch in this series).
> 
> otherwise we get below error during compilation,
> ERROR: modpost: "nr_iowait_cpu" [drivers/cpuidle/governors/menu.ko]
> undefined!
> 
> Do you suggest to use something else instead of this?

Yeah, schedutil :-)
diff mbox series

Patch

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 8cffe31..1d031e0 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5047,6 +5047,7 @@  unsigned int nr_iowait_cpu(int cpu)
 {
 	return atomic_read(&cpu_rq(cpu)->nr_iowait);
 }
+EXPORT_SYMBOL(nr_iowait_cpu);
 
 /*
  * IO-wait accounting, and how it's mostly bollocks (on SMP).