Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22492160rwd; Fri, 30 Jun 2023 08:38:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlHym+Y+BruLCI4HsDE4UqOESul5wZ2fFeNj2jbXOcDE3kFMkrw2MBOl6+g7PnkcK6SV/q2d X-Received: by 2002:a17:903:41cc:b0:1a1:b3bb:cd5b with SMTP id u12-20020a17090341cc00b001a1b3bbcd5bmr3028028ple.62.1688139503792; Fri, 30 Jun 2023 08:38:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688139503; cv=none; d=google.com; s=arc-20160816; b=yRCaIyr7UstAYsBt3avM39zUe0/h0cE1eZiH3+F8inQaxuK3uSrZ7xA6j/Mq5RNjr2 /Zb5OhflTeKCUC+xqAgmIaDBJp5bcSHxxg3TOtBWIAyZXvoAQZuzkB495zGNPwXkVvhJ 3yOv/z/700Gw05zFgDDgzflw5aSLJ8kt3/91use4jujvMDaeeezXzkE3epg3d7t/q8my LqWJdZUfQyRvBFGMbzv+B1Cb5psdRWFVJ3sAY7M8T01hOpRSjx8Dey88TjSc8ARD9q5K /AewyphkjjGDTJQHY1hsvGbi4vP3PXaAfrbjPlzSy9U+hhHG+qPopqRcHjyG3ftfHa+/ aIDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HhHlzqwatW1phPue78hN8ps2T5V715OdqFBS791c5ag=; fh=jGhu3d0uaHO3PUlHHdlmDfzqnqvwM35yTNWWVA9EhjM=; b=WHjc+yw/miskNA+wwIycuGgp5XOzcPEc/4vVuJ6dLaxPK8rWRZlWa5Z4R6JOEBXCkz 3yL6CjKye7YqQ1XfVeAoFHVFlWshdxgllu+4IMKopWp4/uaFOKaq4SR93MMJiSsqnF+t LnW0QjP9K3R7fLXdSEIic5e+QcMs7MB9TvzI7sO0ohX4dGt3pG7/LOPbUMN5Ht6PKi10 0Vc3p9Ig/b/DswRB9lw9JPtLrxKFAp5bJ8ZyscBTutEOy9NdUdmZCVJICEBLWECDfShd R78Li53itNAz7PRFC+6nd0rMJucUcwxHJJqa6req9nDiKh+pm29w4jxlNQ6D5zn7pYfX a9qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Oq6SRXem; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a17090332ca00b001b858339641si3446615plr.113.2023.06.30.08.38.03; Fri, 30 Jun 2023 08:38:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Oq6SRXem; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232494AbjF3PUB (ORCPT + 99 others); Fri, 30 Jun 2023 11:20:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232862AbjF3PT0 (ORCPT ); Fri, 30 Jun 2023 11:19:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ABFC2703; Fri, 30 Jun 2023 08:19:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 18F7361782; Fri, 30 Jun 2023 15:19:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79C11C433C0; Fri, 30 Jun 2023 15:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688138359; bh=0OcMf9HI6oDlP5s96FA6hXvlby0mTwGL255F60fmJNY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Oq6SRXemZv3QPiYrxSGaCswEqBNCx4KmAFohDEmaVSWQhjF6v7shFbQLXFl7y9UUt KhheirUrp06qdtMvnhiWU+Lejx3RY86tVjq03epKOAkw+hkExs3HaLwwk0iAfcRmtD YK4ehi7CKWHgtMOXqOTjhnuQVCD4aUqezAdq1zeSFoq5GFcAlXDD7iG0Jtg+EtRrws E7YYO1HUD1n2hwY4igPS/nBFtuuyzSj7sS70XDJLpJEotBepbevEc2/aABE3sEcqnw W7rFpy30JPR4C7PLt76qUUA4sIcS81Muwb1Srh8zvHWwzdvSzcf82JEW+OrIEttNB7 lT/gMrs4D9vdg== Date: Fri, 30 Jun 2023 08:19:19 -0700 From: "Darrick J. Wong" To: zenghongling Cc: hch@infradead.org, darrick.wong@oracle.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, zhongling0719@126.com Subject: Re: [PATCH] fs: Optimize unixbench's file copy test Message-ID: <20230630151919.GK11441@frogsfrogsfrogs> References: <1688117303-8294-1-git-send-email-zenghongling@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1688117303-8294-1-git-send-email-zenghongling@kylinos.cn> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 30, 2023 at 05:28:23PM +0800, zenghongling wrote: > The iomap_set_range_uptodate function checks if the file is a private > mapping,and if it is, it needs to do something about it.UnixBench's > file copy tests are mostly share mapping, such a check would reduce > file copy scores, so we added the unlikely macro for optimization. > and the score of file copy can be improved after branch optimization. > As follows: > > ./Run -c 8 -i 3 fstime fsbuffer fsdisk > > Before the optimization > System Benchmarks Partial Index BASELINE RESULT INDEX > File Copy 1024 bufsize 2000 maxblocks 3960.0 689276.0 1740.6 > File Copy 256 bufsize 500 maxblocks 1655.0 204133.0 1233.4 > File Copy 4096 bufsize 8000 maxblocks 5800.0 1526945.0 2632.7 > ======== > System Benchmarks Index Score (Partial Only) 1781.3 > > After the optimization > System Benchmarks Partial Index BASELINE RESULT INDEX > File Copy 1024 bufsize 2000 maxblocks 3960.0 741524.0 1872.5 > File Copy 256 bufsize 500 maxblocks 1655.0 208334.0 1258.8 > File Copy 4096 bufsize 8000 maxblocks 5800.0 1641660.0 2830.4 > ======== > System Benchmarks Index Score (Partial Only) 1882.6 Kernel version? And how does this intersect with the ongoing work to use large folios throughout iomap? --D > Signed-off-by: zenghongling > --- > fs/iomap/buffered-io.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c > index 53cd7b2..35a50c2 100644 > --- a/fs/iomap/buffered-io.c > +++ b/fs/iomap/buffered-io.c > @@ -148,7 +148,7 @@ iomap_set_range_uptodate(struct page *page, unsigned off, unsigned len) > if (PageError(page)) > return; > > - if (page_has_private(page)) > + if (unlikely(page_has_private(page))) > iomap_iop_set_range_uptodate(page, off, len); > else > SetPageUptodate(page); > -- > 2.1.0 >