Commit 8a4c9fc6 authored by Yu Kuai's avatar Yu Kuai
Browse files

iomap: add support to track dirty state of sub pages

hulk inclusion
category: performance
bugzilla: https://gitee.com/openeuler/kernel/issues/I8TKTW


CVE: NA

------------------------------------------

commit 9dc55f13 ("iomap: add support for sub-pagesize buffered I/O
without buffer heads") replace the per-block structure buffer_head with
the per-page structure iomap_page. However, iomap_page can't track the
dirty state of sub pages, which will cause performance issue since sub
pages will be writeback even if they are not dirty.

For example, if block size is 4k and page size is 64k:

dd if=/dev/zero of=testfile bs=4k count=16 oflag=sync

With buffer_head implementation, the above dd cmd will writeback 4k in
each round. However, with iomap_page implementation, the range of
writeback in each round is from the start of the page to the end offset
we just wrote.

Thus add support to track dirty state in iomap_page.

test environment:
platform:	arm64
pagesize:	64k
blocksize:	4k

test case:
dd if=/dev/zero of=/mnt/testfile bs=1M count=128
fio --ioengine=sync --rw=randwrite --iodepth=64 --name=test \
    --filename=/mnt/testfile --bs=4k --fsync=1

The test result is:
xfs with patch:		WRITE: bw=4609KiB/s (4720kB/s)
xfs without patch	WRITE: bw=2714KiB/s (2780kB/s)
ext4:			WRITE: bw=3840KiB/s (3932kB/s)

Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
parent 40a1ac08
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment