mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: wenyang.linux@foxmail.com
To: Frederic Weisbecker <fweisbec@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>
Cc: Wen Yang <wenyang.linux@foxmail.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Paul Menzel <pmenzel@molgen.mpg.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] tick/rcu: fix an issue in the report_idle_softirq function
Date: Fri,  5 May 2023 00:12:53 +0800	[thread overview]
Message-ID: <tencent_5AAA3EEAB42095C9B7740BE62FBF9A67E007@qq.com> (raw)

From: Wen Yang <wenyang.linux@foxmail.com>

Commit 0345691b24c0 ("tick/rcu: Stop allowing RCU_SOFTIRQ in idle")
introduced the function report_idle_softirq, but the ratelimit logic
was broken because it is a static variable that returned before being
incremented, as follows:

	static int ratelimit;
...

	if (ratelimit < 10)
		return false;  ---> always return here
...
	ratelimit++;           ---> no chance to run

We need to adjust  the original "< 10" logic to ">= 10".

Fixes: 0345691b24c0 ("tick/rcu: Stop allowing RCU_SOFTIRQ in idle")
Signed-off-by: Wen Yang <wenyang.linux@foxmail.com>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org
---
 kernel/time/tick-sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index a46506f7ec6d..8891ad1d9a11 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -1035,7 +1035,7 @@ static bool report_idle_softirq(void)
 			return false;
 	}
 
-	if (ratelimit < 10)
+	if (ratelimit >= 10)
 		return false;
 
 	/* On RT, softirqs handling may be waiting on some lock */
-- 
2.25.1


             reply	other threads:[~2023-05-05 11:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 16:12 wenyang.linux [this message]
2023-06-10 12:45 ` [tip: timers/core] tick/rcu: Fix bogus ratelimit condition tip-bot2 for Wen Yang
2023-06-18 20:49 ` tip-bot2 for Wen Yang

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=tencent_5AAA3EEAB42095C9B7740BE62FBF9A67E007@qq.com \
    --to=wenyang.linux@foxmail.com \
    --cc=frederic@kernel.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmenzel@molgen.mpg.de \
    --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

all inboxes | Powered by JetHome®