Received: by 10.223.185.116 with SMTP id b49csp1595535wrg; Wed, 21 Feb 2018 23:10:12 -0800 (PST) X-Google-Smtp-Source: AH8x2246Kwv7oyUI0hWu+0wy/OEY8vrLlc/8L3DoI6S3TnJHAm0iYYnc0Anx7oUi9vqffZ5L5DXi X-Received: by 10.167.130.133 with SMTP id s5mr5860296pfm.238.1519283412516; Wed, 21 Feb 2018 23:10:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519283412; cv=none; d=google.com; s=arc-20160816; b=nxmrnKABJo00qHIeOau1pz6un0X1bG3zWsce+EAFROJALlZhL00nFupbgRl8Nx3gKl 0xWDS54olfwJDYYXdSOg/EFPTWThu0wnCzC8nG2gKPOGcStaYpVfjERfxjIEM8a0ohYX DPNBZ7ezpvFc76anyTeGR9zifH6Lz8Bs7KvZAlmJ9g6wzxaXGoPeMyRA3C2afEmoYKcs TC4P5L22m1Y+V9sG0Zm6l7bM2v8d3uMBx1FVDLpr/YAWg1hvy5OMr2lUEfiqHf3kBaDV W2393Cx8kSlVl431G2/kbAZaGhUIkw9uGZgfeGecE8AV+6t7TcppPD6cIKivnQ7JRDXh 23jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=aiCJcZZqCCWCY85chUIhuD4MgokSbQfvenbnBRRBFdo=; b=loscEiUT5SBM/vLAyJzJaALgRYsSxk9SnTDOYZukxVBab7b9JsMOwNiJJDO48cqGEX H61mohwmOkEhr++PnXTJtVaORjFUcgNofy7lfV/xE185ry/7LeGQCRr0sMdHJI6FatQD 9+i6vZJrADDMgps5cC+4lPkXSw5glQPKByONY7b/POVZSQZ9ToGIfqdo0ZtoOfhg7GpS RLlksf6dypbcvkbnjWdiqo1ZCLkzLMNYY0XGmJr+GT/teLie6ZYKQLRzjrazFuJ/4wJJ UAx9yOXQkI5V8Usi2eyhv37PlMKC8yVANLEC5USVPsCnL1o7N3VqLWdweZVDKE9RlAKB V2bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QsvWyKFR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 38-v6si2539995pln.397.2018.02.21.23.09.58; Wed, 21 Feb 2018 23:10:12 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=QsvWyKFR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752707AbeBVHGa (ORCPT + 99 others); Thu, 22 Feb 2018 02:06:30 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:56043 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752478AbeBVHG1 (ORCPT ); Thu, 22 Feb 2018 02:06:27 -0500 Received: by mail-wm0-f67.google.com with SMTP id q83so1836254wme.5 for ; Wed, 21 Feb 2018 23:06:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aiCJcZZqCCWCY85chUIhuD4MgokSbQfvenbnBRRBFdo=; b=QsvWyKFRvUVyZD5ltE9PWcRztdTIpSgCPzrfX1sHeRtawZK2vasWWRrS99v3Z+QZtk /Mwzdb4Y+X9ulNZWR4ge/lxb5rdR55fxJ1ifbgqCj8OvhBdYn3h7CyolSkdkE2YlxIcq 6Hh8+rw3D99EHMz1qcfJPqr155aonDPPPjRDWAHrmrzT/hfW+hOsOMLJAvLZ029HeBGM Jvbrc/aMe/c0LHSeNFobojZJjx48e68H3dPk34tCAq8yu0BsV/zIM0L2bw4EUMZVV6V3 Mhu6pZpoVvfd1U1+XGEDQhwl6BBfT6O9CA3kTKN+XQ+Kqe7qsIpY/zxCaPTeaLywl0vH Sucg== 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; bh=aiCJcZZqCCWCY85chUIhuD4MgokSbQfvenbnBRRBFdo=; b=BauMo9NJ30Vcgnb652F7M90J2AQV13BIh1A+7LzUd0RDv9egHJONiWK7u7DSL1qfhr bkUfFo/82THjBR6ImAkveB/j78qE7xbUE733ZGjflobpyXumaBtUjkwuAzmiVe2z8/Zy UsY375F7zPq5lQn2jhGQvQMeuN/4UOOi2ThAwmAu+uiOChjEheUnqHqV90PoCFWXfMMZ Oabcivo3sgm2NcvM21Tqdv8sXgaSKN48C/bPdYkROU+TKXmTxdewypeMTAyg6hn5ogzf 47sW1D6RlzTpiFbYQm1j74MShCZjMSndmL7vzJ2cNv6sCaA1Dot1tLBsvr4p3nQi9NzK oOMg== X-Gm-Message-State: APf1xPCB7FEOva1N46AMztDvfZmc25CawvoyCVzv6b9A1sdvdWu6MQjo cbNS4IZiK3TKNNOc5qGOKVI= X-Received: by 10.80.173.174 with SMTP id a43mr8205729edd.295.1519283186585; Wed, 21 Feb 2018 23:06:26 -0800 (PST) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id c5sm25046613ede.30.2018.02.21.23.06.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 23:06:25 -0800 (PST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 8144220505; Thu, 22 Feb 2018 02:06:24 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Thu, 22 Feb 2018 02:06:24 -0500 X-ME-Sender: Received: from localhost (unknown [45.32.128.109]) by mail.messagingengine.com (Postfix) with ESMTPA id EA7157E0ED; Thu, 22 Feb 2018 02:06:23 -0500 (EST) From: Boqun Feng To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Ingo Molnar , Andrea Parri , Boqun Feng Subject: [RFC tip/locking/lockdep v5 09/17] lockdep: Add recursive read locks into dependency graph Date: Thu, 22 Feb 2018 15:08:56 +0800 Message-Id: <20180222070904.548-10-boqun.feng@gmail.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180222070904.548-1-boqun.feng@gmail.com> References: <20180222070904.548-1-boqun.feng@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since we have all the fundamental to handle recursive read locks, we now add them into the dependency graph. Signed-off-by: Boqun Feng --- kernel/locking/lockdep.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index bd3eef664f9d..254f90bade54 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2038,16 +2038,6 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev, if (!check_prev_add_irq(curr, prev, next)) 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? * @@ -2151,11 +2141,7 @@ check_prevs_add(struct task_struct *curr, struct held_lock *next) int 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) { + if (hlock->check) { int ret = check_prev_add(curr, hlock, next, distance, &trace, save_trace); if (!ret) return 0; -- 2.16.1