From patchwork Mon Jul 15 14:36:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 11044351 Return-Path: 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 027B31395 for ; Mon, 15 Jul 2019 14:37:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E72AA205F8 for ; Mon, 15 Jul 2019 14:37:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9E05205FD; Mon, 15 Jul 2019 14:37:36 +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=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 1A309205F8 for ; Mon, 15 Jul 2019 14:37:35 +0000 (UTC) Received: (qmail 26348 invoked by uid 550); 15 Jul 2019 14:37:30 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 26287 invoked from network); 15 Jul 2019 14:37:29 -0000 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=tiXWOdHU0apCsBASXifQSiBL8P9FM6jsl8jU9Q80Z1VOjQzPA0xchG/yCFRiXjVW+2 gmiARK2Mj0OUIVrbyr+2BIArZjrzbXPVqqhGfg6MCnCvMrHiVfXfQiPmrd/YpAZU1ryN gYDK2EOSsnb1NF3XY4YVr57nktE1uK+L2T+PPKgSBlkve9qnyjsbgDld7ayM1z10HAFw izdEakX9i9hNvwr0oO1LdN/QGODQYZuY1EmQzyyvTFNsy1pT0WX2hpLNsM4bZSB9K7Bp SqA0rSGkZcRBe3lMZcKx7g0mZeNfrIorcgJj0qQQLWooAeXrAFCEeGZ+WNYqSvN6/uSS MSzg== X-Gm-Message-State: APjAAAWodHWd6G5rOD9RgMOlGwuBk3ZfJt4EFyouaeNAhsMNemxrJ0Yy 5UL/40YUK1pr/qw+mTp0yy4= 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) 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 , Jonathan Corbet , Josh Triplett , keescook@chromium.org, kernel-hardening@lists.openwall.com, kernel-team@android.com, Lai Jiangshan , Len Brown , linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Mathieu Desnoyers , neilb@suse.com, netdev@vger.kernel.org, Oleg Nesterov , "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 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 X-Virus-Scanned: ClamAV using ClamSMTP 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) --- kernel/rcu/update.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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