Skip to content

Commit f4470cd

Browse files
Valentin SchneiderIngo Molnar
authored andcommitted
sched: Document arch_scale_*_capacity()
Rather that hide their purpose in some dark, damp corner of Documentation/, add some documentation to the default implementations. Signed-off-by: Valentin Schneider <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fcd7c9c commit f4470cd

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

include/linux/sched/topology.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ static inline bool cpus_share_cache(int this_cpu, int that_cpu)
217217
#endif /* !CONFIG_SMP */
218218

219219
#ifndef arch_scale_cpu_capacity
220+
/**
221+
* arch_scale_cpu_capacity - get the capacity scale factor of a given CPU.
222+
* @cpu: the CPU in question.
223+
*
224+
* Return: the CPU scale factor normalized against SCHED_CAPACITY_SCALE, i.e.
225+
*
226+
* max_perf(cpu)
227+
* ----------------------------- * SCHED_CAPACITY_SCALE
228+
* max(max_perf(c) : c \in CPUs)
229+
*/
220230
static __always_inline
221231
unsigned long arch_scale_cpu_capacity(int cpu)
222232
{

kernel/sched/sched.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,6 +2049,16 @@ void arch_scale_freq_tick(void)
20492049
#endif
20502050

20512051
#ifndef arch_scale_freq_capacity
2052+
/**
2053+
* arch_scale_freq_capacity - get the frequency scale factor of a given CPU.
2054+
* @cpu: the CPU in question.
2055+
*
2056+
* Return: the frequency scale factor normalized against SCHED_CAPACITY_SCALE, i.e.
2057+
*
2058+
* f_curr
2059+
* ------ * SCHED_CAPACITY_SCALE
2060+
* f_max
2061+
*/
20522062
static __always_inline
20532063
unsigned long arch_scale_freq_capacity(int cpu)
20542064
{

0 commit comments

Comments
 (0)