Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp289015rdb; Mon, 22 Jan 2024 04:26:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJOeXcdXVlJjSUo/atLcSAgiESxXeeNLK3SbIu6cVM+uVNCQCYQvJsk7J000iTEL+u6gte X-Received: by 2002:a05:620a:98b:b0:783:e81:d616 with SMTP id x11-20020a05620a098b00b007830e81d616mr4573735qkx.132.1705926410290; Mon, 22 Jan 2024 04:26:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705926410; cv=pass; d=google.com; s=arc-20160816; b=XWmYVQm8LHUkblxPOHRnVpOeMLNv8bAGVASv+rC1+olMKYXZE8M+Um81NVxC03YQkd 6KT2d7yH1hXqMeRBgg2IV9CgINuYsBo4qrveuJItUg+jOo60DfQRCnM71bjo4ab24OC/ 2TqqbHTbxTUbvFq3Q/cRI4C6nurlW6zqWP+T0znwopByCuof1SbNlpG6gguI8MdSCpON LFHFERpsPZqWZ2L0Z1ECLqek/JkvQ0h/wzCwuOWBiimGOEuwt2UYmSxSFXjc7yFy7Go0 wUlR0xG8PpXpb2r5MKnjaQQZOqy5Jw2twOvjs9ol/hrfiYH9si1RuW7+C7UgwKTmVopg JxtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=RHICCOadaMxgP47/oXZNeguQHdQcN2ZOcH57Mgkivuw=; fh=XQERXoZpyTid8lXVMF11nfn6ek7tzA3uzGKuEkhos7w=; b=eBCRScckEz3niT0dgE7/QcZTp95ph1YaCQlc17Yvn21UZMNBiVFvW2aMoGz0ho1/De xvkJFz64aJW+TOWZDyF7j13rD4fh8rYYuQKY9M51TCQCjafguOGQjBi8thBW7/SifiY/ cwocfx4zOk0w/WAbURkGH/42ZK845FXzpw5oUVjsaQ+gyWiImoeaE6MOhHBgnPWJf6p2 KXAIJhVZBTLOr5uztAAoJSS0w4Aqia5tAS63q2o9B6aJKPcvwPZ5HS3O+SXkquXHRrDh 6Ofiqt9Qv3g/RFtQ4ZInM8yVhIw1WatnK+mrZU4llLEPEIpaKITjUlG6dpMK08lpbnkL aUQg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-33013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s18-20020a05620a081200b007833e40eb41si5438424qks.352.2024.01.22.04.26.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 04:26:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33013-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=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-33013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 102DD1C21F5A for ; Mon, 22 Jan 2024 12:26:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 504483C48E; Mon, 22 Jan 2024 12:26:19 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 2F2333BB22; Mon, 22 Jan 2024 12:26:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705926378; cv=none; b=Kqy1wgKd83wiUbtP9I+NgPilu7Yp6gTyaip68lwv4LZ0KrJXzSY8mnYnpFRKJiYuBDb5hQqsu/R87cWmwDaPtiuuZUyrTVE4b+8hmTj5+J9WOkclWvzk6LwaV4+zBsNEhXlgWBNfwrc2p5lAGtXx4o1Q87R8a3FHwBmciRexp0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705926378; c=relaxed/simple; bh=fOxUJ5uH3HMqlEd680OVHktiVcZYDr7XydXxCfRogLM=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=pgKb5/Kugj6pPSksIQ5RXwVipjTbOYIwj8ghVB3q2EUq1C5qM75RGEJz+KKeqN9WWcsAn8aE2Ouitue3rUUd0KIr6O8pISdcrdiQ4zdxMkV0c8rgU/pRYjQ/WcSTbyaHFeNFpncsIWMsks8oQYRMtJeEzo6V3opxKRrnltxXk5I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4TJTvD1K39zsWKS; Mon, 22 Jan 2024 20:25:12 +0800 (CST) Received: from dggpeml500021.china.huawei.com (unknown [7.185.36.21]) by mail.maildlp.com (Postfix) with ESMTPS id 8550218007B; Mon, 22 Jan 2024 20:25:57 +0800 (CST) Received: from [10.174.177.174] (10.174.177.174) by dggpeml500021.china.huawei.com (7.185.36.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 22 Jan 2024 20:25:56 +0800 Message-ID: Date: Mon, 22 Jan 2024 20:25:56 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH 0/2] fs: make the i_size_read/write helpers be smp_load_acquire/store_release() Content-Language: en-US To: Christian Brauner CC: , , , , , , , , , , Baokun Li References: <20240122094536.198454-1-libaokun1@huawei.com> <20240122-gepokert-mitmachen-6d6ba8d2f0a8@brauner> From: Baokun Li In-Reply-To: <20240122-gepokert-mitmachen-6d6ba8d2f0a8@brauner> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500021.china.huawei.com (7.185.36.21) On 2024/1/22 19:14, Christian Brauner wrote: > On Mon, 22 Jan 2024 17:45:34 +0800, Baokun Li wrote: >> This patchset follows the linus suggestion to make the i_size_read/write >> helpers be smp_load_acquire/store_release(), after which the extra smp_rmb >> in filemap_read() is no longer needed, so it is removed. >> >> Functional tests were performed and no new problems were found. >> >> Here are the results of unixbench tests based on 6.7.0-next-20240118 on >> arm64, with some degradation in single-threading and some optimization in >> multi-threading, but overall the impact is not significant. >> >> [...] > Hm, we can certainly try but I wouldn't rule it out that someone will > complain aobut the "non-significant" degradation in single-threading. > We'll see. Let that performance bot chew on it for a bit as well. > > But I agree that the smp_load_acquire()/smp_store_release() is clearer > than the open-coded smp_rmb(). Thank you very much for applying this patch! Adding barriers where none existed does introduce some performance degradation. But the multi-threaded test results here look pretty good, it's just that the single-threaded test results have a bit too much degradation for Shell Scripts (8 concurrent).  I've tracked down this test item, which calls clone() and wait4() and then triggers isize reads and writes frequently, so the degradation here is as expected, just not sure if anyone cares about this scenario. > --- > > 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/2] fs: make the i_size_read/write helpers be smp_load_acquire/store_release() > https://git.kernel.org/vfs/vfs/c/7d7825fde8ba > [2/2] Revert "mm/filemap: avoid buffered read/write race to read inconsistent data" > https://git.kernel.org/vfs/vfs/c/83dfed690b90 Thanks! -- With Best Regards, Baokun Li .