|
Message-ID: <20190605012429.wmlvlgn4mb4jkvua@ca-dmjordan1.us.oracle.com> Date: Tue, 4 Jun 2019 21:24:29 -0400 From: Daniel Jordan <daniel.m.jordan@...cle.com> To: "Joel Fernandes (Google)" <joel@...lfernandes.org> Cc: linux-kernel@...r.kernel.org, Alexey Kuznetsov <kuznet@....inr.ac.ru>, Bjorn Helgaas <bhelgaas@...gle.com>, Borislav Petkov <bp@...en8.de>, "David S. Miller" <davem@...emloft.net>, edumazet@...gle.com, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>, "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>, Josh Triplett <josh@...htriplett.org>, keescook@...omium.org, kernel-hardening@...ts.openwall.com, Lai Jiangshan <jiangshanlai@...il.com>, Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org, linux-pci@...r.kernel.org, linux-pm@...r.kernel.org, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, neilb@...e.com, netdev@...r.kernel.org, oleg@...hat.com, "Paul E. McKenney" <paulmck@...ux.ibm.com>, Pavel Machek <pavel@....cz>, peterz@...radead.org, "Rafael J. Wysocki" <rjw@...ysocki.net>, rcu@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>, Tejun Heo <tj@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org> Subject: Re: [RFC 4/6] workqueue: Convert for_each_wq to use built-in list check On Sat, Jun 01, 2019 at 06:27:36PM -0400, Joel Fernandes (Google) wrote: > list_for_each_entry_rcu now has support to check for RCU reader sections > as well as lock. Just use the support in it, instead of explictly > checking in the caller. > > Signed-off-by: Joel Fernandes (Google) <joel@...lfernandes.org> > --- > kernel/workqueue.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/kernel/workqueue.c b/kernel/workqueue.c > index 9657315405de..91ed7aca16e5 100644 > --- a/kernel/workqueue.c > +++ b/kernel/workqueue.c > @@ -424,9 +424,8 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); > * ignored. > */ > #define for_each_pwq(pwq, wq) \ > - list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node) \ > - if (({ assert_rcu_or_wq_mutex(wq); false; })) { } \ > - else > + list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node, \ > + lock_is_held(&(wq->mutex).dep_map)) > I think the definition of assert_rcu_or_wq_mutex can also be deleted.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.