Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp935789rdb; Fri, 2 Feb 2024 08:21:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5PzZVK1GBEweSCKMtxX704mWVS8gEtE9aLzt9pvFeM6GLxe8K24gAQUUVr0zgbGjVzaj8 X-Received: by 2002:a17:902:708c:b0:1d9:63d1:e619 with SMTP id z12-20020a170902708c00b001d963d1e619mr3351671plk.29.1706890865684; Fri, 02 Feb 2024 08:21:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706890865; cv=pass; d=google.com; s=arc-20160816; b=bpLqfdsVzV2iTpR5b9DjzXvEyGq3Och6rkU33aNq9QmGUWSwMSmx+bbKqQquLPxxYE GTjJK4sTTbL0g58CJDvGY/dqrSC2/mjX7iQVqVtS2cjqOcpizgwhlQjTBt8TzITfDp81 JEEK+oDWO42m6i7aItIrh+lMASLAaAitgSbtrX/HUo5nSw3bX/ZGLxgPXUjvAEHsyb56 bW6yn9EKiq7z/RC4lngmO1YGS3EbnzlUCH248NxNg93wfQbLQJPZrUQByla1kzviQVc5 TlmZmIW5yoAMTZZix5ML6s1GdpA9QsUvbU8ZAvDreu4FNQvrmklezZCUZQdYfeZLJfYx VfIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=KxD8XMUWv3jmH/Fq+OV07yoiBGbX4tsjozHqY2oaW+E=; fh=bsIL79Nd9teHyNEaqyupLAhq/Bp6q3aCWkxETMiSLuM=; b=QIMYMsR7EJB0E7fJGsFunUnv1s7kpuz3kUPg7jTOwIaBtXAR5J6HmQ6IyX//qIWqL+ 9vtkftI18xU3NNp2Nqi1TH9IN6mU+cskanJOivdTj42RQeRAto74LXuL472Suwn0+VON I26Xnld2I+BQJi3DPylEup8RbC+dxJyPOXAU3SUfKc5KgEqPJqYlt23jQHn9BKtyTLOH BiUUMS5I1LzMm1zWBssvWAo5ib4pruhpzso4UWTa057eZ0ziRoYlTAyYdVaTnbGapQXJ F/s2FUAAWd99s2yBSFp5nKUOZaJ+XM3n815D5yjEXuL73AIPeGvYmYHr8s0CzP1Pi6Mg DP0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=HSSxym0H; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-50125-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50125-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk X-Forwarded-Encrypted: i=1; AJvYcCUAncxnhdd3QmpK6GaM5zU7Bt7CN0z4m8yXe4i0yPJfuqTK8pRrs+JmGCNxqojc+/KAQ5Ez0J0MzvLuXuDTk5f0UDi2IbF+sOYBJ+dh4A== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i18-20020a17090332d200b001d945458de9si1889347plr.310.2024.02.02.08.21.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 08:21:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50125-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=@linux.org.uk header.s=zeniv-20220401 header.b=HSSxym0H; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-50125-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50125-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk 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 E3AE628857F for ; Fri, 2 Feb 2024 16:21:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 570641474D4; Fri, 2 Feb 2024 16:20:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="HSSxym0H" Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (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 F2B4012FB39; Fri, 2 Feb 2024 16:20:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706890856; cv=none; b=XqcZ1hYFdSXzTIphTN1tpg55VG+vrzjYrBD8fdqE5j0CFVmULB3GjrgVnfq75BFhn6hj2ejCy3I3vBYM7sIKB5JOCTnEUEa17vfJAFxijoR9frHTr2TkuPbjiiHVL7PTTgxulwu40/X5MOT6GFjPqU2HwmdvcQXwWyE2QGNnkl0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706890856; c=relaxed/simple; bh=bD0ZkyUPj4iXgoL5OqwiOH9PZ+s/La4JiuOzI4zjCxY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RVOKtxRSwz6tbIcqwEB+W/BEvSOmBey5ejGvl6POwGHI6HfWzlj/3C4tRU5nDT67IEBUaE1hmpJYRiDS7kVde8G9TQcEYb7g8wUX6fkMyRJJ1XiGwlwclH74SM+Ml9+codRpk6mfkmpilb9VvFpoNxytoXSdEAEA0/UL4N1VMPs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=HSSxym0H; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=KxD8XMUWv3jmH/Fq+OV07yoiBGbX4tsjozHqY2oaW+E=; b=HSSxym0HFmE0Fg+8B1IvLzYkYo 1xehZhCG+uo51qjW88cX4HimzGzUigrm7mIf5oTO3X+jy4lxQ5WkmMd8lYlpPwwvXNSkiuXKyOfDb KuLlsLLFHOz/WACGtGG1w6Ebv23C5Y32DV9F04GyxenoGfuh35g7Rk9nDgLi1fMs/v8LdNJ6TranQ CafnahP1GOu2bEYv3LBAISYM51j2M54ozKWek0sGTcmEiXLUq87AyzHO6WtCfCNMqRZwlaHTrgjKK q9BU6KAYZRxY9rRB6NxE+VH2UHsXeO8Gy8gCshcBQ/WmOF4vjrOA8tlBD8Gd99fg2SHDcwVzQyx/A pfySrV4g==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rVwHQ-0046bO-2G; Fri, 02 Feb 2024 16:20:40 +0000 Date: Fri, 2 Feb 2024 16:20:40 +0000 From: Al Viro To: JonasZhou-oc Cc: brauner@kernel.org, jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, CobeChen@zhaoxin.com, LouisQi@zhaoxin.com, JonasZhou@zhaoxin.com Subject: Re: [PATCH] fs/address_space: move i_mmap_rwsem to mitigate a false sharing with i_mmap. Message-ID: <20240202162040.GA2087318@ZenIV> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240202083304.10995-1-JonasZhou-oc@zhaoxin.com> Sender: Al Viro On Fri, Feb 02, 2024 at 04:33:04PM +0800, JonasZhou-oc wrote: > From: JonasZhou > > 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. > > For Intel Silver machines (2 sockets) using kernel v6.8 rc-2, the score > of Unixbench/execl improves by ~3.94%, and the score of Unixbench/shell > improves by ~3.26%. Looks sane.