From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: guoqi0226 <guoqi0226@163.com>
Cc: anna-maria@linutronix.de, frederic@kernel.org, tglx@kernel.org,
clrkwllms@kernel.org, rostedt@goodmis.org,
linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH v2] hrtimer: Fix is_hard/is_soft both false with missing HARD/SOFT flag
Date: Mon, 16 Mar 2026 08:33:13 +0100 [thread overview]
Message-ID: <20260316073313.Z8CsTXwi@linutronix.de> (raw)
In-Reply-To: <20260315063009.146668-1-guoqi0226@163.com>
On 2026-03-15 14:30:09 [+0800], guoqi0226 wrote:
> When hrtimer mode is only ABS/REL (e.g. HRTIMER_MODE_ABS) with no explicit
> SOFT/HARD flag, and CONFIG_PREEMPT_RT is disabled, both timer->is_hard and
> is_soft become false, violating the hard/soft exclusive design rule.
>
> Enforce correct hard/soft timer via effective_mode:
> - Enable softtimer when CONFIG_PREEMPT_RT is enabled and no HARD flag
> - Add HRTIMER_MODE_HARD to effective_mode when
> CONFIG_PREEMPT_RT is disabled (e.g. HRTIMER_MODE_ABS)
> - Compute timer->is_hard as !!(effective_mode & HRTIMER_MODE_HARD)
>
> This ensures exactly one of is_hard/is_soft is true.
How and where is this a problem?
> Signed-off-by: guoqi0226 <guoqi0226@163.com>
Sebastian
prev parent reply other threads:[~2026-03-16 7:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-15 6:30 [PATCH v2] hrtimer: Fix is_hard/is_soft both false with missing HARD/SOFT flag guoqi0226
2026-03-16 7:33 ` Sebastian Andrzej Siewior [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=20260316073313.Z8CsTXwi@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=frederic@kernel.org \
--cc=guoqi0226@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=rostedt@goodmis.org \
--cc=tglx@kernel.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