diff mbox series

cpuidle: governor: export cpuidle governor functions

Message ID 010101746fc98add-45e77496-d2d6-4bc1-a1ce-0692599a9a7a-000000@us-west-2.amazonses.com
State New
Headers show
Series cpuidle: governor: export cpuidle governor functions | expand

Commit Message

Lina Iyer Sept. 8, 2020, 10:15 p.m. UTC
Commit 83788c0caed3 ("cpuidle: remove unused exports") removed
capability of registering cpuidle governors, which was unused at that
time. By exporting the symbol, let's allow platform specific modules to
register cpuidle governors and use cpuidle_governor_latency_req() to get
the QoS for the CPU.

Signed-off-by: Lina Iyer <ilina@codeaurora.org>
---
 drivers/cpuidle/governor.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Rafael J. Wysocki Sept. 22, 2020, 4 p.m. UTC | #1
Sorry for the delay.

On Wed, Sep 9, 2020 at 12:15 AM Lina Iyer <ilina@codeaurora.org> wrote:
>
> Commit 83788c0caed3 ("cpuidle: remove unused exports") removed
> capability of registering cpuidle governors, which was unused at that
> time. By exporting the symbol, let's allow platform specific modules to
> register cpuidle governors and use cpuidle_governor_latency_req() to get
> the QoS for the CPU.

Which platform-specific modules may want to do that and why?

> Signed-off-by: Lina Iyer <ilina@codeaurora.org>
> ---
>  drivers/cpuidle/governor.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c
> index 29acaf48e575..0e51ed25665e 100644
> --- a/drivers/cpuidle/governor.c
> +++ b/drivers/cpuidle/governor.c
> @@ -102,6 +102,7 @@ int cpuidle_register_governor(struct cpuidle_governor *gov)
>
>         return ret;
>  }
> +EXPORT_SYMBOL_GPL(cpuidle_register_governor);
>
>  /**
>   * cpuidle_governor_latency_req - Compute a latency constraint for CPU
> @@ -118,3 +119,4 @@ s64 cpuidle_governor_latency_req(unsigned int cpu)
>
>         return (s64)device_req * NSEC_PER_USEC;
>  }
> +EXPORT_SYMBOL_GPL(cpuidle_governor_latency_req);
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
Lina Iyer Sept. 22, 2020, 4:12 p.m. UTC | #2
Hi Rafael,

On Tue, Sep 22 2020 at 10:00 -0600, Rafael J. Wysocki wrote:
>Sorry for the delay.
>
>On Wed, Sep 9, 2020 at 12:15 AM Lina Iyer <ilina@codeaurora.org> wrote:
>>
>> Commit 83788c0caed3 ("cpuidle: remove unused exports") removed
>> capability of registering cpuidle governors, which was unused at that
>> time. By exporting the symbol, let's allow platform specific modules to
>> register cpuidle governors and use cpuidle_governor_latency_req() to get
>> the QoS for the CPU.
>
>Which platform-specific modules may want to do that and why?
>
We are planning a custom cpuidle governor for QCOM SoCs. With Android,
the idea is to make them loadable modules so they can be in a separate
partition.

Thanks,
Lina

>> Signed-off-by: Lina Iyer <ilina@codeaurora.org>
>> ---
>>  drivers/cpuidle/governor.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c
>> index 29acaf48e575..0e51ed25665e 100644
>> --- a/drivers/cpuidle/governor.c
>> +++ b/drivers/cpuidle/governor.c
>> @@ -102,6 +102,7 @@ int cpuidle_register_governor(struct cpuidle_governor *gov)
>>
>>         return ret;
>>  }
>> +EXPORT_SYMBOL_GPL(cpuidle_register_governor);
>>
>>  /**
>>   * cpuidle_governor_latency_req - Compute a latency constraint for CPU
>> @@ -118,3 +119,4 @@ s64 cpuidle_governor_latency_req(unsigned int cpu)
>>
>>         return (s64)device_req * NSEC_PER_USEC;
>>  }
>> +EXPORT_SYMBOL_GPL(cpuidle_governor_latency_req);
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>> a Linux Foundation Collaborative Project
>>
Rafael J. Wysocki Sept. 22, 2020, 5:27 p.m. UTC | #3
Hi Lina,

On Tue, Sep 22, 2020 at 6:12 PM Lina Iyer <ilina@codeaurora.org> wrote:
>
> Hi Rafael,
>
> On Tue, Sep 22 2020 at 10:00 -0600, Rafael J. Wysocki wrote:
> >Sorry for the delay.
> >
> >On Wed, Sep 9, 2020 at 12:15 AM Lina Iyer <ilina@codeaurora.org> wrote:
> >>
> >> Commit 83788c0caed3 ("cpuidle: remove unused exports") removed
> >> capability of registering cpuidle governors, which was unused at that
> >> time. By exporting the symbol, let's allow platform specific modules to
> >> register cpuidle governors and use cpuidle_governor_latency_req() to get
> >> the QoS for the CPU.
> >
> >Which platform-specific modules may want to do that and why?
> >
> We are planning a custom cpuidle governor for QCOM SoCs. With Android,
> the idea is to make them loadable modules so they can be in a separate
> partition.

Well, the $subject patch is not applicable without a mainline user
requiring this, so it needs to be posted along with that user.

Cheers!
Daniel Lezcano Oct. 9, 2020, 8:26 p.m. UTC | #4
Hi Rafael,

On 22/09/2020 19:27, Rafael J. Wysocki wrote:
> Hi Lina,
> 
> On Tue, Sep 22, 2020 at 6:12 PM Lina Iyer <ilina@codeaurora.org> wrote:
>>
>> Hi Rafael,
>>
>> On Tue, Sep 22 2020 at 10:00 -0600, Rafael J. Wysocki wrote:
>>> Sorry for the delay.
>>>
>>> On Wed, Sep 9, 2020 at 12:15 AM Lina Iyer <ilina@codeaurora.org> wrote:
>>>>
>>>> Commit 83788c0caed3 ("cpuidle: remove unused exports") removed
>>>> capability of registering cpuidle governors, which was unused at that
>>>> time. By exporting the symbol, let's allow platform specific modules to
>>>> register cpuidle governors and use cpuidle_governor_latency_req() to get
>>>> the QoS for the CPU.
>>>
>>> Which platform-specific modules may want to do that and why?
>>>
>> We are planning a custom cpuidle governor for QCOM SoCs. With Android,
>> the idea is to make them loadable modules so they can be in a separate
>> partition.
> 
> Well, the $subject patch is not applicable without a mainline user
> requiring this, so it needs to be posted along with that user.

Putting apart the custom cpuidle governor mentioned above, would it make
sense to convert the governors into modules ? It is pointless to have
all of them compiled in, especially with distros doing make
allmodconfig, no?
diff mbox series

Patch

diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c
index 29acaf48e575..0e51ed25665e 100644
--- a/drivers/cpuidle/governor.c
+++ b/drivers/cpuidle/governor.c
@@ -102,6 +102,7 @@  int cpuidle_register_governor(struct cpuidle_governor *gov)
 
 	return ret;
 }
+EXPORT_SYMBOL_GPL(cpuidle_register_governor);
 
 /**
  * cpuidle_governor_latency_req - Compute a latency constraint for CPU
@@ -118,3 +119,4 @@  s64 cpuidle_governor_latency_req(unsigned int cpu)
 
 	return (s64)device_req * NSEC_PER_USEC;
 }
+EXPORT_SYMBOL_GPL(cpuidle_governor_latency_req);