Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp157309ybi; Thu, 11 Jul 2019 16:45:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqx35OrScbYSdGdYjpPTpSNlBJVKShasu8uPeP6pAOjM3i1n/eNZzp4ih9tTuarfrrr6z2K0 X-Received: by 2002:a17:902:694a:: with SMTP id k10mr7534169plt.255.1562888756440; Thu, 11 Jul 2019 16:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562888756; cv=none; d=google.com; s=arc-20160816; b=q5oSlt0puvXjYTT0UQUQt0tn4Xaq2nQ7ewlOyVj/tQ7snWuTdqcKmWPIV5aihbJxGc 8st3shEYB0xYmgcptSKgVB12JiC8WpHy4VSdnephvrCT+lxv5VrZTfa5SD9HIO/687DE UueZps4e0VDgoBC5JHepjdKnxD/LA5CD784L3Mwn5gOB+lwJL0lJ5ZQg79uTRVqvG95z W6xRTzILPqaywLD9EY0VodXDPDWtqq6HeCyaSgLUghN4I5zyIZlcsNxByB4qFK10/N63 eGxSTyQYKRjAP3QjlDeCI6el0dbvDc5a4X79KHWlzjs+IlqnhxmjdlUv4hbkaRSSD4in 065g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sb5/sBlO0o0IY+ND5ZXjrKZw9gM/z/BZ2b8OMvqM37o=; b=DVbzHpocIQBBwbYaYcOCsvewA5OcSjOSRbK1wR9wMYFZd/HGhAmSav6jDzxXgEt1Rs jmy3dDeAOsYk93nkXZNHvslOYsmvl3/ABKzzANj+ddb92KxemXnEhKaz0tMpV7sIEj6T f0ZHmYo/iYyBe1qZGUT5o50GHWPaySmjT2EacyzjWAPQ08KWZ0SPCezJgtann6WTx5wi JV2agezXaRypc51MDXdXs6TdgolLBzAlkrRfuBKrEzV7YV/hq8+1Cji0iYf3hAM3dV1+ Zdw43Wz+G4KBzKdeyw+ik/vuhZyDpbsDdrYT0oumtS+7X0uctHWIyBf4DeWcCny9oNpa H8rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=tCGTNt4C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6si6341063pjn.10.2019.07.11.16.45.41; Thu, 11 Jul 2019 16:45:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=tCGTNt4C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730527AbfGKXoi (ORCPT + 99 others); Thu, 11 Jul 2019 19:44:38 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:33002 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730497AbfGKXob (ORCPT ); Thu, 11 Jul 2019 19:44:31 -0400 Received: by mail-pl1-f195.google.com with SMTP id c14so3827256plo.0 for ; Thu, 11 Jul 2019 16:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sb5/sBlO0o0IY+ND5ZXjrKZw9gM/z/BZ2b8OMvqM37o=; b=tCGTNt4ClbRqV/NfTPLBheEFeH7Zn70VzEPVb6u6yQtg9GPOuDTUPJlXw6bBhUJ1CR QpGk/qoWbRMoK0Pts8WznAkBiv/X+3OAFvGO2tXIqriAKW54HJaBcZeAgZjm6E+3gJ7u xfrwf9Vd3o1AR/P1EbjFliZLl/0moKn0MvFEE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sb5/sBlO0o0IY+ND5ZXjrKZw9gM/z/BZ2b8OMvqM37o=; b=YF3O6Ir/q1hSXcz8aFYUW7v0jCFJ/dM50UZljo1QiH+7eHhYokzWCjOO9awvp2YcuR cPm3xCN+ZoOtL/afoGsHrZsF3couA8gPWDQB1eMoHyAUNCXPmPmr/kwPzWgOfklNLYov Di5woNqLixCbipl9d1lvozDYQCx41h4sfc2CFa8xrimYUg47wqT+e7kM1TxaEPhHpm0+ DgJ/hzNUkbRAorum7A1CbPgQIr92IKjkGcjnVFpDPb8eVBeCKJGPgiEp2pHsJgY6JHgS qeo5hCR7BzNoyoW1Rj7VxuIEiZ9kIibc2R1agrkSsYwZz2OvaXEtQ/F3yJ50MhRLHC6D Y0Vw== X-Gm-Message-State: APjAAAU0ewfd1qhAR9S5rJHvkDDUXQL0l3BumBFpU1HIS0WTQWn4hTcg nL2j/j+Jhutgj1hXO3oQCa1xrXh5 X-Received: by 2002:a17:902:381:: with SMTP id d1mr7408739pld.331.1562888670006; Thu, 11 Jul 2019 16:44:30 -0700 (PDT) Received: from joelaf.cam.corp.google.com ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id t10sm6163450pjr.13.2019.07.11.16.44.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 11 Jul 2019 16:44:29 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Alexey Kuznetsov , Bjorn Helgaas , Borislav Petkov , c0d1n61at3@gmail.com, "David S. Miller" , edumazet@google.com, Greg Kroah-Hartman , Hideaki YOSHIFUJI , "H. Peter Anvin" , Ingo Molnar , Josh Triplett , keescook@chromium.org, kernel-hardening@lists.openwall.com, Lai Jiangshan , Len Brown , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Mathieu Desnoyers , neilb@suse.com, netdev@vger.kernel.org, oleg@redhat.com, "Paul E. McKenney" , Pavel Machek , peterz@infradead.org, "Rafael J. Wysocki" , Rasmus Villemoes , rcu@vger.kernel.org, Steven Rostedt , Tejun Heo , Thomas Gleixner , will@kernel.org, x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Subject: [PATCH v1 4/6] workqueue: Convert for_each_wq to use built-in list check Date: Thu, 11 Jul 2019 19:43:59 -0400 Message-Id: <20190711234401.220336-5-joel@joelfernandes.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190711234401.220336-1-joel@joelfernandes.org> References: <20190711234401.220336-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)) #ifdef CONFIG_DEBUG_OBJECTS_WORK -- 2.22.0.410.gd8fdbe21b5-goog