Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2353725rdb; Mon, 5 Feb 2024 04:11:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPwDd8c0wtaIpcLnjUxe6BbQlKieGGcR2sIUh1ZuquTCT7UeK1olcl6g0iOxbi0YtZkhJt X-Received: by 2002:a17:90a:528a:b0:295:d223:ad11 with SMTP id w10-20020a17090a528a00b00295d223ad11mr12975923pjh.36.1707135076499; Mon, 05 Feb 2024 04:11:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707135076; cv=pass; d=google.com; s=arc-20160816; b=drS39CiLTgQaJbGfl8gxE5gE5Ig64UV8AH6LYsJYOQr7qPCZ8970Gss2M1LPwOJmWz KZxqcAUt/3IsV+CVrhLA43tXk85qEP7Zle7YuqCEFL+Me/VadbW+WRpv0CE0nEAh2l81 pXWefg30LgQEy3rBa3jIIu8g+vt5LdKPKJBJ3JJpr7N9KGvsF9e30gp4R/SSwpV6evRu lmDA2M/PXEIC+932zzbAwSW99pqPnoq/sZ4bIg8gGOQtnDwbBXZXtpmt+kJ5IDsujQJB kjrHyJTiKXCnmo3DRNo0vstFwZCVBSEZTZAwEI2o2J8RBrocgbKMFK/V7PlwjtvDILH+ fB5Q== 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=6VZRWJLnT1z76JDdLm3EybzD/MAN98H8Nc/I0JasefM=; fh=WWhLLYyx/qeYwSx6J2//cQJy2ybFEBO8BuL2lXJu+Oo=; b=bNIukYhiWOEwNf1gg24uRUlmQa9hjN7/S/OjinUBaoq0wRcUT5ThqCdqYOkjm0ShSE pzecYftIADwy4ZgRtW2npzWEFswfctj+QXd4R3Y4xrF+Uxzg5sq7k6CTWG8L8WcHIMny aN5+4dKc44/GN0PYBXlDQic3rhUfX+lgRp4EX3ygrecix5P3lKh+nzeQrA1nU7NGUmsj cHtPuNPl21XN+4Dhs1jrxgrZKexIE/YTX+7g66Mlgd9/lml8UPoFTHVlr64fGxqMJUud MTpN+fLp8mlGRHjPjZ4/ToMKDtd4fDL+SIfcIyJb70NwRa3tONVI73qjfPkbcrQ0AuYv 4LsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f+tl2WcA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52528-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52528-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVXCjU7/As64yCEoPl1gVpz4S26Q/Ouaq7rI8VdIgQMyFwKGbr6xHPReBaXh1fHC3b0tcAV1SxyVcyaw3uEJYrVwm5x5dwiz4zvhHZE4Q== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n2-20020a17090ac68200b00296421430c4si4404464pjt.109.2024.02.05.04.11.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 04:11:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52528-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f+tl2WcA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52528-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52528-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E83F0B2253C for ; Mon, 5 Feb 2024 11:57:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19557199B4; Mon, 5 Feb 2024 11:57:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f+tl2WcA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35BDB18EB2; Mon, 5 Feb 2024 11:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707134221; cv=none; b=TYwa3vVEMaTRYzbkqYpAg9WBX7Fm27iXV4Zestuu8dMOKYrrEDBETreUvVh4mvxeagMGyEszW2w66jgyFBm2NW7ig1vew3nwu5y5XAo17CUIykyBUZtl9n8f0VnAJnkSDh9XAX4OpFnPLx7ojUPxg6TuDtm6XImkzdgK4byNv5k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707134221; c=relaxed/simple; bh=Jht2YlgG8xywLPrGTeO637I3BX/HXjoajzB4+QdcUao=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nVG+NvCmeyMKxbWcFEpltvEQ1II3mZiLVIRmdPgMERBa6bmB4RnUNEDiHpYQJCXAi4R4CI+8WaKhMsarP0deXNw5yHDOZTGn//mJkZp6OJOsThwD6k21eabyedY8APKoIudsZOuRvOeRJBmUpva5RCdAaUDamUQgRgbsSOlqy0o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f+tl2WcA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D996C433F1; Mon, 5 Feb 2024 11:56:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707134220; bh=Jht2YlgG8xywLPrGTeO637I3BX/HXjoajzB4+QdcUao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f+tl2WcAgWCzXNSjyv0s5bVf9n00Fmv0awJVRxqmH7FPw3caY36xuZwHCPI6rUFyv HvYiE2tLeChGwkVMcjBKPhD3RDZgoHEUzfbXFNnfoT2efwxBAyRfAAi6g1DXgJBHhB S69Cef6D0aErLuyadSLW8MX85bqwutdVjkiFqkOBPnHOJAxGcoaRvK2KHIrCTBkFHq YGn9FyO6ryPhAnoZavLOQjYCJPMMXPjZ640zhF0D29ga+rURKEZLSi5fNksYc/CMrk DaA0yhk2SngrWvo8EXwi42VhlrvhxMonfXw6j2XHjSOX4tOFuw/vL4fkLfx8xpIbQX fv5EpLdm+IGXQ== From: Christian Brauner To: JonasZhou-oc Cc: Christian Brauner , jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, CobeChen@zhaoxin.com, LouisQi@zhaoxin.com, JonasZhou@zhaoxin.com, viro@zeniv.linux.org.uk Subject: Re: [PATCH] fs/address_space: move i_mmap_rwsem to mitigate a false sharing with i_mmap. Date: Mon, 5 Feb 2024 12:56:46 +0100 Message-ID: <20240205-harmlos-positionieren-ea42ccc90890@brauner> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240202083304.10995-1-JonasZhou-oc@zhaoxin.com> References: <20240202083304.10995-1-JonasZhou-oc@zhaoxin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1331; i=brauner@kernel.org; h=from:subject:message-id; bh=Jht2YlgG8xywLPrGTeO637I3BX/HXjoajzB4+QdcUao=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaQeOMtqetC1ymTGOX6hoyIdV9nZLzXIHBOO6vSO/zB98 mvdgKAnHaUsDGJcDLJiiiwO7Sbhcst5KjYbZWrAzGFlAhnCwMUpABN558PIsKygOl7zqee+Bbwf FgQ690mUyOcx8EyLyEx4fbvXXfzUT4bf7D/fSfOfmXxeuM3+2M0jeafkldSdXW4mTjeLWGP8fXk MIwA= X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 Content-Transfer-Encoding: 8bit On Fri, 02 Feb 2024 16:33:04 +0800, JonasZhou-oc wrote: > In the struct address_space, there is a 32-byte gap between i_mmap > and i_mmap_rwsem. Due to the alignment of struct address_space > variables to 8 bytes, in certain situations, i_mmap and i_mmap_rwsem > may end up in the same CACHE line. > > While running Unixbench/execl, we observe high false sharing issues > when accessing i_mmap against i_mmap_rwsem. We move i_mmap_rwsem > after i_private_list, ensuring a 64-byte gap between i_mmap and > i_mmap_rwsem. > > [...] Applied to the vfs.misc branch of the vfs/vfs.git tree. Patches in the vfs.misc branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc [1/1] fs/address_space: move i_mmap_rwsem to mitigate a false sharing with i_mmap. https://git.kernel.org/vfs/vfs/c/2a42e144dd0b