Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4143483ybi; Mon, 3 Jun 2019 06:24:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyG2eoTzoX6mlxLakauwc/w6QtIc7oej44UN64p6fAqDQm/I0Z6MYTHAEHGtOHbEjVVKEk X-Received: by 2002:a63:f513:: with SMTP id w19mr24366679pgh.367.1559568298031; Mon, 03 Jun 2019 06:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559568298; cv=none; d=google.com; s=arc-20160816; b=VCSfnoIPeH+25Q0nmFQvidaa7ncovi0VJUQZmw4jXCDoepu+7FUME/k/OxGjHtqLkl TcJ/FpDVrkc//A1Etc3CK4Y+nU+9pneG8nZKdY0hcZ52treYKFwd6kz33fYHsB8jfZMy As1RaNvKKmW7fvWuaZgC3ttSxd47BINcaPjG9H1387R8xj3w9bN940XZV/18v2ufUiH5 RrG0cZxZT9g3SoPIbULlitpTOMdQnveL4DzfoGt2IpPWJ2wnMSyf1VmTuo+eKNDuCuHm eEhYkNyKZZyGv5Av3ARsjLJVsdyPMC5uwj6gS4az1vu8L4r7Y1M3CBWZx8SsVO4BSSFr JIiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=kRbNr96VS09F+taGClxc324ZFJY2xCgOU3S9yZzfQ5Q=; b=0PUI8Ti20Iwx68EJv5q5zWagXueNYkdvDUcUqDZLPqhWdswEaHDnYV1xosKrGTKrTN LCzqQjK94NczophdUutTwj2yfPHJ0ckt+UXi6dum/fqxz3FhFBTeqwObDsuGpabdH+dw uGOCxPgEq0UGwsn43FjTSCDchVQaQYsdEa6xmkpkYUKFWARjUPqTSs7hE3ciUt+HBDmL T3pNMSNDCaeN4BDgYiVQ6AMAcNQu5p9IS/mkssxhBhKPUfAzYMGNl86CVoWS0kKX9CQM QZ1A32+IInWAvwXqxrJoByqvF8G39hAZFgqmRTrhlCzECGx7ZmCgG9iAFtMTzk+pjkyS 4Wvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=YqTwea3A; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h34si20039899pld.187.2019.06.03.06.24.40; Mon, 03 Jun 2019 06:24:58 -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=@zytor.com header.s=2019051801 header.b=YqTwea3A; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728653AbfFCNWf (ORCPT + 99 others); Mon, 3 Jun 2019 09:22:35 -0400 Received: from terminus.zytor.com ([198.137.202.136]:45315 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727403AbfFCNWe (ORCPT ); Mon, 3 Jun 2019 09:22:34 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x53DMOgF607192 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 3 Jun 2019 06:22:24 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x53DMOgF607192 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1559568145; bh=kRbNr96VS09F+taGClxc324ZFJY2xCgOU3S9yZzfQ5Q=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=YqTwea3Ag2jAOIEsyHt4SB7VmCTggJALo9PBuoc2Dw57KHRSu7rCyBrqL23lwfG5N 4ZRsUfQXSJQgXoIxbLi3UR65JGLaVNsBMAR2uDYJxIdY2sQ+Z+Ec/J9cR3Cv0s9UVq 15GcnEZnFJPrgglKA8vtZWZ3eFJ0ER4gtMfOQUG2b2DoLyLZC5ypYbwaKg1RRhth6O xNfjBOCP/I5LnTXYfLDdFc4Cpp3L4tuAym6U505L5HZrKQ29eMAHGKsiJ2ZPx3+NQx nxCerfP+fA0atuaZRvd/A/6Ih3yBt3rgojNKQ7gAjpMx7532/dyO7hGGulkYA/MxQ3 I2lyX3d2JWnBg== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x53DMOQI607189; Mon, 3 Jun 2019 06:22:24 -0700 Date: Mon, 3 Jun 2019 06:22:24 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Yuyang Du Message-ID: Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, duyuyang@gmail.com, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, torvalds@linux-foundation.org Reply-To: linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, hpa@zytor.com, duyuyang@gmail.com, torvalds@linux-foundation.org, tglx@linutronix.de In-Reply-To: <20190506081939.74287-24-duyuyang@gmail.com> References: <20190506081939.74287-24-duyuyang@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/lockdep: Remove !dir in lock irq usage check Git-Commit-ID: bf998b98f5bce4ebc97b3980016f54fabb7a4958 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, FREEMAIL_FORGED_REPLYTO autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: bf998b98f5bce4ebc97b3980016f54fabb7a4958 Gitweb: https://git.kernel.org/tip/bf998b98f5bce4ebc97b3980016f54fabb7a4958 Author: Yuyang Du AuthorDate: Mon, 6 May 2019 16:19:39 +0800 Committer: Ingo Molnar CommitDate: Mon, 3 Jun 2019 11:55:53 +0200 locking/lockdep: Remove !dir in lock irq usage check In mark_lock_irq(), the following checks are performed: ---------------------------------- | -> | unsafe | read unsafe | |----------------------------------| | safe | F B | F* B* | |----------------------------------| | read safe | F? B* | - | ---------------------------------- Where: F: check_usage_forwards B: check_usage_backwards *: check enabled by STRICT_READ_CHECKS ?: check enabled by the !dir condition From checking point of view, the special F? case does not make sense, whereas it perhaps is made for peroformance concern. As later patch will address this issue, remove this exception, which makes the checks consistent later. With STRICT_READ_CHECKS = 1 which is default, there is no functional change. Signed-off-by: Yuyang Du Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: bvanassche@acm.org Cc: frederic@kernel.org Cc: ming.lei@redhat.com Cc: will.deacon@arm.com Link: https://lkml.kernel.org/r/20190506081939.74287-24-duyuyang@gmail.com Signed-off-by: Ingo Molnar --- kernel/locking/lockdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 9c4e2a7547d3..2168e94715b9 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -3235,7 +3235,7 @@ mark_lock_irq(struct task_struct *curr, struct held_lock *this, * Validate that the lock dependencies don't have conflicting usage * states. */ - if ((!read || !dir || STRICT_READ_CHECKS) && + if ((!read || STRICT_READ_CHECKS) && !usage(curr, this, excl_bit, state_name(new_bit & ~LOCK_USAGE_READ_MASK))) return 0;