Re: [PATCH 2/2] selftests/mm: protection_keys: Fix dead code

2025-09-15 Thread Zi Yan
et's enable the while loop such that it gets executed nr_iterations > times. Simplify the code a bit as well. > > Reviewed-by: Sidhartha Kumar > Signed-off-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/protection_keys.c | 4 +--- > 1 file changed, 1 inser

Re: [PATCH 1/2] selftests/mm: Add -Wunreachable-code and fix warnings

2025-09-15 Thread Zi Yan
ftests/mm/split_huge_page_test.c | 2 +- > 4 files changed, 5 insertions(+), 5 deletions(-) > LGTM. Reviewed-by: Zi Yan Best Regards, Yan, Zi

Re: [PATCH v2 1/2] selftests/mm: split_huge_page_test: fix occasional is_backed_by_folio() wrong results

2025-09-02 Thread Zi Yan
() with more > precise check") > Signed-off-by: David Hildenbrand > --- > tools/testing/selftests/mm/split_huge_page_test.c | 15 +++---- > 1 file changed, 7 insertions(+), 8 deletions(-) > LGTM. Thanks for fixing it. Reviewed-by: Zi Yan Best Regards, Yan, Zi

Re: [PATCH v3 2/8] selftests/mm: protection_keys: Fix dead code

2025-08-22 Thread Zi Yan
et's enable the while loop such that it gets executed nr_iterations > times. Simplify the code a bit as well. > > Reviewed-by: Sidhartha Kumar > Signed-off-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/protection_keys.c | 4 +--- > 1 file changed, 1 in

Re: [PATCH v3 1/8] selftests/mm: Add -Wunreachable-code and fix warnings

2025-08-22 Thread Zi Yan
| 5 ++--- > tools/testing/selftests/mm/pkey_sighandler_tests.c | 2 +- > tools/testing/selftests/mm/split_huge_page_test.c | 2 +- > 4 files changed, 5 insertions(+), 5 deletions(-) > LGTM. Reviewed-by: Zi Yan -- Best Regards, Yan, Zi

Re: [PATCH v5 4/5] selftests/mm: add check_after_split_folio_orders() helper.

2025-08-20 Thread Zi Yan
On 20 Aug 2025, at 5:22, Baolin Wang wrote: > On 2025/8/19 02:46, Zi Yan wrote: >> The helper gathers a folio order statistics of folios within a virtual >> address range and checks it against a given order list. It aims to provide >> a more precise folio order check instead

Re: [PATCH v5 3/5] selftests/mm: reimplement is_backed_by_thp() with more precise check

2025-08-19 Thread Zi Yan
On 19 Aug 2025, at 12:50, Zi Yan wrote: > On 19 Aug 2025, at 4:54, David Hildenbrand wrote: > >> On 18.08.25 20:46, Zi Yan wrote: >>> and rename it to is_backed_by_folio(). >>> >>> is_backed_by_folio() checks if the given vaddr is backed a folio with

Re: [PATCH v5 3/5] selftests/mm: reimplement is_backed_by_thp() with more precise check

2025-08-19 Thread Zi Yan
On 19 Aug 2025, at 4:54, David Hildenbrand wrote: > On 18.08.25 20:46, Zi Yan wrote: >> and rename it to is_backed_by_folio(). >> >> is_backed_by_folio() checks if the given vaddr is backed a folio with >> a given order. It does so by: >> 1. getting the pfn of the

[PATCH v5 5/5] selftests/mm: check after-split folio orders in split_huge_page_test.

2025-08-18 Thread Zi Yan
the range being split multiple times due to debugfs split function always perform splits with a pagesize step for a given range. The following tests are not changed: 1. split_pte_mapped_thp: the test already uses kpageflags to check; 2. split_file_backed_thp: no vaddr available. Signed-off-by: Zi

[PATCH v5 4/5] selftests/mm: add check_after_split_folio_orders() helper.

2025-08-18 Thread Zi Yan
The helper gathers a folio order statistics of folios within a virtual address range and checks it against a given order list. It aims to provide a more precise folio order check instead of just checking the existence of PMD folios. The helper will be used the upcoming commit. Signed-off-by: Zi

[PATCH v5 3/5] selftests/mm: reimplement is_backed_by_thp() with more precise check

2025-08-18 Thread Zi Yan
kpageflags of all tail pfns. pmd_order is added to split_huge_page_test.c and replaces max_order. Signed-off-by: Zi Yan Reviewed-by: Wei Yang Reviewed-by: wang lian --- .../selftests/mm/split_huge_page_test.c | 88 ++- tools/testing/selftests/mm/vm_util.c | 13 +++ tools

[PATCH v5 2/5] selftests/mm: mark all functions static in split_huge_page_test.c

2025-08-18 Thread Zi Yan
All functions are only used within the file. Signed-off-by: Zi Yan Reviewed-by: Wei Yang Reviewed-by: wang lian Acked-by: David Hildenbrand --- .../selftests/mm/split_huge_page_test.c | 22 +-- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools

[PATCH v5 1/5] mm/huge_memory: add new_order and offset to split_huge_pages*() pr_debug.

2025-08-18 Thread Zi Yan
They are useful information for debugging split huge page tests. Signed-off-by: Zi Yan Reviewed-by: Wei Yang Reviewed-by: Donet Tom Reviewed-by: wang lian Reviewed-by: Baolin Wang Reviewed-by: Barry Song Acked-by: David Hildenbrand --- mm/huge_memory.c | 8 1 file changed, 4

[PATCH v5 0/5] Better split_huge_page_test result check

2025-08-18 Thread Zi Yan
rnel.org/linux-mm/20250815023915.1394655-1-...@nvidia.com/ [5] Zi Yan (5): mm/huge_memory: add new_order and offset to split_huge_pages*() pr_debug. selftests/mm: mark all functions static in split_huge_page_test.c selftests/mm: reimplement is_backed_by_thp() with more precise

Re: [PATCH v4 3/5] selftests/mm: reimplement is_backed_by_thp() with more precise check

2025-08-18 Thread Zi Yan
On 18 Aug 2025, at 4:33, David Hildenbrand wrote: > On 15.08.25 04:39, Zi Yan wrote: >> and rename it to is_backed_by_folio(). >> >> is_backed_by_folio() checks if the given vaddr is backed a folio with >> a given order. It does so by: >> 1. getting the pfn of the

Re: [PATCH v4 3/5] selftests/mm: reimplement is_backed_by_thp() with more precise check

2025-08-16 Thread Zi Yan
On 16 Aug 2025, at 3:30, Andrew Morton wrote: > I hit a large reject. Can you please redo against next mm-new? Sure. -- Best Regards, Yan, Zi

[PATCH v4 0/5] Better split_huge_page_test result check

2025-08-14 Thread Zi Yan
867c-31405cbba...@redhat.com/ [2] https://lore.kernel.org/linux-mm/20250806022045.342824-1-...@nvidia.com/ [3] https://lore.kernel.org/linux-mm/20250808190144.797076-1-...@nvidia.com/ [4] https://lore.kernel.org/linux-mm/20250812155512.926011-1-...@nvidia.com/ Zi Yan (5): mm/huge_memory: add new_or

[PATCH v4 4/5] selftests/mm: add check_after_split_folio_orders() helper.

2025-08-14 Thread Zi Yan
The helper gathers a folio order statistics of folios within a virtual address range and checks it against a given order list. It aims to provide a more precise folio order check instead of just checking the existence of PMD folios. The helper will be used the upcoming commit. Signed-off-by: Zi

[PATCH v4 5/5] selftests/mm: check after-split folio orders in split_huge_page_test.

2025-08-14 Thread Zi Yan
the range being split multiple times due to debugfs split function always perform splits with a pagesize step for a given range. The following tests are not changed: 1. split_pte_mapped_thp: the test already uses kpageflags to check; 2. split_file_backed_thp: no vaddr available. Signed-off-by: Zi

[PATCH v4 3/5] selftests/mm: reimplement is_backed_by_thp() with more precise check

2025-08-14 Thread Zi Yan
kpageflags of all tail pfns. pmd_order is added to split_huge_page_test.c and replaces max_order. Signed-off-by: Zi Yan --- .../selftests/mm/split_huge_page_test.c | 90 ++- tools/testing/selftests/mm/vm_util.c | 13 +++ tools/testing/selftests/mm/vm_util.h | 4

[PATCH v4 2/5] selftests/mm: mark all functions static in split_huge_page_test.c

2025-08-14 Thread Zi Yan
All functions are only used within the file. Signed-off-by: Zi Yan --- .../selftests/mm/split_huge_page_test.c | 22 +-- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm

[PATCH v4 1/5] mm/huge_memory: add new_order and offset to split_huge_pages*() pr_debug.

2025-08-14 Thread Zi Yan
They are useful information for debugging split huge page tests. Signed-off-by: Zi Yan Reviewed-by: Wei Yang Reviewed-by: Donet Tom Reviewed-by: wang lian Reviewed-by: Baolin Wang Reviewed-by: Barry Song Acked-by: David Hildenbrand --- mm/huge_memory.c | 8 1 file changed, 4

Re: [PATCH v3 2/4] selftests/mm: add check_folio_orders() helper.

2025-08-14 Thread Zi Yan
On 12 Aug 2025, at 23:38, wang lian wrote: >> On Aug 12, 2025, at 23:55, Zi Yan wrote: >> >> The helper gathers an folio order statistics of folios within a virtual >> address range and checks it against a given order list. It aims to provide >> a more precise fol

Re: [PATCH v3 4/4] selftests/mm: check after-split folio orders in split_huge_page_test.

2025-08-14 Thread Zi Yan
On 14 Aug 2025, at 5:16, Wei Yang wrote: > On Tue, Aug 12, 2025 at 11:55:12AM -0400, Zi Yan wrote: >> Instead of just checking the existence of PMD folios before and after folio >> split tests, use check_folio_orders() to check after-split folio orders. >> >> The foll

Re: [PATCH v3 3/4] selftests/mm: reimplement is_backed_by_thp() with more precise check

2025-08-13 Thread Zi Yan
On 13 Aug 2025, at 17:41, Wei Yang wrote: > On Tue, Aug 12, 2025 at 11:55:11AM -0400, Zi Yan wrote: >> and rename it to is_backed_by_folio(). >> >> is_backed_by_folio() checks if the given vaddr is backed a folio with >> a given order. It does so by: >> 1. g

Re: [PATCH v3 2/4] selftests/mm: add check_folio_orders() helper.

2025-08-13 Thread Zi Yan
On 13 Aug 2025, at 17:12, Wei Yang wrote: > On Tue, Aug 12, 2025 at 11:55:10AM -0400, Zi Yan wrote: > [...] >> +/* >> + * gather_folio_orders - scan through [vaddr_start, len) and record folio >> orders >> + * @vaddr_start: start vaddr >> + * @len: r

[PATCH v3 4/4] selftests/mm: check after-split folio orders in split_huge_page_test.

2025-08-12 Thread Zi Yan
available. Signed-off-by: Zi Yan --- .../selftests/mm/split_huge_page_test.c | 85 +-- 1 file changed, 61 insertions(+), 24 deletions(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 3aaf783f339f

[PATCH v3 3/4] selftests/mm: reimplement is_backed_by_thp() with more precise check

2025-08-12 Thread Zi Yan
kpageflags of all tail pfns. pmd_order is added to split_huge_page_test.c and replaces max_order. Signed-off-by: Zi Yan --- .../selftests/mm/split_huge_page_test.c | 67 +-- tools/testing/selftests/mm/vm_util.c | 2 +- tools/testing/selftests/mm/vm_util.h | 1

[PATCH v3 0/4] Better split_huge_page_test result check

2025-08-12 Thread Zi Yan
ed variable length variables and used malloc instead. [1] https://lore.kernel.org/linux-mm/e2f32bdb-e4a4-447c-867c-31405cbba...@redhat.com/ [2] https://lore.kernel.org/linux-mm/20250806022045.342824-1-...@nvidia.com/ [3] https://lore.kernel.org/linux-mm/20250808190144.797076-1-...@nvidia.com/

[PATCH v3 2/4] selftests/mm: add check_folio_orders() helper.

2025-08-12 Thread Zi Yan
The helper gathers an folio order statistics of folios within a virtual address range and checks it against a given order list. It aims to provide a more precise folio order check instead of just checking the existence of PMD folios. Signed-off-by: Zi Yan --- .../selftests/mm

[PATCH v3 1/4] mm/huge_memory: add new_order and offset to split_huge_pages*() pr_debug.

2025-08-12 Thread Zi Yan
They are useful information for debugging split huge page tests. Signed-off-by: Zi Yan Reviewed-by: Wei Yang Reviewed-by: Donet Tom Reviewed-by: wang lian Reviewed-by: Baolin Wang Reviewed-by: Barry Song Acked-by: David Hildenbrand --- mm/huge_memory.c | 8 1 file changed, 4

Re: [PATCH v2 2/3] selftests/mm: add check_folio_orders() helper.

2025-08-11 Thread Zi Yan
On 11 Aug 2025, at 3:52, Baolin Wang wrote: > On 2025/8/9 03:01, Zi Yan wrote: >> The helper gathers an folio order statistics of folios within a virtual >> address range and checks it against a given order list. It aims to provide >> a more precise folio order check instead

Re: [PATCH v2 2/3] selftests/mm: add check_folio_orders() helper.

2025-08-11 Thread Zi Yan
On 10 Aug 2025, at 12:49, Donet Tom wrote: > On 8/9/25 12:31 AM, Zi Yan wrote: >> The helper gathers an folio order statistics of folios within a virtual >> address range and checks it against a given order list. It aims to provide >> a more precise folio order check instead

Re: [PATCH v2 2/3] selftests/mm: add check_folio_orders() helper.

2025-08-11 Thread Zi Yan
On 9 Aug 2025, at 16:18, Wei Yang wrote: > On Fri, Aug 08, 2025 at 03:01:43PM -0400, Zi Yan wrote: >> The helper gathers an folio order statistics of folios within a virtual >> address range and checks it against a given order list. It aims to provide >> a more precise foli

Re: [PATCH v2 3/3] selftests/mm: check after-split folio orders in split_huge_page_test.

2025-08-11 Thread Zi Yan
On 10 Aug 2025, at 12:53, Donet Tom wrote: > On 8/9/25 12:31 AM, Zi Yan wrote: >> Instead of just checking the existence of PMD folios before and after folio >> split tests, use check_folio_orders() to check after-split folio orders. >> >> The following

[PATCH v2 1/3] mm/huge_memory: add new_order and offset to split_huge_pages*() pr_debug.

2025-08-08 Thread Zi Yan
They are useful information for debugging split huge page tests. Signed-off-by: Zi Yan --- mm/huge_memory.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 2b4ea5a2ce7d..ebf875928bac 100644 --- a/mm/huge_memory.c +++ b/mm

[PATCH v2 3/3] selftests/mm: check after-split folio orders in split_huge_page_test.

2025-08-08 Thread Zi Yan
available. Signed-off-by: Zi Yan --- .../selftests/mm/split_huge_page_test.c | 98 ++- 1 file changed, 72 insertions(+), 26 deletions(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 5ab488fab1cd

[PATCH v2 2/3] selftests/mm: add check_folio_orders() helper.

2025-08-08 Thread Zi Yan
The helper gathers an folio order statistics of folios within a virtual address range and checks it against a given order list. It aims to provide a more precise folio order check instead of just checking the existence of PMD folios. Signed-off-by: Zi Yan --- .../selftests/mm

[PATCH v2 0/3] Better split_huge_page_test result check

2025-08-08 Thread Zi Yan
linux-mm/20250806022045.342824-1-...@nvidia.com/ Zi Yan (3): mm/huge_memory: add new_order and offset to split_huge_pages*() pr_debug. selftests/mm: add check_folio_orders() helper. selftests/mm: check after-split folio orders in split_huge_page_test. mm/huge_memory.c

Re: [PATCH 2/4] mm/huge_memory: move to next folio after folio_split() succeeds.

2025-08-08 Thread Zi Yan
On 8 Aug 2025, at 11:24, Zi Yan wrote: > On 7 Aug 2025, at 23:15, Wei Yang wrote: > >> On Thu, Aug 07, 2025 at 01:05:09PM -0400, Zi Yan wrote: >>> On 7 Aug 2025, at 4:55, Wei Yang wrote: >>> >>>> On Tue, Aug 05, 2025 at 10:20:43PM -0400, Zi Yan

Re: [PATCH 2/4] mm/huge_memory: move to next folio after folio_split() succeeds.

2025-08-08 Thread Zi Yan
On 7 Aug 2025, at 23:15, Wei Yang wrote: > On Thu, Aug 07, 2025 at 01:05:09PM -0400, Zi Yan wrote: >> On 7 Aug 2025, at 4:55, Wei Yang wrote: >> >>> On Tue, Aug 05, 2025 at 10:20:43PM -0400, Zi Yan wrote: >>> [...] >>>

Re: [PATCH 2/4] mm/huge_memory: move to next folio after folio_split() succeeds.

2025-08-07 Thread Zi Yan
On 7 Aug 2025, at 4:45, Wei Yang wrote: > On Tue, Aug 05, 2025 at 10:20:43PM -0400, Zi Yan wrote: >> Current behavior is to move to next PAGE_SIZE and split, but that makes it >> hard to check after-split folio orders. This is a preparation patch to >> allow more precise

Re: [PATCH 3/4] selftests/mm: add check_folio_orders() helper.

2025-08-07 Thread Zi Yan
On 7 Aug 2025, at 2:49, Baolin Wang wrote: > On 2025/8/6 10:20, Zi Yan wrote: >> The helper gathers an folio order statistics of folios within a virtual >> address range and checks it against a given order list. It aims to provide >> a more precise folio order check instead

Re: [PATCH 2/4] mm/huge_memory: move to next folio after folio_split() succeeds.

2025-08-07 Thread Zi Yan
On 7 Aug 2025, at 4:55, Wei Yang wrote: > On Tue, Aug 05, 2025 at 10:20:43PM -0400, Zi Yan wrote: > [...] >> >> -if (in_folio_offset < 0 || >> -in_folio_offset >= folio_nr_pages(folio)) { >> +if (in_folio_offse

Re: [PATCH 3/4] selftests/mm: add check_folio_orders() helper.

2025-08-07 Thread Zi Yan
On 6 Aug 2025, at 23:00, wang lian wrote: > Hi Zi, > > Thanks for the patch. > > I have a nit suggestion to centralize some of the macro definitions > for better consistency and reusability. > > On [Date of patch], Zi Yan wrote: >> diff --git a/tools/testing/self

Re: [PATCH 2/4] mm/huge_memory: move to next folio after folio_split() succeeds.

2025-08-06 Thread Zi Yan
On 6 Aug 2025, at 8:47, David Hildenbrand wrote: > On 06.08.25 04:20, Zi Yan wrote: >> Current behavior is to move to next PAGE_SIZE and split, but that makes it >> hard to check after-split folio orders. This is a preparation patch to >> allow more precise split_huge_

[PATCH 4/4] selftests/mm: check after-split folio orders in split_huge_page_test.

2025-08-05 Thread Zi Yan
available. Signed-off-by: Zi Yan --- .../selftests/mm/split_huge_page_test.c | 67 +-- 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 3c761228e451

[PATCH 3/4] selftests/mm: add check_folio_orders() helper.

2025-08-05 Thread Zi Yan
The helper gathers an folio order statistics of folios within a virtual address range and checks it against a given order list. It aims to provide a more precise folio order check instead of just checking the existence of PMD folios. Signed-off-by: Zi Yan --- tools/testing/selftests/mm

[PATCH 2/4] mm/huge_memory: move to next folio after folio_split() succeeds.

2025-08-05 Thread Zi Yan
on its current behavior. Signed-off-by: Zi Yan --- mm/huge_memory.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 8a11c2d402d4..b2ce8ac0c5a9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -4341,6 +4341,7

[PATCH 1/4] mm/huge_memory: add new_order and offset to split_huge_pages*() pr_debug.

2025-08-05 Thread Zi Yan
They are useful information for debugging split huge page tests. Signed-off-by: Zi Yan --- mm/huge_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 2b4ea5a2ce7d..8a11c2d402d4 100644 --- a/mm/huge_memory.c +++ b/mm

[PATCH 0/4] Better split_huge_page_test result check

2025-08-05 Thread Zi Yan
-867c-31405cbba...@redhat.com/ [2] https://lore.kernel.org/linux-mm/20250805175140.241656-1-...@nvidia.com/ Zi Yan (4): mm/huge_memory: add new_order and offset to split_huge_pages*() pr_debug. mm/huge_memory: move to next folio after folio_split() succeeds. selftests/mm: add check_folio_o

Re: [PATCH] selftests/mm: fix FORCE_READ to read input value correctly.

2025-08-05 Thread Zi Yan
On 5 Aug 2025, at 15:00, Lorenzo Stoakes wrote: > On Tue, Aug 05, 2025 at 01:51:40PM -0400, Zi Yan wrote: >> FORCE_READ() converts input value x to its pointer type then reads from >> address x. This is wrong. If x is a non-pointer, it would be caught it >> easily. But all

Re: [PATCH] selftests/mm: fix FORCE_READ to read input value correctly.

2025-08-05 Thread Zi Yan
On 5 Aug 2025, at 14:38, Jann Horn wrote: > On Tue, Aug 5, 2025 at 7:51 PM Zi Yan wrote: >> FORCE_READ() converts input value x to its pointer type then reads from >> address x. This is wrong. If x is a non-pointer, it would be caught it >> easily. But all FORCE_READ() calle

[PATCH] selftests/mm: fix FORCE_READ to read input value correctly.

2025-08-05 Thread Zi Yan
typed pointer. Almost no access violation was found, except the one from split_huge_page_test. Fix it by implementing a simplified READ_ONCE() instead. Fixes: 3f6bfd4789a0 ("selftests/mm: reuse FORCE_READ to replace "asm volatile("" : "+r" (XXX));"") Signed-off

Re: [PATCH v6] selftests/mm: add process_madvise() tests

2025-07-22 Thread Zi Yan
On 21 Jul 2025, at 7:46, wang lian wrote: > Add tests for process_madvise(), focusing on verifying behavior under > various conditions including valid usage and error cases. > > Signed-off-by: wang lian > Suggested-by: Lorenzo Stoakes > Suggested-by: David Hildenbrand >

Re: [PATCH] mm: Replace (20 - PAGE_SHIFT) with common macros for pages<->MB conversion

2025-07-18 Thread Zi Yan
y: Ye Liu > --- > include/linux/mm.h| 9 + > kernel/rcu/rcuscale.c | 2 +- > kernel/sched/fair.c | 5 ++--- > mm/backing-dev.c | 2 +- > mm/huge_memory.c | 2 +- > mm/swap.c | 2 +- > 6 files changed, 15 insertions(+), 7 deletions(-) > Thanks. Acked-by: Zi Yan -- Best Regards, Yan, Zi

Re: [PATCH] selftests/mm: fix split_huge_page_test for folio_split() tests.

2025-07-11 Thread Zi Yan
On 11 Jul 2025, at 9:29, David Hildenbrand wrote: > On 09.07.25 03:27, Zi Yan wrote: >> PID_FMT does not have an offset field, so folio_split() tests are not >> performed. Add PID_FMT_OFFSET with an offset field and use it to perform >> folio_split() tests. >> >>

Re: [PATCH v3] selftests/mm: add process_madvise() tests

2025-07-10 Thread Zi Yan
On 10 Jul 2025, at 4:42, Mark Brown wrote: > On Wed, Jul 09, 2025 at 10:46:07AM -0400, Zi Yan wrote: >> On 9 Jul 2025, at 8:32, wang lian wrote: > >>> Thanks for testing the patch and reporting this build failure. >>> I don't have an arm64 environment

Re: [PATCH v4] selftests/mm: add process_madvise() tests

2025-07-10 Thread Zi Yan
On 10 Jul 2025, at 9:42, Mark Brown wrote: > On Thu, Jul 10, 2025 at 07:22:49PM +0800, wang lian wrote: > >> Add tests for process_madvise(), focusing on verifying behavior under >> various conditions including valid usage and error cases. > >> --- a/tools/testing/selftests/mm/guard-regions.c >> +

Re: [PATCH v3] selftests/mm: add process_madvise() tests

2025-07-09 Thread Zi Yan
On 9 Jul 2025, at 8:32, wang lian wrote: > Hi Zi Yan, > Thanks for testing the patch and reporting this build failure. > I don't have an arm64 environment readily available for testing, so I > appreciate you catching this. I suspect this is caused by missing or > older user

[PATCH] selftests/mm: fix split_huge_page_test for folio_split() tests.

2025-07-08 Thread Zi Yan
PID_FMT does not have an offset field, so folio_split() tests are not performed. Add PID_FMT_OFFSET with an offset field and use it to perform folio_split() tests. Fixes: 80a5c494c89f ("selftests/mm: add tests for folio_split(), buddy allocator like split") Signed-off-by: Zi Yan

Re: [PATCH v3] selftests/mm: add process_madvise() tests

2025-07-08 Thread Zi Yan
On 3 Jul 2025, at 0:43, wang lian wrote: > Add tests for process_madvise(), focusing on verifying behavior under > various conditions including valid usage and error cases. > > Signed-off-by: wang lian > Suggested-by: Lorenzo Stoakes > Suggested-by: David Hildenbrand > Acked-by: SeongJae Park

Re: [PATCH v2 2/7] selftests/mm: Add support to test 4PB VA on PPC64

2025-07-03 Thread Zi Yan
On 3 Jul 2025, at 10:44, Dev Jain wrote: > On 03/07/25 8:11 pm, Zi Yan wrote: >> On 3 Jul 2025, at 2:06, Aboorva Devarajan wrote: >> >>> From: Donet Tom >>> >>> PowerPC64 supports a 4PB virtual address space, but this test was >>> previously l

Re: [PATCH v2 7/7] selftests/mm: Skip hugepage-mremap test if userfaultfd unavailable

2025-07-03 Thread Zi Yan
break; > > Note that we have in tools/testing/selftests/mm/config > > CONFIG_USERFAULTFD=y I added the same fix to guard-regions.c since I did not know the config file existed. And from git history, I learnt that I could use the command below to merge these config to my local config: “./scripts/kconfig/merge_config.sh .config tools/testing/selftests/xxx/config” Reviewed-by: Zi Yan Best Regards, Yan, Zi

Re: [PATCH v2 6/7] selftests/mm: Skip thuge-gen if shmmax is too small or no 1G huge pages

2025-07-03 Thread Zi Yan
29 thuge-gen ~ SKIP > > Signed-off-by: Aboorva Devarajan > --- > tools/testing/selftests/mm/thuge-gen.c | 11 +++ > 1 file changed, 7 insertions(+), 4 deletions(-) > Reviewed-by: Zi Yan Best Regards, Yan, Zi

Re: [PATCH v2 2/7] selftests/mm: Add support to test 4PB VA on PPC64

2025-07-03 Thread Zi Yan
code to say PowerPC64 also supports 4PB virtual address space? >From the comment, arm64 supports 4PB but its NR_CHUNKS_HIGH is only 3840TB, whereas PowerPC64 here can get to 3968TB. I do not know why arm64’s 4PB is smaller. ;) Otherwise, the patch looks good to me. Reviewed-by: Zi Yan Best Regards, Yan, Zi

Re: [PATCH v2 1/7] mm/selftests: Fix incorrect pointer being passed to mark_range()

2025-07-03 Thread Zi Yan
} > hchunks = i; It looks like it was a copy-paste error. Thank you for fixing it. Reviewed-by: Zi Yan Best Regards, Yan, Zi

Re: [PATCH v2 4/7] mm/selftests: Fix split_huge_page_test failure on systems with 64KB page size

2025-07-03 Thread Zi Yan
t; split_thp_in_pagecache_to_order_at(fd_size, fs_loc, i, -1); > > - for (i = 0; i < 9; i++) > + for (i = 0; i < max_order; i++) > for (offset = 0; >offset < pmd_pagesize / pagesize; >offset += MAX(pmd_pagesize / pagesize / 4, 1 << i)) With the change to get_order() proposed by David and ksft_set_plan() simplification, Reviewed-by: Zi Yan Best Regards, Yan, Zi

Re: [PATCH v2 4/7] mm/selftests: Fix split_huge_page_test failure on systems with 64KB page size

2025-07-03 Thread Zi Yan
On 3 Jul 2025, at 4:58, Donet Tom wrote: > On 7/3/25 1:52 PM, David Hildenbrand wrote: >> On 03.07.25 08:06, Aboorva Devarajan wrote: >>> From: Donet Tom >>> >>> The split_huge_page_test fails on systems with a 64KB base page size. >>> This is because the order of a 2MB huge page is different: >>

Re: [PATCH 2/2] selftests: mm: add shmem collpase as a default test item

2025-06-12 Thread Zi Yan
/testing/selftests/mm/run_vmtests.sh | 4 > 1 file changed, 4 insertions(+) > Acked-by: Zi Yan Best Regards, Yan, Zi

Re: [PATCH 1/2] selftests: khugepaged: fix the shmem collapse failure

2025-06-12 Thread Zi Yan
, > usleep(TICK); > } > > - madvise(p, nr_hpages * hpage_pmd_size, MADV_NOHUGEPAGE); > - > return timeout == -1; > } > I assume you are going to just remove this madvise based on your discussion with David. With that, feel free to add Reviewed-by: Zi Yan Thanks. Best Regards, Yan, Zi

[PATCH v2 2/2] selftests/mm: skip hugevm test if kernel config file is not present.

2025-05-16 Thread Zi Yan
When running hugevm tests in a machine without kernel config present, e.g., a VM running a kernel without CONFIG_IKCONFIG_PROC nor /boot/config-*, skip hugevm tests, which reads kernel config to get page table level information. Signed-off-by: Zi Yan Acked-by: Lorenzo Stoakes --- .../selftests

[PATCH v2 1/2] selftests/mm: skip guard_regions.uffd tests when uffd is not present.

2025-05-16 Thread Zi Yan
When userfaultfd is not compiled into kernel, userfaultfd() returns -1, causing guard_regions.uffd tests to fail. Skip the tests instead. Signed-off-by: Zi Yan Reviewed-by: Lorenzo Stoakes Reviewed-by: Pedro Falcato --- tools/testing/selftests/mm/guard-regions.c | 17 +++-- 1 file

[PATCH v2 0/2] Skip mm selftests instead when kernel features are not present

2025-05-16 Thread Zi Yan
Two guard_regions tests on userfaultfd fail when userfaultfd is not present. Skip them instead. hugevm test reads kernel config to get page table level information and fails when neither /proc/config.gz nor /boot/config-* is present. Skip it instead. Zi Yan (2): selftests/mm: skip

Re: [PATCH 1/2] selftests/mm: skip uffd tests in madv_guard if uffd is not present.

2025-05-15 Thread Zi Yan
On 15 May 2025, at 14:49, Lorenzo Stoakes wrote: > On Thu, May 15, 2025 at 02:46:41PM -0400, Zi Yan wrote: >> On 15 May 2025, at 14:41, Lorenzo Stoakes wrote: >> >>> Ah you got to this first :) thanks! >>> >>> Could you do this with a cover letter thoug

Re: [PATCH 1/2] selftests/mm: skip uffd tests in madv_guard if uffd is not present.

2025-05-15 Thread Zi Yan
n overview, thanks! > > On Thu, May 15, 2025 at 02:23:32PM -0400, Zi Yan wrote: >> When userfaultfd is not compiled into kernel, userfaultfd() returns -1, >> causing uffd tests in madv_guard fail. Skip the tests instead. > > 'madv_guard'? I'd just say the guard_re

[PATCH 2/2] selftests/mm: skip hugevm test if kernel config file is not present.

2025-05-15 Thread Zi Yan
When running hugevm tests in a machine without kernel config present, e.g., a VM running a kernel without CONFIG_IKCONFIG_PROC nor /boot/config-*, skip hugevm tests, which reads kernel config to get page table level information. Signed-off-by: Zi Yan --- .../selftests/mm/va_high_addr_switch.sh

[PATCH 1/2] selftests/mm: skip uffd tests in madv_guard if uffd is not present.

2025-05-15 Thread Zi Yan
When userfaultfd is not compiled into kernel, userfaultfd() returns -1, causing uffd tests in madv_guard fail. Skip the tests instead. Signed-off-by: Zi Yan --- tools/testing/selftests/mm/guard-regions.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH v1 1/2] mm/memory_hotplug: PG_offline_skippable for offlining memory blocks with PageOffline pages

2025-05-14 Thread Zi Yan
On 14 May 2025, at 15:51, David Hildenbrand wrote: > Thanks a bucnh for the review! > >>> + >>> + if (PageOffline(page) && PageOfflineSkippable(page)) >>> + continue; >>> + >> >> Some comment like "Skippable PageOffline() pages are not migratable but are >> skipped duri

Re: [PATCH v1 1/2] mm/memory_hotplug: PG_offline_skippable for offlining memory blocks with PageOffline pages

2025-05-14 Thread Zi Yan
e pages for memory offlining. >*/ > - if ((flags & MEMORY_OFFLINE) && PageOffline(page)) > + if ((flags & MEMORY_OFFLINE) && PageOffline(page) && > + PageOfflineSkippable(page)) > continue; With this change, we are no longer give non-virtio-mem driver a chance to decrease PageOffline(page) refcount? Or virtio-mem is the only driver doing this? > > if (__PageMovable(page) || PageLRU(page)) > @@ -577,11 +572,11 @@ __test_page_isolated_in_pageblock(unsigned long pfn, > unsigned long end_pfn, > /* A HWPoisoned page cannot be also PageBuddy */ > pfn++; > else if ((flags & MEMORY_OFFLINE) && PageOffline(page) && > - !page_count(page)) > + PageOfflineSkippable(page)) The same question as above. > /* > - * The responsible driver agreed to skip PageOffline() > - * pages when offlining memory by dropping its > - * reference in MEM_GOING_OFFLINE. > + * If the page is a skippable PageOffline() page, > + * we can offline the memory block, as the driver will > + * re-discover them when re-onlining the memory. >*/ > pfn++; > else > -- > 2.49.0 Otherwise, LGTM. Acked-by: Zi Yan -- Best Regards, Yan, Zi

Re: [PATCH v1 0/2] mm/memory_hotplug: introduce and use PG_offline_skippable

2025-05-14 Thread Zi Yan
On 14 May 2025, at 13:28, David Hildenbrand wrote: >>> >>> Note that PageOffline() is a bit confusing because it's "Memory block >>> online but page is logically offline (e.g., has a memmap that can be >>> touched, but the page content should not be touched)". >> >> So PageOffline() is before me

Re: [PATCH v1 0/2] mm/memory_hotplug: introduce and use PG_offline_skippable

2025-05-14 Thread Zi Yan
On 14 May 2025, at 10:12, David Hildenbrand wrote: > On 14.05.25 15:45, Zi Yan wrote: >> On 14 May 2025, at 7:15, David Hildenbrand wrote: >> >>> This is a requirement for making PageOffline pages not have a refcount >>> in the long future ("frozen"),

Re: [PATCH v1 0/2] mm/memory_hotplug: introduce and use PG_offline_skippable

2025-05-14 Thread Zi Yan
car Salvador > Cc: Vlastimil Babka > Cc: Suren Baghdasaryan > Cc: Michal Hocko > Cc: Brendan Jackman > Cc: Johannes Weiner > Cc: Zi Yan > Cc: "Matthew Wilcox (Oracle)" > > David Hildenbrand (2): > mm/memory_hotplug: PG_offline_skippable for off

Re: [PATCH v10 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-15 Thread Zi Yan
On 10 Mar 2025, at 12:14, Zi Yan wrote: > On 7 Mar 2025, at 12:39, Zi Yan wrote: > >> This is a preparation patch, both added functions are not used yet. >> >> The added __split_unmapped_folio() is able to split a folio with its >> mapping removed in two manners:

Re: [PATCH v9 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-15 Thread Zi Yan
On 10 Mar 2025, at 4:54, Hugh Dickins wrote: > On Thu, 6 Mar 2025, Zi Yan wrote: >> On 5 Mar 2025, at 17:38, Hugh Dickins wrote: >>> On Wed, 5 Mar 2025, Zi Yan wrote: >>>> On 5 Mar 2025, at 16:03, Hugh Dickins wrote: >>>>> >>>>> Beyon

Re: [PATCH v10 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-13 Thread Zi Yan
On 10 Mar 2025, at 13:32, Zi Yan wrote: > On 10 Mar 2025, at 12:14, Zi Yan wrote: > >> On 7 Mar 2025, at 12:39, Zi Yan wrote: >> >>> This is a preparation patch, both added functions are not used yet. >>> >>> The added __split_unmapped_folio() is able

Re: [PATCH v10 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-11 Thread Zi Yan
On 10 Mar 2025, at 13:00, Matthew Wilcox wrote: > On Mon, Mar 10, 2025 at 12:42:06PM -0400, Zi Yan wrote: >>> Because of the “Careful” comment. But new_folio->* should be fine, >>> since it is the same as new_head. So I probably can replace all >>> new

Re: [PATCH v10 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-11 Thread Zi Yan
On 10 Mar 2025, at 12:39, Zi Yan wrote: > On 10 Mar 2025, at 12:30, Matthew Wilcox wrote: > >> On Fri, Mar 07, 2025 at 12:39:55PM -0500, Zi Yan wrote: >>> + for (index = new_nr_pages; index < nr_pages; index += new_nr_pages) { >>> +

[PATCH] mm/huge_memory: drop beyond-EOF folios with the right number of refs.

2025-03-11 Thread Zi Yan
f-f9a7-2853b5318...@google.com/ Cc: sta...@vger.kernel.org Signed-off-by: Zi Yan --- mm/huge_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 3d3ebdc002d5..373781b21e5c 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3304,7 +

Re: [PATCH v10 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-11 Thread Zi Yan
On 10 Mar 2025, at 12:30, Matthew Wilcox wrote: > On Fri, Mar 07, 2025 at 12:39:55PM -0500, Zi Yan wrote: >> +for (index = new_nr_pages; index < nr_pages; index += new_nr_pages) { >> +struct page *head = &folio->page; >> +struc

Re: [PATCH v10 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-10 Thread Zi Yan
On 7 Mar 2025, at 12:39, Zi Yan wrote: > This is a preparation patch, both added functions are not used yet. > > The added __split_unmapped_folio() is able to split a folio with its > mapping removed in two manners: 1) uniform split (the existing way), and > 2) buddy allocat

[PATCH v10 5/8] mm/huge_memory: remove the old, unused __split_huge_page()

2025-03-07 Thread Zi Yan
Now split_huge_page_to_list_to_order() uses the new backend split code in __split_unmapped_folio(), the old __split_huge_page() and __split_huge_page_tail() can be removed. Signed-off-by: Zi Yan Cc: Baolin Wang Cc: David Hildenbrand Cc: Hugh Dickins Cc: John Hubbard Cc: Kefeng Wang Cc

[PATCH v10 4/8] mm/huge_memory: add buddy allocator like (non-uniform) folio_split()

2025-03-07 Thread Zi Yan
outside __folio_split() in the following commit. Signed-off-by: Zi Yan Cc: Baolin Wang Cc: David Hildenbrand Cc: Hugh Dickins Cc: John Hubbard Cc: Kefeng Wang Cc: Kirill A. Shuemov Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Ryan Roberts Cc: Yang Shi Cc: Yu Zhao Cc: Kairui Song --- mm

[PATCH v10 8/8] selftests/mm: add tests for folio_split(), buddy allocator like split

2025-03-07 Thread Zi Yan
It splits page cache folios to orders from 0 to 8 at different in-folio offset. Signed-off-by: Zi Yan Cc: Baolin Wang Cc: David Hildenbrand Cc: Hugh Dickins Cc: John Hubbard Cc: Kefeng Wang Cc: Kirill A. Shuemov Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Ryan Roberts Cc: Yang Shi Cc: Yu

[PATCH v10 7/8] mm/truncate: use folio_split() in truncate operation

2025-03-07 Thread Zi Yan
-...@nvidia.com Signed-off-by: Zi Yan Cc: Baolin Wang Cc: David Hildenbrand Cc: Hugh Dickins Cc: John Hubbard Cc: Kefeng Wang Cc: Kirill A. Shuemov Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Ryan Roberts Cc: Yang Shi Cc: Yu Zhao Cc: Kairui Song Signed-off-by: Andrew Morton --- include

[PATCH v10 6/8] mm/huge_memory: add folio_split() to debugfs testing interface

2025-03-07 Thread Zi Yan
This allows to test folio_split() by specifying an additional in folio page offset parameter to split_huge_page debugfs interface. Signed-off-by: Zi Yan Cc: Baolin Wang Cc: David Hildenbrand Cc: Hugh Dickins Cc: John Hubbard Cc: Kefeng Wang Cc: Kirill A. Shuemov Cc: Matthew Wilcox Cc

[PATCH v10 3/8] mm/huge_memory: move folio split common code to __folio_split()

2025-03-07 Thread Zi Yan
-off-by: Zi Yan Cc: Baolin Wang Cc: David Hildenbrand Cc: Hugh Dickins Cc: John Hubbard Cc: Kefeng Wang Cc: Kirill A. Shuemov Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Ryan Roberts Cc: Yang Shi Cc: Yu Zhao Cc: Kairui Song --- mm/huge_memory.c | 112

[PATCH v10 2/8] mm/huge_memory: add two new (not yet used) functions for folio_split()

2025-03-07 Thread Zi Yan
given page to one lower order. Signed-off-by: Zi Yan Cc: Baolin Wang Cc: David Hildenbrand Cc: Hugh Dickins Cc: John Hubbard Cc: Kefeng Wang Cc: Kirill A. Shuemov Cc: Matthew Wilcox Cc: Miaohe Lin Cc: Ryan Roberts Cc: Yang Shi Cc: Yu Zhao Cc: Kairui Song --- mm/huge_memory.c | 348

[PATCH v10 1/8] xarray: add xas_try_split() to split a multi-index entry

2025-03-07 Thread Zi Yan
| --- Signed-off-by: Zi Yan Cc: Baolin Wang Cc: David Hildenbrand Cc: Hugh Dickins Cc: John Hubbard Cc: Kefeng Wang Cc: Kirill A. Shuemov Cc: Miaohe Lin Cc: Matthew Wilcox Cc: Ryan Roberts Cc: Yang Shi Cc: Yu Zhao Cc: Zi Yan Cc: Kairui Song --- Documentation/core-api/xarray.rst | 14

[PATCH v10 0/8] Buddy allocator like (or non-uniform) folio split

2025-03-07 Thread Zi Yan
/ [12] https://lore.kernel.org/linux-mm/d45d4f01-e5a5-47e6-8724-01610cc19...@nvidia.com/ [13] https://lore.kernel.org/linux-mm/20250226210032.2044041-1-...@nvidia.com/ [14] https://lore.kernel.org/linux-mm/2fae27fe-6e2e-3587-4b68-072118d80...@google.com/ [15] https://lore.kernel.org/all/202503031630

  1   2   3   4   5   6   7   8   >