From: Zqiang <qiang1.zhang@intel.com>
To: mingo@redhat.com, peterz@infradead.org,
vincent.guittot@linaro.org, juri.lelli@redhat.com
Cc: dietmar.eggemann@arm.com, rostedt@goodmis.org,
vschneid@redhat.com, linux-kernel@vger.kernel.org,
qiang1.zhang@intel.com
Subject: [PATCH] sched/fair: Make hrtimer callback execute in the hard interrupt context
Date: Mon, 6 Mar 2023 15:09:38 +0800 [thread overview]
Message-ID: <20230306070938.3099273-1-qiang1.zhang@intel.com> (raw)
The scheduler related hrtimers callback will be executed in softirqd
context for PREEMPT_RT enabled kernel, this commit therefore mark
hrtimers as harded even on PREEMPT_RT enabled kernels, there is no
functional change.
Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
kernel/sched/fair.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c36aa54ae071..98c48d144089 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5610,7 +5610,7 @@ static void start_cfs_slack_bandwidth(struct cfs_bandwidth *cfs_b)
hrtimer_start(&cfs_b->slack_timer,
ns_to_ktime(cfs_bandwidth_slack_period),
- HRTIMER_MODE_REL);
+ HRTIMER_MODE_REL_HARD);
}
/* we know any runtime found here is valid as update_curr() precedes return */
@@ -5813,9 +5813,9 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b)
cfs_b->burst = 0;
INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq);
- hrtimer_init(&cfs_b->period_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED);
+ hrtimer_init(&cfs_b->period_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD);
cfs_b->period_timer.function = sched_cfs_period_timer;
- hrtimer_init(&cfs_b->slack_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ hrtimer_init(&cfs_b->slack_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
cfs_b->slack_timer.function = sched_cfs_slack_timer;
cfs_b->slack_started = false;
}
@@ -5835,7 +5835,7 @@ void start_cfs_bandwidth(struct cfs_bandwidth *cfs_b)
cfs_b->period_active = 1;
hrtimer_forward_now(&cfs_b->period_timer, cfs_b->period);
- hrtimer_start_expires(&cfs_b->period_timer, HRTIMER_MODE_ABS_PINNED);
+ hrtimer_start_expires(&cfs_b->period_timer, HRTIMER_MODE_ABS_PINNED_HARD);
}
static void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b)
--
2.25.1
next reply other threads:[~2023-03-06 7:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 7:09 Zqiang [this message]
2023-03-06 11:06 ` Peter Zijlstra
2023-03-06 14:27 ` Zhang, Qiang1
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=20230306070938.3099273-1-qiang1.zhang@intel.com \
--to=qiang1.zhang@intel.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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®