Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp391383lqo; Wed, 8 May 2024 03:04:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5OxpYJZJEvIO+jQI+Tl5jCyKFuI5iAfjoMo0ioKjYbydhKaXkZ5581aIMvsbmMk+DiePkEwS9WMfcdWxNuAjlIR+7C+HeeTD3JHC/Yg== X-Google-Smtp-Source: AGHT+IEKxQbhQKMZj1RoBWK0yhpNOZ7lWsRLPGODr1IVCfF6WivAK3u4oDZVu/FFL/QPWUsR0cRF X-Received: by 2002:a05:620a:2455:b0:792:9248:c2e9 with SMTP id af79cd13be357-792b2745cf4mr316197385a.48.1715162644883; Wed, 08 May 2024 03:04:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715162644; cv=pass; d=google.com; s=arc-20160816; b=EvAITQn7bRoD+bBMI/w+kv/AzJjKxbxc/8bBXIyFI0Y4wHH4qtsblo/B/RC49obcu3 MWIzGIEcq27cwiW2Ys0OHWh+6WkQihefjSCvYEh59qpSbU02smdjOMwZjztbIyWK0jEN 57J8t9tCWAQpW6gTn7vzPLyXavrjCSarsT4L4ZCFgRusBe622WVLMmq0x+b6I3Lk1aYu w6f3jB5YpBh8YeZcYlnlzMBkMPByb1RSPb4Jcqt0re0pnBLDAb56TAlMnXQuf9Gjy3nN FEABgTO7pgWfGKbYLBKqXqTqRCM+Qy1ay/sbVTBQuHMi4m9BJ7HgcYSMF3AjfUggnC4t l5JA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from; bh=4XZzKToEpZB7iW58z9X5ctRYBZOSG23vKvPRTOUCwzU=; fh=H2KRUF8uSM4+6+w6W9vKW2QB11XTfop4gd9hLuyjokE=; b=yb61mqEiHBrDb2l5fITV6pWOuBmClq8ZLEzcblCZqzmktBzz3Gc9Fc+AHpQtHNym+7 KzTl3jBE+pvXPJpIXM4TmSTZYysp57tDg0KEb5iUcKEFNGCJjlE6VQtV3jHpp4qavcI8 jLWopYfpoSS+HVK2qXQvXTpCgKv3qFQemLPV2cQaNJt54Q7dDFxWsdyQxx79DJtrAUv1 Ee9gHqpI6rjX/CcMiiDB5VjEuUFfOiPLm4NIIiBUbU7WWNrOCAYYB1BLwM8duenLwaFf rTXVAfmVPcAqwa1AVkvQQJVncWIy54UBskMKXJPhBY5lbp0sMOOEHz4TbnptM6RWOgEZ zdIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-173011-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173011-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 20-20020a05620a04d400b00792ad6ef4c0si2425881qks.686.2024.05.08.03.04.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 03:04:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173011-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-173011-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173011-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 964401C2169D for ; Wed, 8 May 2024 10:04:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7E107FBC1; Wed, 8 May 2024 10:03:03 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7041F7E799 for ; Wed, 8 May 2024 10:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715162581; cv=none; b=dDtjAEU/Hy6UOp6tXO6x7rfnHYd3+3Yxryj7YjY/vsqkzjIJE7+idb+uhHlfhy5wP0YaKzL5Ony5kBcP2qwADxofznQk+b26OTRns8uQScp0AE5Hm1AaJwtnSRYue/enTpPD70yVM1ADDnzhIRGh7hmDnF6cpTklBtOzDg6E6MA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715162581; c=relaxed/simple; bh=V7OCY3lZb4xqdegTjDnSiOVOV4Z/UMmQylfaiUY4QDE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=Up2pKi/igcx25NWXrnW8GcxQmLN++QQkJOer8C6pTptV4gXralO9WxkUYY/SaW2goEOMI+Qb7huj34RsWuKXpO4Ty3mcbY5cnYS+jczaq+QvRN2N2WP+M3Xr2dkCzzXwGXAltsc/IFo/Y9hbyHaVsEKdE6L6dfVxWrPB6KHWkxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-d85ff70000001748-b9-663b4a3b016a From: Byungchul Park To: linux-kernel@vger.kernel.org Cc: kernel_team@skhynix.com, torvalds@linux-foundation.org, damien.lemoal@opensource.wdc.com, linux-ide@vger.kernel.org, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, will@kernel.org, tglx@linutronix.de, rostedt@goodmis.org, joel@joelfernandes.org, sashal@kernel.org, daniel.vetter@ffwll.ch, duyuyang@gmail.com, johannes.berg@intel.com, tj@kernel.org, tytso@mit.edu, willy@infradead.org, david@fromorbit.com, amir73il@gmail.com, gregkh@linuxfoundation.org, kernel-team@lge.com, linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@kernel.org, minchan@kernel.org, hannes@cmpxchg.org, vdavydov.dev@gmail.com, sj@kernel.org, jglisse@redhat.com, dennis@kernel.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, vbabka@suse.cz, ngupta@vflare.org, linux-block@vger.kernel.org, josef@toxicpanda.com, linux-fsdevel@vger.kernel.org, jack@suse.cz, jlayton@kernel.org, dan.j.williams@intel.com, hch@infradead.org, djwong@kernel.org, dri-devel@lists.freedesktop.org, rodrigosiqueiramelo@gmail.com, melissa.srw@gmail.com, hamohammed.sa@gmail.com, 42.hyeyoo@gmail.com, chris.p.wilson@intel.com, gwan-gyeong.mun@intel.com, max.byungchul.park@gmail.com, boqun.feng@gmail.com, longman@redhat.com, hdanton@sina.com, her0gyugyu@gmail.com Subject: [PATCH v14 26/28] fs/jbd2: Use a weaker annotation in journal handling Date: Wed, 8 May 2024 18:47:23 +0900 Message-Id: <20240508094726.35754-27-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240508094726.35754-1-byungchul@sk.com> References: <20240508094726.35754-1-byungchul@sk.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSfUxTZxSHfd97e+9tpeamknnHnJIaNcHAxMB2nEaNRn1jQjQxMUaN2sit 1EHFVlCMMyAVtXwEMYhAxYJYCCBoa/ymVkgZHwpViQMGRJgR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@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: jbd2 journal handling code doesn't want jbd2_might_wait_for_commit() to be placed between start_this_handle() and stop_this_handle(). So it marks the region with rwsem_acquire_read() and rwsem_release(). However, the annotation is too strong for that purpose. We don't have to use more than try lock annotation for that. rwsem_acquire_read() implies: 1. might be a waiter on contention of the lock. 2. enter to the critical section of the lock. All we need in here is to act 2, not 1. So trylock version of annotation is sufficient for that purpose. Now that dept partially relies on lockdep annotaions, dept interpets rwsem_acquire_read() as a potential wait and might report a deadlock by the wait. So replaced it with trylock version of annotation. Signed-off-by: Byungchul Park --- fs/jbd2/transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index cb0b8d6fc0c6..58261621da27 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c @@ -460,7 +460,7 @@ static int start_this_handle(journal_t *journal, handle_t *handle, read_unlock(&journal->j_state_lock); current->journal_info = handle; - rwsem_acquire_read(&journal->j_trans_commit_map, 0, 0, _THIS_IP_); + rwsem_acquire_read(&journal->j_trans_commit_map, 0, 1, _THIS_IP_); jbd2_journal_free_transaction(new_transaction); /* * Ensure that no allocations done while the transaction is open are -- 2.17.1