Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp342951rdb; Mon, 22 Jan 2024 06:06:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IErzujeaq8klV9pxM4GJA4b5f6iNsnfUISRUpLc9jr7q23Z8MD8wgHEg+IiXh9cuWhBgHO7 X-Received: by 2002:a05:6870:f682:b0:210:9efe:d1a9 with SMTP id el2-20020a056870f68200b002109efed1a9mr1920858oab.79.1705932411280; Mon, 22 Jan 2024 06:06:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705932411; cv=pass; d=google.com; s=arc-20160816; b=QMiX2r2Zu95SlSgdugGmVQ0iK5DFBd3+dnI7VXfRB1g8agItHuXi8hpHYcJHCeUtDD rB828NeuFSSj4zlKnryhO3V7bNgT+PGgarS96LCA0+zNpudPSJYm/RlADGgXcMAXRNtK aYsNf6Mu/x3xVpD2y3zjtAQG0G+p5FiRBhUPuB/9ELQP/4ujlqL9FwCCyHl8rDdg0s7U vU/Q6o3H7FQBGAZX2a8L9TWxAzL+vXSKmAaHayUyQVQpONNDIwh+k/AARmeTwbr4hixB r42ps3+2y60n4WtGD7jQdFp7jhg3zi4YwfPsroefXNUHw6hFPQGz7Ktp9K0N2R49Cjb1 1qMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LvGoX9VOfmX4dn+RR4IR/9t7Alhj00s+830PV0mY3JA=; fh=M4BPaMQ5Q3X2+FKbhXoDpy+/1kcj8JGJnMEJ6o+yvT4=; b=04g/0EinZsPUTy1qBVsRUslLqce/Tany4zJyQYayFzkUB2vacZ2TnkukW5sd323/5e df0xOOSrwgpFIL7M/2b5RgGpLlh/j6gq7GKjegyzFyQoDclYUDKp5QHjar99FmmKfvK1 3JqDeeMMTLkrRqcsIbLwd9hZwk0C9JP/nt1fPKibArdDeb0oQs2UDEVQ6h/2PtMnWyg+ E0qhg/M1bQoYipmclHLy7qlMUgAe+HflntUGO88qDgqB96yNt/AciIN1Q+eAoG0ZbTp4 YaEpuDkx//XKZxwpXv5yx+W+5BOTDWp1gfIYw7K0GMwxZGvrVIIOkUcdKLe/EutlUyB/ igjg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gGSmUmXA; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-33129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id kz14-20020a056871408e00b002147a180b52si75782oab.268.2024.01.22.06.06.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 06:06:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gGSmUmXA; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-33129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7AC0C28B0C2 for ; Mon, 22 Jan 2024 14:05:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 677DF3DBA6; Mon, 22 Jan 2024 14:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gGSmUmXA" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A9D03E497; Mon, 22 Jan 2024 14:02:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705932156; cv=none; b=tihOtzA7jL0jlZ5Z8cASzra+8GXS+OWL95r2z9XoprCkqdv6Ib94kVx48DiIM64AhdwU087PO6TtfwHLSHO9ZfbztowVSSbhzbKH5CjE0fg+DoS6trySIf50p5VkjhUIXPHbHMUPeX6wl9KpBlaEf3D8rq5XhCtyaUGl7eOyqPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705932156; c=relaxed/simple; bh=KBth+bbeg4R5PqQLpaKBQ2olW6SygwHEo2iHu/7IdXk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rtZmThhYJ4cmIYv0s6kbPusM6OYOY/uHqMPYW8V0ngfBSIQ8a0OquImpgNBuRltNSdYYxPRbxTAfuQqdwtfTfegVuXNsS2gWEl1sZtNC7/6PaEf8bZrPTI2A8MLuI7lqjnzMQakzgi7cLIUjj7AZXkzgtZhSisrnMHwbpLPNMQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gGSmUmXA; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6dbd56b5357so690291b3a.1; Mon, 22 Jan 2024 06:02:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705932155; x=1706536955; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LvGoX9VOfmX4dn+RR4IR/9t7Alhj00s+830PV0mY3JA=; b=gGSmUmXAoa8zatoROYPYnHhGAMal2iYkflAdm9RTiR4+61X+MvPm60RsR5sDlK9o7w PhsLdbX3x+kRz0ewqT0Gbws5bOJz/fukGFxZ398Go4RcIjc0OMKEsjXgU/sEbk+FgFuZ qsB125ok6eMl3wH/JkSqS5upKXJvIuiwQFNa0P4zYMaLA/UTYdPq4BF+ezy6BNdKYWuT IDM9DcVEhBj8VI7SVS99ZmvHjmY9LirmMM8PvBHhFIT6ZfWx9ZG9mkqkVz7Us9ZZP4wB c8Ugl+axk4snGSZVLPfpHtuuu/tnlQVlHEkLNnSp91CI5mcbsWz8+74qG18vq+BaxT4C 8UUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705932155; x=1706536955; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LvGoX9VOfmX4dn+RR4IR/9t7Alhj00s+830PV0mY3JA=; b=uIuDtUhmbQNSFu49P6+sGLnWAnHefiFiHrjV0qiAuohDRsjtSuExGXZmTWraMS4EXi YGODhM23ouY25S0XJG1XN/0wcDL9W+QKULBwdPdkDPF11FaSAlGUirq6Z1qhBU2V6uDW GFBoaKuXjwHVhw2uimUxEYHa6sZra8dGiGsbB3hdYaIDCtw21JiuzlVJaq4CFjLGbPHy fRUtVkh7fcYqXdKoa8ta6QjIwGRHgxjW+6IgmGOrRDxp/1IivISuVWH0bZzLiQlLOboK 6rBtxkh1iCVqrTnEuopzO/AZ2wyGqW/c6OblxPgztOq4NL7AXw0PM/MrTU9Ue6ZfqT2g iOWQ== X-Gm-Message-State: AOJu0Yw5jbkbWkY4i6ghPojvJX/+06xANM6Q0Q5o0QdmhRprLGI0oCRR NDMj8WF9R1d3v9OHCAoyc8KQb/aabbgoJgeleRbs30crjM+GOvwC X-Received: by 2002:a05:6a20:d48d:b0:19b:e6c5:2c97 with SMTP id im13-20020a056a20d48d00b0019be6c52c97mr1748589pzb.4.1705932153027; Mon, 22 Jan 2024 06:02:33 -0800 (PST) Received: from carrot.. (i223-218-154-72.s42.a014.ap.plala.or.jp. [223.218.154.72]) by smtp.gmail.com with ESMTPSA id n14-20020a62e50e000000b006da2aad58adsm9901913pff.176.2024.01.22.06.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 06:02:31 -0800 (PST) From: Ryusuke Konishi To: Andrew Morton Cc: linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/15] nilfs2: do not acquire rwsem in nilfs_bmap_write() Date: Mon, 22 Jan 2024 23:01:56 +0900 Message-Id: <20240122140202.6950-10-konishi.ryusuke@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240122140202.6950-1-konishi.ryusuke@gmail.com> References: <20240122140202.6950-1-konishi.ryusuke@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit It is now clear that nilfs_bmap_write() is only used to finalize logs written to disk. Concurrent bmap modification operations are not performed on bmaps in this context. Additionally, this function does not modify data used in read-only operations such as bmap lookups. Therefore, there is no need to acquire bmap->b_sem in nilfs_bmap_write(), so delete it. Signed-off-by: Ryusuke Konishi --- fs/nilfs2/bmap.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c index 7a8f166f2c8d..383f0afa2cea 100644 --- a/fs/nilfs2/bmap.c +++ b/fs/nilfs2/bmap.c @@ -548,13 +548,10 @@ int nilfs_bmap_read(struct nilfs_bmap *bmap, struct nilfs_inode *raw_inode) */ void nilfs_bmap_write(struct nilfs_bmap *bmap, struct nilfs_inode *raw_inode) { - down_write(&bmap->b_sem); memcpy(raw_inode->i_bmap, bmap->b_u.u_data, NILFS_INODE_BMAP_SIZE * sizeof(__le64)); if (bmap->b_inode->i_ino == NILFS_DAT_INO) bmap->b_last_allocated_ptr = NILFS_BMAP_NEW_PTR_INIT; - - up_write(&bmap->b_sem); } void nilfs_bmap_init_gc(struct nilfs_bmap *bmap) -- 2.34.1