Skip to content
Commit 477327e1 authored by Zheng Yejian's avatar Zheng Yejian Committed by Andrew Morton
Browse files

mm/damon/vaddr: add 'nr_piece == 1' check in damon_va_evenly_split_region()

As discussed in [1], damon_va_evenly_split_region() is called to
size-evenly split a region into 'nr_pieces' small regions,
when nr_pieces == 1, no actual split is required. Check that case
for better code readability and add a simple kunit testcase.

[1] https://lore.kernel.org/all/20241021163316.12443-1-sj@kernel.org/

Link: https://lkml.kernel.org/r/20241022083927.3592237-3-zhengyejian@huaweicloud.com


Signed-off-by: default avatarZheng Yejian <zhengyejian@huaweicloud.com>
Reviewed-by: default avatarSeongJae Park <sj@kernel.org>
Cc: Fernand Sieber <sieberf@amazon.com>
Cc: Leonard Foerster <foersleo@amazon.de>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Ye Weihua <yeweihua4@huawei.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent f3c7a1ed
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment