linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: Optimize unixbench's file copy test
@ 2023-06-30  9:28 zenghongling
  2023-06-30 15:19 ` Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zenghongling @ 2023-06-30  9:28 UTC (permalink / raw)
  To: hch, darrick.wong, linux-xfs, linux-fsdevel, linux-kernel
  Cc: zhongling0719, zenghongling

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

Signed-off-by: zenghongling <zenghongling@kylinos.cn>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-05  4:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-30  9:28 [PATCH] fs: Optimize unixbench's file copy test zenghongling
2023-06-30 15:19 ` Darrick J. Wong
2023-06-30 21:44 ` Matthew Wilcox
2023-07-05  4:49 ` Ritesh Harjani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).