From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DD88C28CC5 for ; Wed, 5 Jun 2019 13:05:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6816220684 for ; Wed, 5 Jun 2019 13:05:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="Dvb5lvHN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727907AbfFENE6 (ORCPT ); Wed, 5 Jun 2019 09:04:58 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:39907 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727744AbfFENE5 (ORCPT ); Wed, 5 Jun 2019 09:04:57 -0400 Received: by mail-lj1-f195.google.com with SMTP id v18so1923047ljh.6 for ; Wed, 05 Jun 2019 06:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NRvNKqXzZztvQh3qtkPJBNz3Y41PCmY2mwresCdihvw=; b=Dvb5lvHNFy/YlX9VOpbVuAXgLc/Bkqb9FHL1QfulyPL3Nfu7LNFUDi2bdtRN38UIDB kpsq1w0ZNYuzjO5QiRB/VNBh4B2zYpwznNXZ2BcTi+m6xeubmV2GNyYxBYFe52W8b6at WcDyZ7BR4dByy2KBn+q2kg8uW24xdyRPcakrY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NRvNKqXzZztvQh3qtkPJBNz3Y41PCmY2mwresCdihvw=; b=aIaxvH03oinE4EsbPQ5B79AS6UayWsthIIS12h40+/D2/JJUoAAeAxCofhi70nXlHg RwGJuIcXlGpI0jAQ43WFL9VpsE+D6p9bzBTJ+aQbtrcWJs8X2ClVkE9A7voqs4uLew1Z evuMk/Oy/LYpe0Hlu7mgkm0uMIoRO7qb5zoAZ1RNPZrpXG9c30P0rH64nP491X7xbde+ 0SYOJM6yU7bcM6tFQq3N7uEl4RGpS6gUMpB8K0pErhe275Fcojd+p6SA7LTUwY/iFew1 0eoFJdoQn8LXuNw/UTviMXfnwRVeANdrJfBxbiPJvtlJhzzWwO4oKgjhmfnGsFOXjJX2 uWWA== X-Gm-Message-State: APjAAAUdjGhjyLp67CaYIBXgpddxTqGgGM/XHmsCuDe1/6GXDWFzSdBL ApBwUbIaIeYGO9orn4TBYzoTdlASS0GNuedbnDeLyA== X-Google-Smtp-Source: APXvYqyt7OLKBZ4DAerRqhiAeTPqPshOGmAnuk0KkZaQmyvMV/dwuVHzpUT44mnRI2A50tJlbF4XhdP85jTinsVz67M= X-Received: by 2002:a05:651c:87:: with SMTP id 7mr3383290ljq.184.1559739895494; Wed, 05 Jun 2019 06:04:55 -0700 (PDT) MIME-Version: 1.0 References: <20190601222738.6856-1-joel@joelfernandes.org> <20190601222738.6856-5-joel@joelfernandes.org> <20190605012429.wmlvlgn4mb4jkvua@ca-dmjordan1.us.oracle.com> In-Reply-To: <20190605012429.wmlvlgn4mb4jkvua@ca-dmjordan1.us.oracle.com> From: Joel Fernandes Date: Wed, 5 Jun 2019 09:04:44 -0400 Message-ID: Subject: Re: [RFC 4/6] workqueue: Convert for_each_wq to use built-in list check To: Daniel Jordan Cc: LKML , Alexey Kuznetsov , Bjorn Helgaas , Borislav Petkov , "David S. Miller" , Eric Dumazet , Greg Kroah-Hartman , Hideaki YOSHIFUJI , "H. Peter Anvin" , Ingo Molnar , Josh Triplett , Kees Cook , Kernel Hardening , Lai Jiangshan , Len Brown , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, Linux PM , Mathieu Desnoyers , Neil Brown , netdev , Oleg Nesterov , "Paul E. McKenney" , Pavel Machek , Peter Zilstra , "Rafael J. Wysocki" , rcu , Steven Rostedt , Tejun Heo , Thomas Gleixner , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Jun 4, 2019 at 9:25 PM Daniel Jordan wrote: > > 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) > > --- > > 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. Sure, will do. Thank you.