Skip to contentSkip to conversation

support for software direct frequency throttling?

DISCUSSION Mark Langsdorf 2 participants 4 messages Aug 7, 2013 – Oct 17, 2013

lore
Share & tools
lore
#0 lore raw

Is there an easy way to dynamically limit the maximum or minimum frequencies available to a governor? I'm trying to support frequency throttling in response to a thermal event (or theoretically to allow a BMC to set a minimum frequency regardless of current load).

I looked into doing this last year and it required some QoS patches that I don't think ever made it into the kernel.

Is there a straightforward way to do this right now? If not, is anyone working on implementing this? If not, any preferences from the maintainers on how I should implement?

Thanks,
Mark Langsdorf
Calxeda, Inc.

#1 lore raw
Quoted 9 lines · Mark Langsdorf

Is there an easy way to dynamically limit the maximum or minimum frequencies available to a governor? I'm trying to support frequency throttling in response to a thermal event (or theoretically to allow a BMC to set a minimum frequency regardless of current load).

I looked into doing this last year and it required some QoS patches that I don't think ever made it into the kernel.

Is there a straightforward way to do this right now?

Have you looked at drivers/thermal/cpu_cooling.c ?

Rafael

#2 lore raw
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Mark Langsdorf

Is there an easy way to dynamically limit the maximum or minimum frequencies available to a governor? I'm trying to support frequency throttling in response to a thermal event (or theoretically to allow a BMC to set a minimum frequency regardless of current load).

Quoted 6 lines
Quoted 4 lines

I looked into doing this last year and it required some QoS patches that I don't think ever made it into the kernel.

Is there a straightforward way to do this right now?

Have you looked at drivers/thermal/cpu_cooling.c ?

Yes, and I'm not sure how to use it get what I want.

I have a mailbox interrupt on my system that will trigger with a message when the BMC monitoring the thermal sensor notices that the temperature passes a trip point; the message will include the new maximum frequency. I want to pass that new maximum frequency to the cpufreq governor so it can reassess the current frequency against the maximum and lower it if need be.

I don't know in advance what the trip points or maximum frequencies are; the BMC managing the thermal sensor has that information but doesn't provide it to Linux.

The most appealing solution would be to just copy cpufreq_apply_cooling() and cpufreq_thermal_modifier() from drivers/thermal/cpu_cooling.c in the highbank_cpufreq.c driver, as they're the core logic of what I need. I don't know if that would be acceptable, though. I've looked at setting up a full thermal_zone solution, and its more than I need without actually giving me a good way to set the frequencies when I need to.

--Mark Langsdorf
Calxeda, Inc.

#3 lore raw
Quoted 27 lines · Mark Langsdorf
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Mark Langsdorf

Is there an easy way to dynamically limit the maximum or minimum frequencies available to a governor? I'm trying to support frequency throttling in response to a thermal event (or theoretically to allow a BMC to set a minimum frequency regardless of current load).

Quoted 6 lines
Quoted 4 lines

I looked into doing this last year and it required some QoS patches that I don't think ever made it into the kernel.

Is there a straightforward way to do this right now?

Have you looked at drivers/thermal/cpu_cooling.c ?

Yes, and I'm not sure how to use it get what I want.

I have a mailbox interrupt on my system that will trigger with a message when the BMC monitoring the thermal sensor notices that the temperature passes a trip point; the message will include the new maximum frequency. I want to pass that new maximum frequency to the cpufreq governor so it can reassess the current frequency against the maximum and lower it if need be.

I don't know in advance what the trip points or maximum frequencies are; the BMC managing the thermal sensor has that information but doesn't provide it to Linux.

Quoted 7 lines

The most appealing solution would be to just copy cpufreq_apply_cooling() and cpufreq_thermal_modifier() from drivers/thermal/cpu_cooling.c in the highbank_cpufreq.c driver, as they're the core logic of what I need. I don't know if that would be acceptable, though. I've looked at setting up a full thermal_zone solution, and its more than I need without actually giving me a good way to set the frequencies when I need to.

I see.

Rui, any advice on that?

Rafael