Skip to content

Commit d403a36

Browse files
htejunPeter Zijlstra
authored andcommitted
sched/fair: Move max_cfs_quota_period decl and default_cfs_period() def from fair.c to sched.h
max_cfs_quota_period is defined in core.c but has a declaration in fair.c. Move the declaration to kernel/sched/sched.h. Also, move default_cfs_period() from fair.c to sched.h. No functional changes. Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent dabe1be commit d403a36

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

kernel/sched/fair.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5617,15 +5617,6 @@ void cfs_bandwidth_usage_inc(void) {}
56175617
void cfs_bandwidth_usage_dec(void) {}
56185618
#endif /* !CONFIG_JUMP_LABEL */
56195619

5620-
/*
5621-
* default period for cfs group bandwidth.
5622-
* default: 0.1s, units: nanoseconds
5623-
*/
5624-
static inline u64 default_cfs_period(void)
5625-
{
5626-
return 100000000ULL;
5627-
}
5628-
56295620
static inline u64 sched_cfs_bandwidth_slice(void)
56305621
{
56315622
return (u64)sysctl_sched_cfs_bandwidth_slice * NSEC_PER_USEC;
@@ -6405,8 +6396,6 @@ static enum hrtimer_restart sched_cfs_slack_timer(struct hrtimer *timer)
64056396
return HRTIMER_NORESTART;
64066397
}
64076398

6408-
extern const u64 max_cfs_quota_period;
6409-
64106399
static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer)
64116400
{
64126401
struct cfs_bandwidth *cfs_b =

kernel/sched/sched.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,19 @@ static inline bool dl_server_active(struct sched_dl_entity *dl_se)
402402

403403
extern struct list_head task_groups;
404404

405+
#ifdef CONFIG_CFS_BANDWIDTH
406+
extern const u64 max_cfs_quota_period;
407+
408+
/*
409+
* default period for cfs group bandwidth.
410+
* default: 0.1s, units: nanoseconds
411+
*/
412+
static inline u64 default_cfs_period(void)
413+
{
414+
return 100000000ULL;
415+
}
416+
#endif /* CONFIG_CFS_BANDWIDTH */
417+
405418
struct cfs_bandwidth {
406419
#ifdef CONFIG_CFS_BANDWIDTH
407420
raw_spinlock_t lock;

0 commit comments

Comments
 (0)