[merged mm-stable] mm-damon-vaddr-add-nr_piece-==-1-check-in-damon_va_evenly_split_region.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The quilt patch titled
     Subject: mm/damon/vaddr: add 'nr_piece == 1' check in damon_va_evenly_split_region()
has been removed from the -mm tree.  Its filename was
     mm-damon-vaddr-add-nr_piece-==-1-check-in-damon_va_evenly_split_region.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Zheng Yejian <zhengyejian@xxxxxxxxxxxxxxx>
Subject: mm/damon/vaddr: add 'nr_piece == 1' check in damon_va_evenly_split_region()
Date: Tue, 22 Oct 2024 16:39:27 +0800

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@xxxxxxxxxx/

Link: https://lkml.kernel.org/r/20241022083927.3592237-3-zhengyejian@xxxxxxxxxxxxxxx
Signed-off-by: Zheng Yejian <zhengyejian@xxxxxxxxxxxxxxx>
Reviewed-by: SeongJae Park <sj@xxxxxxxxxx>
Cc: Fernand Sieber <sieberf@xxxxxxxxxx>
Cc: Leonard Foerster <foersleo@xxxxxxxxx>
Cc: Shakeel Butt <shakeel.butt@xxxxxxxxx>
Cc: Ye Weihua <yeweihua4@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/damon/tests/vaddr-kunit.h |    1 +
 mm/damon/vaddr.c             |    3 +++
 2 files changed, 4 insertions(+)

--- a/mm/damon/tests/vaddr-kunit.h~mm-damon-vaddr-add-nr_piece-==-1-check-in-damon_va_evenly_split_region
+++ a/mm/damon/tests/vaddr-kunit.h
@@ -300,6 +300,7 @@ static void damon_test_split_evenly(stru
 	damon_test_split_evenly_fail(test, 0, 100, 0);
 	damon_test_split_evenly_succ(test, 0, 100, 10);
 	damon_test_split_evenly_succ(test, 5, 59, 5);
+	damon_test_split_evenly_succ(test, 4, 6, 1);
 	damon_test_split_evenly_succ(test, 0, 3, 2);
 	damon_test_split_evenly_fail(test, 5, 6, 2);
 }
--- a/mm/damon/vaddr.c~mm-damon-vaddr-add-nr_piece-==-1-check-in-damon_va_evenly_split_region
+++ a/mm/damon/vaddr.c
@@ -72,6 +72,9 @@ static int damon_va_evenly_split_region(
 	if (!r || !nr_pieces)
 		return -EINVAL;
 
+	if (nr_pieces == 1)
+		return 0;
+
 	orig_end = r->ar.end;
 	sz_orig = damon_sz_region(r);
 	sz_piece = ALIGN_DOWN(sz_orig / nr_pieces, DAMON_MIN_REGION);
_

Patches currently in -mm which might be from zhengyejian@xxxxxxxxxxxxxxx are






[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux