mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: qiang.zhang@windriver.com
To: tj@kernel.org, jiangshanlai@gmail.com, htejun@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] workqueue: Remove rcu_read_lock/unlock() in workqueue_congested()
Date: Wed, 17 Feb 2021 19:58:02 +0800	[thread overview]
Message-ID: <20210217115802.49580-1-qiang.zhang@windriver.com> (raw)

From: Zqiang <qiang.zhang@windriver.com>

The RCU read critical area already by preempt_disable/enable()
(equivalent to rcu_read_lock_sched/unlock_sched()) mark, so remove
rcu_read_lock/unlock().

Signed-off-by: Zqiang <qiang.zhang@windriver.com>
---
 kernel/workqueue.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 0d150da252e8..c599835ad6c3 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4540,7 +4540,6 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)
 	struct pool_workqueue *pwq;
 	bool ret;
 
-	rcu_read_lock();
 	preempt_disable();
 
 	if (cpu == WORK_CPU_UNBOUND)
@@ -4553,7 +4552,6 @@ bool workqueue_congested(int cpu, struct workqueue_struct *wq)
 
 	ret = !list_empty(&pwq->delayed_works);
 	preempt_enable();
-	rcu_read_unlock();
 
 	return ret;
 }
-- 
2.25.1


             reply	other threads:[~2021-02-17 12:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 11:58 qiang.zhang [this message]
2021-02-18  3:04 ` Lai Jiangshan
2021-02-18 15:17   ` Paul E. McKenney
2021-02-22  9:13     ` 回复: " Zhang, Qiang

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=20210217115802.49580-1-qiang.zhang@windriver.com \
    --to=qiang.zhang@windriver.com \
    --cc=htejun@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@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

all inboxes | Powered by JetHome®