Re: [PATCH v1 1/3] selftests/mm: Fix half_ufd_size_MB calculation

2025-03-18 Thread Ryan Roberts
On 18/03/2025 19:54, Peter Xu wrote: > On Tue, Mar 18, 2025 at 05:43:39PM +0000, Ryan Roberts wrote: >> $half_ufd_size_MB is supposed to be half of the available hugetlb memory >> expressed in MB. But previously it was calculated in pages since >> $freepgs is the number of f

[PATCH v1 1/3] selftests/mm: Fix half_ufd_size_MB calculation

2025-03-18 Thread Ryan Roberts
ugetlb mem size calculation") Signed-off-by: Ryan Roberts --- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index da7e26668103..14fa9d40d574 100

[PATCH v1 3/3] selftests/mm: Speed up split_huge_page_test

2025-03-18 Thread Ryan Roberts
ge size because MAX_PAGECACHE_ORDER is too small for 512M folio size (I think). Signed-off-by: Ryan Roberts --- tools/testing/selftests/mm/split_huge_page_test.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testi

[PATCH v1 2/3] selftests/mm: uffd-unit-tests support for hugepages > 2M

2025-03-18 Thread Ryan Roberts
nr_pages=0 for 64K base pages. This doesn't end well. So let's make the 32M size a floor and also ensure that we have at least 2 pages given the PMD size. With this change, the tests pass on arm64 64K base page size configuration. Signed-off-by: Ryan Roberts --- tools/testing/selftests/mm

Re: [PATCH v1] selftests/mm: Set allocated memory to non-zero content in cow test

2025-01-08 Thread Ryan Roberts
On 08/01/2025 04:56, Andrew Morton wrote: > On Tue, 7 Jan 2025 14:25:53 +0000 Ryan Roberts wrote: > >> After commit b1f202060afe ("mm: remap unused subpages to shared zeropage >> when splitting isolated thp"), cow test cases involving swapping out >> THPs via m

Re: [PATCH v1] selftests/mm: static process_madvise() wrapper for guard-pages

2025-01-07 Thread Ryan Roberts
On 07/01/2025 14:48, Lorenzo Stoakes wrote: > On Tue, Jan 07, 2025 at 02:29:35PM +0000, Ryan Roberts wrote: >> The recently introduced guard-pages mm selftest uses the >> process_madvise() syscall, a wrapper for which was added to glibc v2.36. >> For those of us stuck with old

[PATCH v1] selftests/mm: static process_madvise() wrapper for guard-pages

2025-01-07 Thread Ryan Roberts
have the wrapper. To workaround the issue, let's introduce our own static process_madvise() wrapper that uses glibc's syscall() helper. While we are at it, add the guard-page test suite to run_vmtests.sh so that it can be automatically run by CI systems. Signed-off-by: Ryan Roberts ---

[PATCH v1] selftests/mm: Set allocated memory to non-zero content in cow test

2025-01-07 Thread Ryan Roberts
d replaces the pages which are wholly zero with the zero page. These cow test cases were getting caught up in this. So let's avoid that by filling the contents of all allocated memory with a non-zero value. With this in place, the tests are passing again. Signed-off-by: Ryan Roberts --- Ap

Re: [PATCH] selftests/mm: Skip test for non-LPA2 and non-LVA systems

2024-07-17 Thread Ryan Roberts
On 17/07/2024 13:11, Dev Jain wrote: > > On 7/17/24 17:27, Ryan Roberts wrote: >> On 17/07/2024 12:10, Dev Jain wrote: >>> Post my improvement of the test: >>> https://lore.kernel.org/all/20240522070435.773918-3-dev.j...@arm.com/ >>> The test begins t

Re: [PATCH] selftests/mm: Skip test for non-LPA2 and non-LVA systems

2024-07-17 Thread Ryan Roberts
On 17/07/2024 12:10, Dev Jain wrote: > Post my improvement of the test: > https://lore.kernel.org/all/20240522070435.773918-3-dev.j...@arm.com/ > The test begins to fail on 4k and 16k pages, on non-LPA2 systems. To > reduce noise in the CI systems, let us skip the test when higher address > space i

Re: [RFC PATCH] selftests: introduce and use SELFTESTS_CC_IS_CLANG instead of LLVM

2024-07-04 Thread Ryan Roberts
On 04/07/2024 04:04, John Hubbard wrote: > Current practice in the selftests Makefiles is to use $(LLVM) as a way > to decide if clang is being used as the compiler (and/or the linker > front end). Unfortunately, this does not cover all of the use cases: > > 1) CC could have been set within selfte

Re: [PATCH] selftests/mm: Introduce a test program to assess swap entry allocation for thp_swapout

2024-06-21 Thread Ryan Roberts
On 21/06/2024 08:47, Barry Song wrote: > On Fri, Jun 21, 2024 at 7:25 PM Ryan Roberts wrote: >> >> On 20/06/2024 12:34, David Hildenbrand wrote: >>> On 20.06.24 11:04, Ryan Roberts wrote: >>>> On 20/06/2024 01:26, Barry Song wrote: >>>>> From: Ba

Re: [PATCH] selftests/mm: Introduce a test program to assess swap entry allocation for thp_swapout

2024-06-21 Thread Ryan Roberts
On 21/06/2024 00:34, Chris Li wrote: >> + * thp_swap_allocator_test >> + * >> + * The purpose of this test program is helping check if THP swpout >> + * can correctly get swap slots to swap out as a whole instead of >> + * being split. It randomly releases swap entries through madvise >> + * DONTN

Re: [PATCH] selftests/mm: Introduce a test program to assess swap entry allocation for thp_swapout

2024-06-21 Thread Ryan Roberts
On 20/06/2024 12:34, David Hildenbrand wrote: > On 20.06.24 11:04, Ryan Roberts wrote: >> On 20/06/2024 01:26, Barry Song wrote: >>> From: Barry Song >>> >>> Both Ryan and Chris have been utilizing the small test program to aid >>> in debugging and

Re: [PATCH] selftests/mm: Introduce a test program to assess swap entry allocation for thp_swapout

2024-06-20 Thread Ryan Roberts
On 20/06/2024 01:26, Barry Song wrote: > From: Barry Song > > Both Ryan and Chris have been utilizing the small test program to aid > in debugging and identifying issues with swap entry allocation. While > a real or intricate workload might be more suitable for assessing the > correctness and eff

Re: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds

2024-06-07 Thread Ryan Roberts
On 04/06/2024 05:55, John Hubbard wrote: > On 6/3/24 3:47 PM, Nathan Chancellor wrote: >> On Mon, Jun 03, 2024 at 04:32:30PM +0100, Mark Brown wrote: >>> On Fri, May 31, 2024 at 11:37:50AM -0700, John Hubbard wrote: The kselftests may be built in a couple different ways: make LLVM=1

Re: [PATCH] selftests: mm: Make map_fixed_noreplace test names stable

2024-06-07 Thread Ryan Roberts
ing. > > Fixes: 4838cf70e539 ("selftests/mm: map_fixed_noreplace: conform test to TAP > format output") > Signed-off-by: Mark Brown Reviewed-by: Ryan Roberts > --- > tools/testing/selftests/mm/map_fixed_noreplace.c | 24 > > 1 file changed,

Re: [PATCH 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-05-11 Thread Ryan Roberts
On 10/05/2024 19:22, John Hubbard wrote: > On 5/10/24 10:56 AM, John Hubbard wrote: >> On 5/10/24 4:52 AM, Ryan Roberts wrote: >>> On 04/05/2024 05:43, John Hubbard wrote: >> ... >>> It just occured to me that the bug report I was fixing with my attempt was &g

Re: [PATCH 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-05-10 Thread Ryan Roberts
selftests/lib.mk facilities for tracking local header > file dependencies: add them to LOCAL_HDRS, leaving only the .c files to > be passed to the compiler. > > Cc: Ryan Roberts > Signed-off-by: John Hubbard > --- > tools/testing/selftests/openat2/Makefile | 14

Re: [PATCH v2] selftests/mqueue: fix 5 warnings about signed/unsigned mismatches

2024-05-09 Thread Ryan Roberts
ument name to test->func(), in order to address another > warning from clang. > > Cc: Ryan Roberts > Signed-off-by: John Hubbard Reviewed-by: Ryan Roberts > --- > tools/testing/selftests/mqueue/mq_perf_tests.c | 15 --- > 1 file changed, 8 inserti

Re: [PATCH] selftests/mqueue: fix 5 warnings about signed/unsigned mismatches

2024-05-08 Thread Ryan Roberts
On 07/05/2024 18:04, John Hubbard wrote: > On 5/7/24 12:54 AM, Ryan Roberts wrote: >> On 05/05/2024 23:13, John Hubbard wrote: > ... >>> diff --git a/tools/testing/selftests/mqueue/mq_perf_tests.c >>> b/tools/testing/selftests/mqueue/mq_perf_tests.c >>>

Re: [PATCH 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-05-07 Thread Ryan Roberts
On 07/05/2024 17:47, John Hubbard wrote: > On 5/7/24 9:34 AM, Ryan Roberts wrote: >> On 07/05/2024 17:19, John Hubbard wrote: >>> On 5/7/24 12:45 AM, Ryan Roberts wrote: >>>> On 04/05/2024 05:43, John Hubbard wrote: >>> ... >>>> Hi John, >&

Re: [PATCH 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-05-07 Thread Ryan Roberts
On 07/05/2024 17:19, John Hubbard wrote: > On 5/7/24 12:45 AM, Ryan Roberts wrote: >> On 04/05/2024 05:43, John Hubbard wrote: > ... >> Hi John, >> >> I sent out a similar fix a couple of weeks ago, see [1]. I don't think it got >> picked up thoug

Re: [PATCH] selftests/mqueue: fix 5 warnings about signed/unsigned mismatches

2024-05-07 Thread Ryan Roberts
On 05/05/2024 23:13, John Hubbard wrote: > When building with clang, via: > > make LLVM=1 -C tools/testing/selftest > > ...clang warns about several cases of using a signed integer for the > priority argument to mq_receive(3), which expects an unsigned int. > > Fix this by declaring the type

Re: [PATCH 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-05-07 Thread Ryan Roberts
selftests/lib.mk facilities for tracking local header > file dependencies: add them to LOCAL_HDRS, leaving only the .c files to > be passed to the compiler. > > Cc: Ryan Roberts > Signed-off-by: John Hubbard Hi John, I sent out a similar fix a couple of weeks ago, see [1]. I

Re: [PATCH v1 1/1] selftest mm/mseal: fix arm build

2024-05-03 Thread Ryan Roberts
On 02/05/2024 23:53, jef...@chromium.org wrote: > From: Jeff Xu > > add include linux/mman.h to fix arm build > fix a typo > > Signed-off-by: Jeff Xu > Suggested-by: Ryan Roberts I confirm this has fixed our issue. Thanks! Tested-by: Ryan Roberts Reviewed-by: Ryan Rob

Re: [PATCH v10 3/5] selftest mm/mseal memory sealing

2024-05-03 Thread Ryan Roberts
On 02/05/2024 23:39, Jeff Xu wrote: > On Thu, May 2, 2024 at 4:24 AM Ryan Roberts wrote: >> >> On 15/04/2024 17:35, jef...@chromium.org wrote: >>> From: Jeff Xu >>> >>> selftest for memory sealing change in mmap() and mseal(). >>> >>>

Re: [PATCH v10 3/5] selftest mm/mseal memory sealing

2024-05-02 Thread Ryan Roberts
On 15/04/2024 17:35, jef...@chromium.org wrote: > From: Jeff Xu > > selftest for memory sealing change in mmap() and mseal(). > > Signed-off-by: Jeff Xu > --- > tools/testing/selftests/mm/.gitignore |1 + > tools/testing/selftests/mm/Makefile |1 + > tools/testing/selftests/mm/ms

[PATCH v1] selftests/mm: soft-dirty should fail if a testcase fails

2024-04-24 Thread Ryan Roberts
Previously soft-dirty was unconditionally exiting with success, even if one of it's testcases failed. Let's fix that so that failure can be reported to automated systems properly. Reviewed-by: Muhammad Usama Anjum Reviewed-by: David Hildenbrand Signed-off-by: Ryan Roberts --- Appl

Re: [PATCH v1 5/5] selftests/mm: soft-dirty should fail if a testcase fails

2024-04-24 Thread Ryan Roberts
On 23/04/2024 09:44, Muhammad Usama Anjum wrote: > On 4/23/24 1:24 PM, Ryan Roberts wrote: >> On 22/04/2024 10:33, David Hildenbrand wrote: >>> On 19.04.24 09:43, Ryan Roberts wrote: >>>> Previously soft-dirty was unconditionally exiting with success, even if >

Re: [PATCH v1 0/5] arm64/mm: uffd write-protect and soft-dirty tracking

2024-04-24 Thread Ryan Roberts
On 23/04/2024 22:02, David Hildenbrand wrote: >>> >>> Shivansh, do you speak for CRIU? Are you able to comment on whether CRIU >>> supports checkpointing an app that uses uffd? >> >> I do not speak for CRIU - I'm just a user (and hopefully a future >> contributor), but not a maintainer or owner. I

Re: [PATCH v1 0/5] arm64/mm: uffd write-protect and soft-dirty tracking

2024-04-23 Thread Ryan Roberts
On 19/04/2024 18:12, David Hildenbrand wrote: > On 19.04.24 18:30, Mike Rapoport wrote: >> On Fri, Apr 19, 2024 at 11:45:14AM +0200, David Hildenbrand wrote: >>> On 19.04.24 10:33, Shivansh Vij wrote: >>>>> On 19/04/2024 08:43, Ryan Roberts wrote: >>>>&

Re: [PATCH v1 5/5] selftests/mm: soft-dirty should fail if a testcase fails

2024-04-23 Thread Ryan Roberts
On 22/04/2024 10:33, David Hildenbrand wrote: > On 19.04.24 09:43, Ryan Roberts wrote: >> Previously soft-dirty was unconditionally exiting with success, even if >> one of it's testcases failed. Let's fix that so that failure can be >> reported to automated system

Re: [PATCH v1 0/5] arm64/mm: uffd write-protect and soft-dirty tracking

2024-04-19 Thread Ryan Roberts
On 19/04/2024 08:43, Ryan Roberts wrote: > Hi All, > > This series adds uffd write-protect and soft-dirty tracking support for > arm64. I > consider the soft-dirty support (patches 3 and 4) as RFC - see rationale > below. > > Previous attempts to add these features

[PATCH v1 5/5] selftests/mm: soft-dirty should fail if a testcase fails

2024-04-19 Thread Ryan Roberts
Previously soft-dirty was unconditionally exiting with success, even if one of it's testcases failed. Let's fix that so that failure can be reported to automated systems properly. Signed-off-by: Ryan Roberts --- tools/testing/selftests/mm/soft-dirty.c | 2 +- 1 file changed, 1 inser

[PATCH v1 2/5] arm64/mm: Add uffd write-protect support

2024-04-19 Thread Ryan Roberts
Let's use the newly-free PTE SW bit (58) to add support for uffd-wp. The standard handlers are implemented for set/test/clear for both pte and pmd. Additionally we must also track the uffd-wp state as a pte swp bit, so use a free swap entry pte bit (3). Signed-off-by: Ryan Roberts ---

[RFC PATCH v1 4/5] selftests/mm: Enable soft-dirty tests on arm64

2024-04-19 Thread Ryan Roberts
Now that arm64 supports soft-dirty tracking lets enable the tests, which were previously disabled for arm64 to reduce noise. This reverts commit f6dd4e223d87 ("selftests/mm: skip soft-dirty tests on arm64"). Signed-off-by: Ryan Roberts --- tools/testing/selftests/mm/Makefile

[RFC PATCH v1 3/5] arm64/mm: Add soft-dirty page tracking support

2024-04-19 Thread Ryan Roberts
t for live migration. Link: https://lore.kernel.org/linux-arm-kernel/mw4pr12mb687563efb56373e8d55ddeabb9...@mw4pr12mb6875.namprd12.prod.outlook.com/ Signed-off-by: Ryan Roberts --- arch/arm64/Kconfig| 1 + arch/arm64/include/asm/pgtable-prot.h | 8 + arch/arm64/includ

[PATCH v1 1/5] arm64/mm: Move PTE_PROT_NONE and PMD_PRESENT_INVALID

2024-04-19 Thread Ryan Roberts
x27;s move PMD_PRESENT_INVALID to bit 60. In the end, this frees up bit 58 for future use as a proper SW bit (e.g. soft-dirty or uffd-wp). Signed-off-by: Ryan Roberts --- arch/arm64/include/asm/pgtable-prot.h | 4 ++-- arch/arm64/include/asm/pgtable.h | 16 +--- 2 files changed, 11 insert

[PATCH v1 0/5] arm64/mm: uffd write-protect and soft-dirty tracking

2024-04-19 Thread Ryan Roberts
.@mw4pr12mb6875.namprd12.prod.outlook.com/ Thanks, Ryan Ryan Roberts (5): arm64/mm: Move PTE_PROT_NONE and PMD_PRESENT_INVALID arm64/mm: Add uffd write-protect support arm64/mm: Add soft-dirty page tracking support selftests/mm: Enable soft-dirty tests on arm64 selftests/mm: soft-di

[PATCH] selftests: Fix asan linkage to work with clang

2024-04-17 Thread Ryan Roberts
s: link libasan statically for tests with -fsanitize=address") Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202404141807.lgsqxpy5-...@intel.com/ Suggested-by: Arnd Bergmann Signed-off-by: Ryan Roberts --- Applies on v6.9-rc4. Thanks, Ryan tools/testing/selftests/fc

Re: [PATCH v5 8/8] mm: huge_memory: enable debugfs to split huge pages to any order.

2024-03-01 Thread Ryan Roberts
On 01/03/2024 14:00, Zi Yan wrote: > On 1 Mar 2024, at 4:51, Aishwarya TCV wrote: > >> On 26/02/2024 20:55, Zi Yan wrote: >>> From: Zi Yan >>> >>> It is used to test split_huge_page_to_list_to_order for pagecache THPs. >>> Also add test cases for split_huge_page_to_list_to_order via both >>> debu

Re: [PATCH v5 8/8] mm: huge_memory: enable debugfs to split huge pages to any order.

2024-03-01 Thread Ryan Roberts
On 01/03/2024 13:53, Zi Yan wrote: > On 1 Mar 2024, at 8:09, Ryan Roberts wrote: > >> On 01/03/2024 12:52, Zi Yan wrote: >>> On 1 Mar 2024, at 5:33, Ryan Roberts wrote: >>> >>>> On 01/03/2024 09:51, Aishwarya TCV wrote: >>>>> >>&

Re: [PATCH v5 8/8] mm: huge_memory: enable debugfs to split huge pages to any order.

2024-03-01 Thread Ryan Roberts
On 01/03/2024 12:52, Zi Yan wrote: > On 1 Mar 2024, at 5:33, Ryan Roberts wrote: > >> On 01/03/2024 09:51, Aishwarya TCV wrote: >>> >>> >>> On 26/02/2024 20:55, Zi Yan wrote: >>>> From: Zi Yan >>>> >>>> It is used to t

Re: [PATCH v5 8/8] mm: huge_memory: enable debugfs to split huge pages to any order.

2024-03-01 Thread Ryan Roberts
On 01/03/2024 09:51, Aishwarya TCV wrote: > > > On 26/02/2024 20:55, Zi Yan wrote: >> From: Zi Yan >> >> It is used to test split_huge_page_to_list_to_order for pagecache THPs. >> Also add test cases for split_huge_page_to_list_to_order via both >> debugfs. >> >> Signed-off-by: Zi Yan >> --- >>

Re: [PATCH v5 7/8] mm: thp: split huge page to any lower order pages

2024-02-28 Thread Ryan Roberts
On 28/02/2024 15:42, Zi Yan wrote: > On 28 Feb 2024, at 3:23, Ryan Roberts wrote: > >> Hi Zi, >> >> >> On 26/02/2024 20:55, Zi Yan wrote: >>> From: Zi Yan >>> >>> To split a THP to any lower order pages, we need to reform THPs on >>&

Re: [PATCH v5 7/8] mm: thp: split huge page to any lower order pages

2024-02-28 Thread Ryan Roberts
Hi Zi, On 26/02/2024 20:55, Zi Yan wrote: > From: Zi Yan > > To split a THP to any lower order pages, we need to reform THPs on > subpages at given order and add page refcount based on the new page > order. Also we need to reinitialize page_deferred_list after removing > the page from the split

Re: [PATCH v2 09/12] selftests/mm: thp_settings: conform to TAP format output

2024-02-14 Thread Ryan Roberts
On 14/02/2024 17:19, Ryan Roberts wrote: > On 02/02/2024 11:31, Muhammad Usama Anjum wrote: >> Conform the layout, informational and status messages to TAP. No >> functional change is intended other than the layout of output messages. >> >> Signed-off-by: Muhammad Us

Re: [PATCH v2 09/12] selftests/mm: thp_settings: conform to TAP format output

2024-02-14 Thread Ryan Roberts
On 02/02/2024 11:31, Muhammad Usama Anjum wrote: > Conform the layout, informational and status messages to TAP. No > functional change is intended other than the layout of output messages. > > Signed-off-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/khugepaged.c | 3 +- > tool

Re: [PATCH v4 5/7] mm: thp: split huge page to any lower order pages (except order-1).

2024-02-14 Thread Ryan Roberts
On 14/02/2024 16:28, Zi Yan wrote: > On 14 Feb 2024, at 11:22, Ryan Roberts wrote: > >> On 14/02/2024 16:11, Zi Yan wrote: >>> On 14 Feb 2024, at 5:38, Ryan Roberts wrote: >>> >>>> On 13/02/2024 21:55, Zi Yan wrote: >>>>> From: Zi Yan >

Re: [PATCH v4 6/7] mm: truncate: split huge page cache page to a non-zero order if possible.

2024-02-14 Thread Ryan Roberts
On 14/02/2024 16:19, Zi Yan wrote: > On 14 Feb 2024, at 5:43, Ryan Roberts wrote: > >> On 13/02/2024 21:55, Zi Yan wrote: >>> From: Zi Yan >>> >>> To minimize the number of pages after a huge page truncation, we do not >>> need to split it all th

Re: [PATCH v4 5/7] mm: thp: split huge page to any lower order pages (except order-1).

2024-02-14 Thread Ryan Roberts
On 14/02/2024 16:11, Zi Yan wrote: > On 14 Feb 2024, at 5:38, Ryan Roberts wrote: > >> On 13/02/2024 21:55, Zi Yan wrote: >>> From: Zi Yan >>> >>> To split a THP to any lower order (except order-1) pages, we need to >>> reform THPs on subpages a

Re: [PATCH v4 0/7] Split a folio to any lower order folios

2024-02-14 Thread Ryan Roberts
On 13/02/2024 22:31, Zi Yan wrote: > On 13 Feb 2024, at 17:21, David Hildenbrand wrote: > >> On 13.02.24 22:55, Zi Yan wrote: >>> From: Zi Yan >>> >>> Hi all, >>> >>> File folio supports any order and multi-size THP is upstreamed[1], so both >>> file and anonymous folios can be >0 order. Currentl

Re: [PATCH v4 6/7] mm: truncate: split huge page cache page to a non-zero order if possible.

2024-02-14 Thread Ryan Roberts
On 13/02/2024 21:55, Zi Yan wrote: > From: Zi Yan > > To minimize the number of pages after a huge page truncation, we do not > need to split it all the way down to order-0. The huge page has at most > three parts, the part before offset, the part to be truncated, the part > remaining at the end.

Re: [PATCH v4 5/7] mm: thp: split huge page to any lower order pages (except order-1).

2024-02-14 Thread Ryan Roberts
On 13/02/2024 21:55, Zi Yan wrote: > From: Zi Yan > > To split a THP to any lower order (except order-1) pages, we need to > reform THPs on subpages at given order and add page refcount based on the > new page order. Also we need to reinitialize page_deferred_list after > removing the page from t

Re: [PATCH] selftests/mm: Don't needlessly use sudo to obtain root in run_vmtests.sh

2024-02-14 Thread Ryan Roberts
On 12/02/2024 19:13, Mark Brown wrote: > On Mon, Feb 12, 2024 at 08:32:58AM +0000, Ryan Roberts wrote: >> On 10/02/2024 12:35, Mark Brown wrote: > >>> Ah, I was assuming that some of the suite ran usefully as non-root given >>> that the only point of that sudo was

Re: [PATCH] selftests/mm: Don't needlessly use sudo to obtain root in run_vmtests.sh

2024-02-12 Thread Ryan Roberts
On 10/02/2024 12:35, Mark Brown wrote: > On Sat, Feb 10, 2024 at 07:40:16AM +0000, Ryan Roberts wrote: >> On 09/02/2024 20:21, Mark Brown wrote: > >>> When opening yama/ptrace_scope we unconditionally use sudo to ensure we >>> are running as root, resulting in fa

Re: [PATCH] selftests/mm: Don't needlessly use sudo to obtain root in run_vmtests.sh

2024-02-09 Thread Ryan Roberts
On 09/02/2024 20:21, Mark Brown wrote: > When opening yama/ptrace_scope we unconditionally use sudo to ensure we > are running as root, resulting in failures if running in a minimal root > filesystem where sudo is not installed. Since automated test systems will > typically just run all of kselftes

Re: [PATCH v3 2/5] selftests/mm: run_vmtests: remove sudo and conform to tap

2024-02-01 Thread Ryan Roberts
On 01/02/2024 12:24, Muhammad Usama Anjum wrote: > On 2/1/24 5:04 PM, Ryan Roberts wrote: >> On 25/01/2024 15:46, Muhammad Usama Anjum wrote: >>> Remove sudo as some test running environments may not have sudo >>> available. Instead skip the test if root privileges aren&

Re: [PATCH v3 5/5] selftests/mm: run_vmtests.sh: add missing tests

2024-02-01 Thread Ryan Roberts
On 25/01/2024 15:46, Muhammad Usama Anjum wrote: > Add missing tests to run_vmtests.sh. The mm kselftests are run through > run_vmtests.sh. If a test isn't present in this script, it'll not run > with run_tests or `make -C tools/testing/selftests/mm run_tests`. > > Cc: R

Re: [PATCH v3 2/5] selftests/mm: run_vmtests: remove sudo and conform to tap

2024-02-01 Thread Ryan Roberts
On 25/01/2024 15:46, Muhammad Usama Anjum wrote: > Remove sudo as some test running environments may not have sudo > available. Instead skip the test if root privileges aren't available in > the test. > > Signed-off-by: Muhammad Usama Anjum > --- > Changes since v1: > - Added this patch in v2 >

Re: [PATCH v2 1/2] selftests/mm: run_vmtests.sh: add missing tests

2024-01-23 Thread Ryan Roberts
On 23/01/2024 07:36, Muhammad Usama Anjum wrote: > Add missing tests to run_vmtests.sh. The mm kselftests are run through > run_vmtests.sh. If a test isn't present in this script, it'll not run > with run_tests or `make -C tools/testing/selftests/mm run_tests`. > > Cc: R

Re: [PATCH] selftests/mm: run_vmtests.sh: add missing tests

2024-01-23 Thread Ryan Roberts
On 23/01/2024 07:51, Muhammad Usama Anjum wrote: > On 1/22/24 2:59 PM, Ryan Roberts wrote: >>>>> +CATEGORY="hugetlb" run_test ./hugetlb-read-hwpoison >>>> >>>> The addition of this test causes 2 later tests to fail with ENOMEM. I >>&g

[PATCH v1] selftests/mm: ksm_tests should only MADV_HUGEPAGE valid memory

2024-01-22 Thread Ryan Roberts
es merging time test") Cc: sta...@vger.kernel.org Signed-off-by: Ryan Roberts --- Applies on top of mm-unstable. Thanks, Ryan tools/testing/selftests/mm/ksm_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/ksm_tests.c b/tools/

Re: [PATCH] selftests/mm: run_vmtests.sh: add missing tests

2024-01-22 Thread Ryan Roberts
On 22/01/2024 08:46, Muhammad Usama Anjum wrote: > On 1/19/24 9:09 PM, Ryan Roberts wrote: >> Hi Muhammad, >> >> Afraid this patch is causing a regression on our CI system when it turned up >> in >> linux-next today. Additionally, 2 of thetests you have add

Re: [PATCH] selftests/mm: run_vmtests.sh: add missing tests

2024-01-19 Thread Ryan Roberts
Hi Muhammad, Afraid this patch is causing a regression on our CI system when it turned up in linux-next today. Additionally, 2 of thetests you have added are failing because the scripts are not exported correctly... On 16/01/2024 09:06, Muhammad Usama Anjum wrote: > Add missing tests to run_vmtes

Re: [PATCH v1] selftests/mm: Log run_vmtests.sh results in TAP format

2023-12-19 Thread Ryan Roberts
On 19/12/2023 00:55, John Hubbard wrote: > On 12/18/23 16:51, John Hubbard wrote: >> On 12/18/23 03:32, Ryan Roberts wrote: >> ... >>>> I should also point out that some of the subtests already attempt a TAP >>>> output. So now we end up with TAP-within-TAP

Re: [PATCH v1] selftests/mm: Log run_vmtests.sh results in TAP format

2023-12-18 Thread Ryan Roberts
On 16/12/2023 02:40, John Hubbard wrote: > On 12/15/23 18:25, John Hubbard wrote: >> On 12/15/23 06:28, Ryan Roberts wrote: >> ... >>> I've kept all the existing "pretty" output and results summary as is, it >>> just >>> gets a

Re: [PATCH v1] selftests/mm: Log run_vmtests.sh results in TAP format

2023-12-15 Thread Ryan Roberts
On 15/12/2023 14:08, Mark Brown wrote: > On Fri, Dec 15, 2023 at 01:58:45PM +0000, Ryan Roberts wrote: >> On 15/12/2023 13:54, Mark Brown wrote: > >>> What I did for ftrace which had a similar situation was make a wrapper >>> script which invokes the test

Re: [PATCH v1] selftests/mm: Log run_vmtests.sh results in TAP format

2023-12-15 Thread Ryan Roberts
On 15/12/2023 13:54, Mark Brown wrote: > On Thu, Dec 14, 2023 at 04:24:34PM +0000, Ryan Roberts wrote: >> When running tests on a CI system (e.g. LAVA) it is useful to output >> test results in TAP format so that the CI can parse the fine-grained >> results to show regres

[PATCH v1] selftests/mm: Log run_vmtests.sh results in TAP format

2023-12-14 Thread Ryan Roberts
I've implemented an opt-out option (-n), which will revert to the existing output format. Future changes to this file should be aware of 2 new conventions: - output that is part of the TAP reporting is piped through tap_output - general output is piped through tap_prefix Signed-off-by: Rya

Re: [PATCH v5 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-04 Thread Ryan Roberts
On 04/12/2023 04:09, Suren Baghdasaryan wrote: > On Sat, Dec 2, 2023 at 2:11 AM David Hildenbrand wrote: >> >> On 02.12.23 09:04, Ryan Roberts wrote: >>> On 01/12/2023 20:47, David Hildenbrand wrote: >>>> On 01.12.23 10:29, Ryan Roberts wrote: >>>>

Re: [PATCH v5 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-02 Thread Ryan Roberts
On 01/12/2023 20:47, David Hildenbrand wrote: > On 01.12.23 10:29, Ryan Roberts wrote: >> On 21/11/2023 17:16, Suren Baghdasaryan wrote: >>> Add tests for new UFFDIO_MOVE ioctl which uses uffd to move source >>> into destination buffer while checking the contents of bot

Re: [PATCH v5 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-02 Thread Ryan Roberts
On 01/12/2023 16:26, Suren Baghdasaryan wrote: > On Fri, Dec 1, 2023 at 1:29 AM Ryan Roberts wrote: >> >> On 21/11/2023 17:16, Suren Baghdasaryan wrote: >>> Add tests for new UFFDIO_MOVE ioctl which uses uffd to move source >>> into destination buffer while ch

Re: [PATCH v5 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-01 Thread Ryan Roberts
On 21/11/2023 17:16, Suren Baghdasaryan wrote: > Add tests for new UFFDIO_MOVE ioctl which uses uffd to move source > into destination buffer while checking the contents of both after > the move. After the operation the content of the destination buffer > should match the original source buffer's c

Re: [PATCH v2 2/2] selftests/mm: Add a new test for madv and hugetlb

2023-11-03 Thread Ryan Roberts
On 03/11/2023 13:59, Breno Leitao wrote: > Hello Ryan, > > On Thu, Nov 02, 2023 at 12:29:54PM +0000, Ryan Roberts wrote: >> On 02/11/2023 12:24, Ryan Roberts wrote: >>> On 05/10/2023 17:39, Breno Leitao wrote: >>>> Create a selftest that exercises the race

Re: [PATCH v2 2/2] selftests/mm: Add a new test for madv and hugetlb

2023-11-02 Thread Ryan Roberts
On 02/11/2023 12:24, Ryan Roberts wrote: > Hi Breno, > > > On 05/10/2023 17:39, Breno Leitao wrote: >> Create a selftest that exercises the race between page faults and >> madvise(MADV_DONTNEED) in the same huge page. Do it by running two >> threads that tou

Re: [PATCH v2 2/2] selftests/mm: Add a new test for madv and hugetlb

2023-11-02 Thread Ryan Roberts
Hi Breno, On 05/10/2023 17:39, Breno Leitao wrote: > Create a selftest that exercises the race between page faults and > madvise(MADV_DONTNEED) in the same huge page. Do it by running two > threads that touches the huge page and madvise(MADV_DONTNEED) at the same > time. > > In case of a SIGBUS

Re: [PATCH v33 6/6] selftests: mm: add pagemap ioctl tests

2023-11-02 Thread Ryan Roberts
On 02/11/2023 11:49, Muhammad Usama Anjum wrote: > On 11/2/23 4:45 PM, Ryan Roberts wrote: >> On 21/08/2023 15:15, Muhammad Usama Anjum wrote: >> >> [...] >> >>> + >>> + >>> +int init_uffd(void) >>> +{ >>> + struct uffdio_

Re: [PATCH v33 6/6] selftests: mm: add pagemap ioctl tests

2023-11-02 Thread Ryan Roberts
On 21/08/2023 15:15, Muhammad Usama Anjum wrote: [...] > + > + > +int init_uffd(void) > +{ > + struct uffdio_api uffdio_api; > + > + uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK | > UFFD_USER_MODE_ONLY); > + if (uffd == -1) > + ksft_exit_fail_msg("uffd syscall

Re: [PATCH v4 8/8] selftests/mm: add uffd unit test for UFFDIO_POISON

2023-09-21 Thread Ryan Roberts
On 07/07/2023 22:55, Axel Rasmussen wrote: > The test is pretty basic, and exercises UFFDIO_POISON straightforwardly. > We register a region with userfaultfd, in missing fault mode. For each > fault, we either UFFDIO_COPY a zeroed page (odd pages) or UFFDIO_POISON > (even pages). We do this mix to

Re: [linus:master] [selftests] 58e2847ad2: kernel-selftests.openat2.resolve_test.fail

2023-09-12 Thread Ryan Roberts
On 12/09/2023 13:16, Ryan Roberts wrote: > On 12/09/2023 07:17, kernel test robot wrote: >> >> >> Hello, >> >> kernel test robot noticed "kernel-selftests.openat2.resolve_test.fail" on: >> >> commit: 58e2847ad2e6322a25dedf8b4549ff924baf

[PATCH v1] selftests: Link libasan statically for tests with -fsanitize=address

2023-09-12 Thread Ryan Roberts
xit=1 Signed-off-by: Ryan Roberts Fixes: 58e2847ad2e6 ("selftests: line buffer test program's stdout") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202309121342.97e2f008-oliver.s...@intel.com --- tools/testing/selftests/fchmodat2/Makefile | 2 +- tools/testi

Re: [linus:master] [selftests] 58e2847ad2: kernel-selftests.openat2.resolve_test.fail

2023-09-12 Thread Ryan Roberts
On 12/09/2023 07:17, kernel test robot wrote: > > > Hello, > > kernel test robot noticed "kernel-selftests.openat2.resolve_test.fail" on: > > commit: 58e2847ad2e6322a25dedf8b4549ff924baf8395 ("selftests: line buffer > test program's stdout") > https://git.kernel.org/cgit/linux/kernel/git/torva