From: Tejun Heo <tj@kernel.org>
To: mingo@redhat.com, peterz@infradead.org
Cc: linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev,
void@manifault.com, arighi@nvidia.com, changwoo@igalia.com,
Tejun Heo <tj@kernel.org>
Subject: [PATCH 1/4] sched/fair: Move max_cfs_quota_period decl and default_cfs_period() def from fair.c to sched.h
Date: Fri, 13 Jun 2025 15:23:27 -1000 [thread overview]
Message-ID: <20250614012346.2358261-2-tj@kernel.org> (raw)
In-Reply-To: <20250614012346.2358261-1-tj@kernel.org>
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 <tj@kernel.org>
---
kernel/sched/fair.c | 11 -----------
kernel/sched/sched.h | 13 +++++++++++++
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 6b17d3da034a..707be4570430 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5617,15 +5617,6 @@ void cfs_bandwidth_usage_inc(void) {}
void cfs_bandwidth_usage_dec(void) {}
#endif /* !CONFIG_JUMP_LABEL */
-/*
- * default period for cfs group bandwidth.
- * default: 0.1s, units: nanoseconds
- */
-static inline u64 default_cfs_period(void)
-{
- return 100000000ULL;
-}
-
static inline u64 sched_cfs_bandwidth_slice(void)
{
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)
return HRTIMER_NORESTART;
}
-extern const u64 max_cfs_quota_period;
-
static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer)
{
struct cfs_bandwidth *cfs_b =
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index c323d015486c..e00b80cd998e 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -402,6 +402,19 @@ static inline bool dl_server_active(struct sched_dl_entity *dl_se)
extern struct list_head task_groups;
+#ifdef CONFIG_CFS_BANDWIDTH
+extern const u64 max_cfs_quota_period;
+
+/*
+ * default period for cfs group bandwidth.
+ * default: 0.1s, units: nanoseconds
+ */
+static inline u64 default_cfs_period(void)
+{
+ return 100000000ULL;
+}
+#endif /* CONFIG_CFS_BANDWIDTH */
+
struct cfs_bandwidth {
#ifdef CONFIG_CFS_BANDWIDTH
raw_spinlock_t lock;
--
2.49.0
next prev parent reply other threads:[~2025-06-14 1:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-14 1:23 [PATCHSET tip/sched/core] sched/core: Reorganize bandwidth control interface handling Tejun Heo
2025-06-14 1:23 ` Tejun Heo [this message]
2025-06-20 9:49 ` [tip: sched/core] sched/fair: Move max_cfs_quota_period decl and default_cfs_period() def from fair.c to sched.h tip-bot2 for Tejun Heo
2025-06-14 1:23 ` [PATCH 2/4] sched/core: Relocate tg_get_cfs_*() and cpu_cfs_*_read_*() Tejun Heo
2025-06-20 9:49 ` [tip: sched/core] " tip-bot2 for Tejun Heo
2025-06-14 1:23 ` [PATCH 3/4] sched/core: Reorganize cgroup bandwidth control interface file reads Tejun Heo
2025-06-20 9:49 ` [tip: sched/core] " tip-bot2 for Tejun Heo
2025-06-14 1:23 ` [PATCH 4/4] sched/core: Reorganize cgroup bandwidth control interface file writes Tejun Heo
2025-06-20 9:49 ` [tip: sched/core] " tip-bot2 for Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250614012346.2358261-2-tj@kernel.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sched-ext@lists.linux.dev \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®