From: Valentin Schneider <vschneid@redhat.com>
To: Ruipeng Qi <qiruipeng@lixiang.com>, mingo@redhat.com
Cc: peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, linux-kernel@vger.kernel.org,
ruipengqi7@gmail.com, Ruipeng Qi <qiruipeng@lixiang.com>
Subject: Re: [PATCH] sched/fair: Change mode of period_timer to HRTIMER_MODE_ABS_PINNED_HARD
Date: Mon, 31 Oct 2022 10:35:17 +0000 [thread overview]
Message-ID: <xhsmhcza8waai.mognet@vschneid.remote.csb> (raw)
In-Reply-To: <20221020091742.2962-1-qiruipeng@lixiang.com>
On 20/10/22 17:17, Ruipeng Qi wrote:
> Previous mode of period_timer is HRTIMER_MODE_ABS_PINNED,which means
> timer callback function will be executed in soft irq context.
>
> When one task group runs out of quota in a period,but holding lock of
> softirq_ctrl,the task will be rescheduled later,and then a system stall
> occurs:
> - next period comes,
> - __do_softirq can't acquire lock of softirq_ctrl,
> - __do_softirq will not be invoked,
> - callback of period_timer will not be invoked,
> - task group will not get any quota in any new period.
> - a system stall occurs.
>
> Changing mode of period_timer to HRTIMER_MODE_ABS_PINNED_HARD,which mean
> timer callback function executed in hard irq context fix this problem.
>
What you want here is some form of PI between the task doing the timer
soft expiry and the one holding the softirq_ctrl.lock. This doesn't happen
ATM because of should_wake_ksoftirqd() - if the lock is held then we won't
wake ksoftirqd, so we won't get a PI.
If you look at the RT stack, this commit gives you that:
c1d68f0da449 ("softirq: Use a dedicated thread for timer wakeups.")
(from linux-6.1.y-rt-rebase)
prev parent reply other threads:[~2022-10-31 10:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20221020091742.2962-1-qiruipeng@lixiang.com>
2022-10-20 16:39 ` Peter Zijlstra
2022-10-31 10:35 ` Valentin Schneider [this message]
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=xhsmhcza8waai.mognet@vschneid.remote.csb \
--to=vschneid@redhat.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=qiruipeng@lixiang.com \
--cc=rostedt@goodmis.org \
--cc=ruipengqi7@gmail.com \
--cc=vincent.guittot@linaro.org \
/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®