linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 RESEND 0/2] selftests/mm: reuse FORCE_READ to replace "asm volatile("" : "+r" (XXX));" and some cleanup
@ 2025-07-17 13:18 wang lian
  2025-07-17 13:18 ` [PATCH 1/2] selftests/mm: reuse FORCE_READ to replace "asm volatile("" : "+r" (XXX));" wang lian
  2025-07-17 13:18 ` [PATCH 2/2] selftests/mm: guard-regions: Use SKIP() instead of ksft_exit_skip() wang lian
  0 siblings, 2 replies; 14+ messages in thread
From: wang lian @ 2025-07-17 13:18 UTC (permalink / raw)
  To: akpm, broonie, david, lorenzo.stoakes, sj, ziy, linux-mm,
	linux-kernel
  Cc: brauner, gkwang, jannh, Liam.Howlett, lianux.mm, ludovico.zy.wu,
	p1ucky0923, richard.weiyang, ryncsn, shuah, vbabka, zijing.zhang

This series introduces a common FORCE_READ() macro to replace 
the cryptic asm volatile("" : "+r" (variable)); 
construct used in several mm selftests. This improves code readability and 
maintainability by removing duplicated, hard-to-understand code.

I previously sent the refactoring patch [1] as a standalone change, following a suggestion from David. 
As Andrew Morton and Wei Yang correctly pointed out, 
that patch was incomplete as it was missing the macro definition itself, 
causing build warnings. My apologies for the noise.

[1] https://lore.kernel.org/lkml/20250716123126.3851-1-lianux.mm@gmail.com/

This v2 series corrects that mistake by properly structuring the changes:
- The first patch introduces the FORCE_READ() macro into the shared vm_util.h header 
  and reuse this new macro to refactor the selftests.
- The second patch guard-regions: Use SKIP() instead of ksft_exit_skip().

changes to v2:
- collected Acked-by and Reviewed-by from  David and Lorenzo Stoakes.


wang lian (2):
  selftests/mm: reuse FORCE_READ to replace "asm volatile("" : "+r"
    (XXX));"
  selftests/mm: guard-regions: Use SKIP() instead of ksft_exit_skip()

 tools/testing/selftests/mm/cow.c              | 30 +++++++++----------
 tools/testing/selftests/mm/guard-regions.c    |  9 +-----
 tools/testing/selftests/mm/hugetlb-madvise.c  |  5 +---
 tools/testing/selftests/mm/migration.c        | 13 ++++----
 tools/testing/selftests/mm/pagemap_ioctl.c    |  4 +--
 .../selftests/mm/split_huge_page_test.c       |  4 +--
 tools/testing/selftests/mm/vm_util.h          |  7 +++++
 7 files changed, 32 insertions(+), 40 deletions(-)
-- 
2.43.0



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-08-07 12:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-17 13:18 [PATCH v2 RESEND 0/2] selftests/mm: reuse FORCE_READ to replace "asm volatile("" : "+r" (XXX));" and some cleanup wang lian
2025-07-17 13:18 ` [PATCH 1/2] selftests/mm: reuse FORCE_READ to replace "asm volatile("" : "+r" (XXX));" wang lian
2025-07-17 14:49   ` David Hildenbrand
2025-07-21 11:49     ` wang lian
2025-07-18  0:08   ` Wei Yang
2025-07-21 11:51     ` wang lian
2025-07-18 15:11   ` Zi Yan
2025-08-05 14:26   ` Zi Yan
2025-08-07 12:16     ` David Laight
2025-08-07 12:21       ` Zi Yan
2025-07-17 13:18 ` [PATCH 2/2] selftests/mm: guard-regions: Use SKIP() instead of ksft_exit_skip() wang lian
2025-07-17 14:17   ` Mark Brown
2025-07-18  0:13   ` Wei Yang
2025-07-18 15:11   ` Zi Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).