Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp254843pxa; Thu, 27 Aug 2020 01:02:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrk8azWO7xOpmTuYKAorgZrfFT0LiHiBIT0kQlB3FdVpd0Fw0ts9y3D/f+OCE3uNC4XyOo X-Received: by 2002:a17:906:b286:: with SMTP id q6mr18556993ejz.99.1598515328553; Thu, 27 Aug 2020 01:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598515328; cv=none; d=google.com; s=arc-20160816; b=NE6Te1nFwAbWlEVcEMQXqDL2FuAv/umThO5L9zZu2mRR83iE1xQSrYRx5BUrJfsHPk d074rc65O9G0N058YzDmslf/pbgA8ga8h8tdprhJoq2jVnuFGy+ZiMduLR1klNMXEFgz D8deYQz0DVeiAtdyl7WEdeh31fEAMdHNxSo9ZGgKzH6no94/r9i0ypyFzE/IXgAnGloI fkigVo9vmXF+ppre4kZLCSGSt74AKX3Y2aA0QthRBkFcOh30Yq8SmM9N/jfjET6n5228 CIkgnKIIqmrzwYYIoxZSruv+/EZkIuYLcKfiLeO9sNU3yyLYaT33n20zwd3hdHrD1Ijp QU8w== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:dkim-signature :dkim-signature:date; bh=89A6wazOLLjRmL9Mtpna+rpwili8jzcw6nYOIbvJbQk=; b=c+388VYyk2+v3u52PFhevxNTwNHE33Yax56rtfy6KwQYqn7hWtttsw5QzrVcNqoqI8 L1L49NUUT3trunsmIhtAcmp8C5Z5wMC2JSqiLtRicbgo2387rcMzGI0NXz6t8E9LjhQM +v9d15rrOiTkzqzNScLKxbVsdnJD37cqtuPsxDxNuPoFuc+rofJ83pbxYkMFlMXjtu+3 8U2HKMel0RTjTZ7xSfjamszu5AeLOuHVVkCSypjSJDTmMmZnSeQiHIU9iHoi8QgdF9Ce 5zHpLlGESNtTIkFnINuti4m30EtEECJysgWzPSOTKSo2yp2r/tZ/q48pRU2K6k5ie+cR yuMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=H5qILwpx; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=byC6v0vV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si793324ejo.565.2020.08.27.01.01.46; Thu, 27 Aug 2020 01:02:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=H5qILwpx; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=byC6v0vV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728662AbgH0IAD (ORCPT + 99 others); Thu, 27 Aug 2020 04:00:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728370AbgH0HyU (ORCPT ); Thu, 27 Aug 2020 03:54:20 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49D04C06121B; Thu, 27 Aug 2020 00:54:20 -0700 (PDT) Date: Thu, 27 Aug 2020 07:54:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1598514858; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=89A6wazOLLjRmL9Mtpna+rpwili8jzcw6nYOIbvJbQk=; b=H5qILwpxdP9O74cWJm66r6HpDUvOqsBhlA89wHceXqybE0IeqGBCprdxs0nq2mwvbwtjLj dVVrisgXUEA7SNXi9W8h/mZM590ANkuulS/kFecVp0xyp4d8cPOy5KsAyq27xAoyoe2btb 1mKE//d0aCqZQAykL9UmAyf64+zcEr1fUi08t9Tt4wlbKqlEEgHFg8aUSF3cIApUSOqeuf paNphScAWxFRkn3PFgIL/lRg2ZxtwsspOzB2z4wruJr2SajcA6UdRIxdVBxbC0I4EuRHwq xZ+l8P5EaTVFreTDxJ9BW13CwQkoVkqhQq6U3JcxJ1F4agLi7jlP1v9q5EDahw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1598514858; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=89A6wazOLLjRmL9Mtpna+rpwili8jzcw6nYOIbvJbQk=; b=byC6v0vV0KLERfzy1ZvTxcfJ2ouXYhdfwhxu2iaxqK5dQ1hZsKBMig6fSKDvo4sIZol87/ oHHJjmusIwIXJrCg== From: "tip-bot2 for Boqun Feng" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] lockdep: Add recursive read locks into dependency graph Cc: Boqun Feng , "Peter Zijlstra (Intel)" , x86 , LKML In-Reply-To: <20200807074238.1632519-13-boqun.feng@gmail.com> References: <20200807074238.1632519-13-boqun.feng@gmail.com> MIME-Version: 1.0 Message-ID: <159851485754.20229.2400121022268138722.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/core branch of tip: Commit-ID: 621c9dac0eea7607cb9a57cc9ba47fbcd4e644c9 Gitweb: https://git.kernel.org/tip/621c9dac0eea7607cb9a57cc9ba47fbcd4e644c9 Author: Boqun Feng AuthorDate: Fri, 07 Aug 2020 15:42:31 +08:00 Committer: Peter Zijlstra CommitterDate: Wed, 26 Aug 2020 12:42:06 +02:00 lockdep: Add recursive read locks into dependency graph Since we have all the fundamental to handle recursive read locks, we now add them into the dependency graph. Signed-off-by: Boqun Feng Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200807074238.1632519-13-boqun.feng@gmail.com --- kernel/locking/lockdep.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 6644974..b87766e 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2809,16 +2809,6 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev, return 0; /* - * For recursive read-locks we do all the dependency checks, - * but we dont store read-triggered dependencies (only - * write-triggered dependencies). This ensures that only the - * write-side dependencies matter, and that if for example a - * write-lock never takes any other locks, then the reads are - * equivalent to a NOP. - */ - if (next->read == 2 || prev->read == 2) - return 1; - /* * Is the -> dependency already present? * * (this may occur even though this is a new chain: consider @@ -2935,13 +2925,8 @@ check_prevs_add(struct task_struct *curr, struct held_lock *next) u16 distance = curr->lockdep_depth - depth + 1; hlock = curr->held_locks + depth - 1; - /* - * Only non-recursive-read entries get new dependencies - * added: - */ - if (hlock->read != 2 && hlock->check) { - int ret = check_prev_add(curr, hlock, next, distance, - &trace); + if (hlock->check) { + int ret = check_prev_add(curr, hlock, next, distance, &trace); if (!ret) return 0;