Message ID | 20190715143705.117908-2-joel@joelfernandes.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show
Return-Path: <linux-acpi-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E64DD6C5 for <patchwork-linux-acpi@patchwork.kernel.org>; Mon, 15 Jul 2019 14:45:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5EBF205F8 for <patchwork-linux-acpi@patchwork.kernel.org>; Mon, 15 Jul 2019 14:45:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7A3F28437; Mon, 15 Jul 2019 14:45:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0F08205F8 for <patchwork-linux-acpi@patchwork.kernel.org>; Mon, 15 Jul 2019 14:45:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730290AbfGOOpQ (ORCPT <rfc822;patchwork-linux-acpi@patchwork.kernel.org>); Mon, 15 Jul 2019 10:45:16 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46179 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404401AbfGOOhT (ORCPT <rfc822;linux-acpi@vger.kernel.org>); Mon, 15 Jul 2019 10:37:19 -0400 Received: by mail-pf1-f194.google.com with SMTP id c73so7498967pfb.13 for <linux-acpi@vger.kernel.org>; Mon, 15 Jul 2019 07:37:18 -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=peLCyvMnb6GAqXrVywa8AT70STEJ77uX6TkkVXJzQ/M=; b=QjihkdzO56EyWdL1UBrowr4J0diPIpjeawlNo5eUXRlutEI+PMdDLg/2ovhGCm9dB1 am3dJfpAJ98Tx9IokTbTDJI/QLnhNHnLoi+VI/95oP5fp/RwwQCZGPG9aCEKUlUpO/1N atHPVJ+wXVzYcfg26NNOs6IX7iznL6Gp2AAwA= 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=peLCyvMnb6GAqXrVywa8AT70STEJ77uX6TkkVXJzQ/M=; b=DpbSaqHwb3mASP0Kfi9a/Jcg0zFm3ivhOtaOM3fMIcVaA1HKoUUvnGi/wkol+Wy2bM HDokKUHlxy//1ayiZG39ZGpGOk5a66gGXqfJAqlF7vZvjl14/Osc6Ss5ugLlkHL7pJHl EJjbM1Ao4sdvbr/POzSd8bueJ5TIlGnhZO/E+TcRDxn4Jpda/3WNljIP2N61Ii7KzQ6X oQEMygAA3BsofXxewzK6dSvnnYxzNqSsKCmk2XG3HoPoraP6J2t9nLquizOTHoiTHCBA 7lI1KItzoYifEieMZATrfmUc5RdvDaDHCRUY4UuCNzj8ZbP2ZSgK7SbX3r+L2m2VovfY TwDw== X-Gm-Message-State: APjAAAW97pAm0kWkVwWhIRD7TlbFbiWJxZvNRFg1rezVgCL19EwEaTW3 iiXtrTbpHx7S1xe54zH6t6A= X-Google-Smtp-Source: APXvYqzmK9tD8rYXtIru39NtpVyI6dVamC0JOl/Vm3L4KkimM24dL0CBqeO9C1zAEuPYG8wK9FgMFA== X-Received: by 2002:a65:6281:: with SMTP id f1mr25763664pgv.400.1563201437978; Mon, 15 Jul 2019 07:37:17 -0700 (PDT) Received: from joelaf.cam.corp.google.com ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id s66sm18381852pfs.8.2019.07.15.07.37.14 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 15 Jul 2019 07:37:17 -0700 (PDT) From: "Joel Fernandes (Google)" <joel@joelfernandes.org> To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" <joel@joelfernandes.org>, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>, Bjorn Helgaas <bhelgaas@google.com>, Borislav Petkov <bp@alien8.de>, c0d1n61at3@gmail.com, "David S. Miller" <davem@davemloft.net>, edumazet@google.com, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>, "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>, Jonathan Corbet <corbet@lwn.net>, Josh Triplett <josh@joshtriplett.org>, keescook@chromium.org, kernel-hardening@lists.openwall.com, kernel-team@android.com, Lai Jiangshan <jiangshanlai@gmail.com>, Len Brown <lenb@kernel.org>, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, neilb@suse.com, netdev@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>, "Paul E. McKenney" <paulmck@linux.ibm.com>, Pavel Machek <pavel@ucw.cz>, peterz@infradead.org, "Rafael J. Wysocki" <rjw@rjwysocki.net>, Rasmus Villemoes <rasmus.villemoes@prevas.dk>, rcu@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>, Tejun Heo <tj@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, will@kernel.org, x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Subject: [PATCH 1/9] rcu/update: Remove useless check for debug_locks (v1) Date: Mon, 15 Jul 2019 10:36:57 -0400 Message-Id: <20190715143705.117908-2-joel@joelfernandes.org> X-Mailer: git-send-email 2.22.0.510.g264f2c817a-goog In-Reply-To: <20190715143705.117908-1-joel@joelfernandes.org> References: <20190715143705.117908-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: <linux-acpi.vger.kernel.org> X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Harden list_for_each_entry_rcu() and family
|
expand
|
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 61df2bf08563..9dd5aeef6e70 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -93,17 +93,13 @@ module_param(rcu_normal_after_boot, int, 0); */ int rcu_read_lock_sched_held(void) { - int lockdep_opinion = 0; - if (!debug_lockdep_rcu_enabled()) return 1; if (!rcu_is_watching()) return 0; if (!rcu_lockdep_current_cpu_online()) return 0; - if (debug_locks) - lockdep_opinion = lock_is_held(&rcu_sched_lock_map); - return lockdep_opinion || !preemptible(); + return lock_is_held(&rcu_sched_lock_map) || !preemptible(); } EXPORT_SYMBOL(rcu_read_lock_sched_held); #endif
In rcu_read_lock_sched_held(), debug_locks can never be true at the point we check it because we already check debug_locks in debug_lockdep_rcu_enabled() in the beginning. Remove the check. Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> --- kernel/rcu/update.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)