From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: cuiguoqi <cuiguoqi@kylinos.cn>
Cc: tglx@linutronix.de, anna-maria@linutronix.de,
clrkwllms@kernel.org, frederic@kernel.org,
linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev,
rostedt@goodmis.org
Subject: Re: [PATCH] hrtimer: Fix the incorrect initialization of timer->is_hard
Date: Mon, 24 Mar 2025 09:49:44 +0100 [thread overview]
Message-ID: <20250324084944.z1J0Kf8c@linutronix.de> (raw)
In-Reply-To: <20250322082403.3126947-1-cuiguoqi@kylinos.cn>
On 2025-03-22 16:24:03 [+0800], cuiguoqi wrote:
> Hi tglx,
>
> First of all, I'd like to thank you for your reply and for pointing out the email issue.
>
> As you've accurately noted, when PREEMPT_RT is disabled, it introduces a certain
> degree of ambiguity for kernel developers. So far, no malfunctions have been
> observed as a direct consequence of this.
>
> This issue came to light during kernel development when using the is_hard flag,
> where the expected logic was not achieved.Naturally, we opted for the more reliable
> is_soft flag to address the situation.
>
> Consequently, when PREEMPT_RT is disabled, there is a potential risk if developers
> choose to use the is_hard flag. I firmly believe this risk should not be overlooked.
You shouldn't try to set the is_hard flag without knowing its
implications. HRTIMER_MODE_HARD is what you should pay attention to.
Everything else is implementation specific.
> I concur with your analysis that one of these flags is redundant. In fact,
> it might be possible to consolidate them based on the overall requirements.
A timer that is missing HRTIMER_MODE_HARD is not a automatically a
HRTIMER_MODE_SOFT and also a timer missing HRTIMER_MODE_SOFT is not
automatically HRTIMER_MODE_HARD. These depends on RT vs non-RT mode.
Wouldn't your suggestion influence the warning in
hrtimer_start_range_ns()?
> Thanks.
>
>
> Cui Guoqi
Sebastian
next prev parent reply other threads:[~2025-03-24 8:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 2:03 [PATCH] hrtimer: Fix the incorrect initialization of timer->is_hard cuiguoqi
2025-03-21 16:45 ` Thomas Gleixner
2025-03-22 8:24 ` cuiguoqi
2025-03-24 8:49 ` Sebastian Andrzej Siewior [this message]
2025-03-24 13:15 ` cuiguoqi
-- strict thread matches above, loose matches on Subject: below --
2025-03-21 1:51 cuiguoqi
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=20250324084944.z1J0Kf8c@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=cuiguoqi@kylinos.cn \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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