From: Thomas Gleixner <tglx@linutronix.de>
To: Huacai Chen <chenhuacai@loongson.cn>,
"Paul E . McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <quic_neeraju@quicinc.com>,
Joel Fernandes <joel@joelfernandes.org>,
Josh Triplett <josh@joshtriplett.org>,
Boqun Feng <boqun.feng@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Zqiang <qiang.zhang1211@gmail.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
chenhuacai@kernel.org, rcu@vger.kernel.org,
linux-kernel@vger.kernel.org,
Huacai Chen <chenhuacai@loongson.cn>,
stable@vger.kernel.org, Binbin Zhou <zhoubinbin@loongson.cn>
Subject: Re: [PATCH V3] rcu: Update jiffies locally in rcu_cpu_stall_reset()
Date: Thu, 24 Aug 2023 11:37:41 +0200 [thread overview]
Message-ID: <87lee0dbmi.ffs@tglx> (raw)
In-Reply-To: <20230822040248.329442-1-chenhuacai@loongson.cn>
On Tue, Aug 22 2023 at 12:02, Huacai Chen wrote:
> + * This function may be called in NMI context, so we cannot use ktime_get_ns()
> + * and ktime_get_coarse_ns(). Instead, we use their inaccurate but safe friends
> + * ktime_get_mono_fast_ns() and ktime_get_seconds() which will cause rcu_state.
> + * jiffies_stall to be a little large than expected (harmless and safer).
What's inaccurate about ktime_get_mono_fast_ns()? Bogus comments are
even worse than no comments.
> */
> void rcu_cpu_stall_reset(void)
> {
> + u64 curr, last, delta;
> +
> + curr = ktime_get_mono_fast_ns();
> + last = ktime_get_seconds() * NSEC_PER_SEC;
So this will trigger a warning when someone debugs suspend with KGDB.
It seems the approach taken here seems to be to throw stuff at the wall
and see what sticks.
Thanks,
tglx
next prev parent reply other threads:[~2023-08-24 9:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 4:02 [PATCH V3] rcu: Update jiffies locally in rcu_cpu_stall_reset() Huacai Chen
2023-08-22 15:34 ` Joel Fernandes
2023-08-22 15:48 ` Huacai Chen
2023-08-22 15:57 ` Joel Fernandes
2023-08-22 16:05 ` Huacai Chen
2023-08-24 9:37 ` Thomas Gleixner [this message]
2023-08-24 12:52 ` Huacai Chen
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=87lee0dbmi.ffs@tglx \
--to=tglx@linutronix.de \
--cc=boqun.feng@gmail.com \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=qiang.zhang1211@gmail.com \
--cc=quic_neeraju@quicinc.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=stable@vger.kernel.org \
--cc=zhoubinbin@loongson.cn \
/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