From: chenshiyan <chenshiyan@linux.alibaba.com>
To: fweisbec@gmail.com, tglx@linutronix.de, mingo@kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH V1] nohz: exit nohz idle before invoking softirq
Date: Mon, 28 Dec 2020 11:47:48 +0800 [thread overview]
Message-ID: <1609127268-40179-1-git-send-email-chenshiyan@linux.alibaba.com> (raw)
From: "shiyan.csy" <shiyan.csy@alibaba-inc.com>
exit nohz idle before invoking softirq, or it maymiss
some ticks during softirq.
Signed-off-by: Shiyan Chen <chenshiyan@linux.alibaba.com>
---
kernel/softirq.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 9d71046..59bd6fe 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -404,6 +404,10 @@ static inline void tick_irq_exit(void)
if (!in_irq())
tick_nohz_irq_exit();
}
+
+ /* need to exit nohz idle if there's a softirq */
+ if (in_serving_softirq() || local_softirq_pending())
+ tick_nohz_idle_exit();
#endif
}
@@ -416,10 +420,11 @@ static inline void __irq_exit_rcu(void)
#endif
account_hardirq_exit(current);
preempt_count_sub(HARDIRQ_OFFSET);
- if (!in_interrupt() && local_softirq_pending())
- invoke_softirq();
+ /* must call before invoke_softirq */
tick_irq_exit();
+ if (!in_interrupt() && local_softirq_pending())
+ invoke_softirq();
}
/**
--
1.8.3.1
next reply other threads:[~2020-12-28 3:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-28 3:47 chenshiyan [this message]
2020-12-28 13:28 ` [PATCH V1] nohz: exit nohz idle before invoking softirq Frederic Weisbecker
2020-12-29 8:39 ` [nohz] 7dbadb2bd2: WARNING:at_kernel/time/tick-sched.c:#tick_nohz_idle_exit kernel test robot
2020-12-29 8:39 ` kernel test robot
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=1609127268-40179-1-git-send-email-chenshiyan@linux.alibaba.com \
--to=chenshiyan@linux.alibaba.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.