selftests/mm: remove PROT_EXEC req from file-collapse tests
Subsystems (4)
PATCH 1/1 selftests/mm: remove PROT_EXEC req from file-collapse tests
As of v6.8 commit 7fbb5e188248 ("mm: remove VM_EXEC requirement for THP eligibility") thp collapse no longer requires file-backed mappings be created with PROT_EXEC.
Remove the overly-strict dependency from thp collapse tests so we test the least-strict requirement for success.
--- tools/testing/selftests/mm/khugepaged.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/mm/khugepaged.c +1 -1
@@ -394,7 +394,7 @@ static void *file_setup_area(int nr_hpages)perror ("open()" );exit (EXIT_FAILURE ); } - p =mmap (BASE_ADDR , size,PROT_READ |PROT_EXEC , + p =mmap (BASE_ADDR , size,PROT_READ ,MAP_PRIVATE , finfo.fd,0 );if (p ==MAP_FAILED || p !=BASE_ADDR ) {perror ("mmap()" );
Signature · 1 line
2.51.0.384.g4c02a37b29-goog
Quoted 9 lines · Zach O'Keefe
As of v6.8 commit
7fbb5e188248("mm: removeVM_EXECrequirement for THP eligibility") thp collapse no longer requires file-backed mappings be created withPROT_EXEC.Remove the overly-strict dependency from thp collapse tests so we test the least-strict requirement for success.
Signed-off-by Zach O'Keefe <[email protected]>---
LGTM.
Quoted 16 lines
tools/testing/selftests/mm/khugepaged.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/mm/khugepaged.c +1
-1@@ -394,7 +394,7 @@ static void *file_setup_area(int nr_hpages)perror ("open()" );exit (EXIT_FAILURE ); } - p =mmap (BASE_ADDR , size,PROT_READ |PROT_EXEC , + p =mmap (BASE_ADDR , size,PROT_READ ,MAP_PRIVATE , finfo.fd,0 );if (p ==MAP_FAILED || p !=BASE_ADDR ) {perror ("mmap()" );
Quoted 8 lines · Zach O'Keefe
As of v6.8 commit
7fbb5e188248("mm: removeVM_EXECrequirement for THP eligibility") thp collapse no longer requires file-backed mappings be created withPROT_EXEC.Remove the overly-strict dependency from thp collapse tests so we test the least-strict requirement for success.
Signed-off-by Zach O'Keefe <[email protected]>
LGTM
Quoted 17 lines · Zach O'Keefe
As of v6.8 commit
7fbb5e188248("mm: removeVM_EXECrequirement for THP eligibility") thp collapse no longer requires file-backed mappings be created withPROT_EXEC.Remove the overly-strict dependency from thp collapse tests so we test the least-strict requirement for success.
Signed-off-by Zach O'Keefe <[email protected]>--- tools/testing/selftests/mm/khugepaged.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/mm/khugepaged.c +0
-0
tools/testing/selftests/mm/khugepaged.c static void *file_setup_area(int nr_hpages) · line 400
Quoted 8 lines
tools/testing/selftests/mm/khugepaged.c +1
-1@@ -394,7 +394,7 @@ static void *file_setup_area(int nr_hpages)perror ("open()" );exit (EXIT_FAILURE ); } - p =mmap (BASE_ADDR , size,PROT_READ |PROT_EXEC , + p =mmap (BASE_ADDR , size,PROT_READ ,MAP_PRIVATE , finfo.fd,0 );if (p ==MAP_FAILED || p !=BASE_ADDR ) {perror ("mmap()" );
Signature · 3 lines
Cheers David / dhildenb
Quoted 4 lines · Zach O'Keefe
As of v6.8 commit
7fbb5e188248("mm: removeVM_EXECrequirement for THP eligibility") thp collapse no longer requires file-backed mappings be created withPROT_EXEC.
One question, what if user run this new version test on old kernel?
Is there a guideline for user?
Quoted 24 lines
Remove the overly-strict dependency from thp collapse tests so we test the least-strict requirement for success.
Signed-off-by Zach O'Keefe <[email protected]>---
tools/testing/selftests/mm/khugepaged.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/mm/khugepaged.c +1
-1@@ -394,7 +394,7 @@ static void *file_setup_area(int nr_hpages)perror ("open()" );exit (EXIT_FAILURE ); } - p =mmap (BASE_ADDR , size,PROT_READ |PROT_EXEC , + p =mmap (BASE_ADDR , size,PROT_READ ,MAP_PRIVATE , finfo.fd,0 );if (p ==MAP_FAILED || p !=BASE_ADDR ) {perror ("mmap()" );Signature · 1 line
2.51.0.384.g4c02a37b29-goog
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 9 lines · Wei Yang
Quoted 4 lines · Zach O'Keefe
As of v6.8 commit
7fbb5e188248("mm: removeVM_EXECrequirement for THP eligibility") thp collapse no longer requires file-backed mappings be created withPROT_EXEC.One question, what if user run this new version test on old kernel?
Is there a guideline for user?
We try to keep some older kernel working as long as it is easy, so people have to do less manual work of filtering out false positives if they happen to run these tests on older kernels.
6.8 was from end 2023, not sure if we still care about that.
Signature · 3 lines
Cheers David / dhildenb