tools/testing: add linux/args.h header and fix radix, VMA testsCommit 857d18f23ab1 ("cleanup: Introduce ACQUIRE() and ACQUIRE_ERR() forconditional locks") accidentally broke the radix tree, VMA us
tools/testing: add linux/args.h header and fix radix, VMA testsCommit 857d18f23ab1 ("cleanup: Introduce ACQUIRE() and ACQUIRE_ERR() forconditional locks") accidentally broke the radix tree, VMA userland testsby including linux/args.h which is not present in the tools/includedirectory.This patch copies this over and adds an #ifdef block to avoid duplicate__CONCAT declaration in conflict with system headers when we ultimatelyinclude this.Link: https://lkml.kernel.org/r/20250811052654.33286-1-lorenzo.stoakes@oracle.comFixes: 857d18f23ab1 ("cleanup: Introduce ACQUIRE() and ACQUIRE_ERR() for conditional locks") Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>Cc: Jann Horn <jannh@google.com>Cc: John Hubbard <jhubbard@nvidia.com>Cc: Liam Howlett <liam.howlett@oracle.com>Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>Cc: Vlastimil Babka <vbabka@suse.cz>Cc: Dan Williams <dan.j.williams@intel.com>Cc: Peter Zijlstra <peterz@infradead.org>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
show more ...
test suite: use %zu to print size_tOn 32-bit, we can't use %lu to print a size_t variable and gcc warns usabout it. Shame it doesn't warn about it on 64-bit.Link: https://lkml.kernel.org/r/2025
test suite: use %zu to print size_tOn 32-bit, we can't use %lu to print a size_t variable and gcc warns usabout it. Shame it doesn't warn about it on 64-bit.Link: https://lkml.kernel.org/r/20250403003311.359917-1-Liam.Howlett@oracle.comFixes: cc86e0c2f306 ("radix tree test suite: add support for slab bulk APIs")Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
radix-tree: add missing cleanup.hAdd shared cleanup.h header for radix-tree testing tools.Fixes build error found with kdevops [1]:cc -I../shared -I. -I../../include -I../../../lib -g -Og -Wall
radix-tree: add missing cleanup.hAdd shared cleanup.h header for radix-tree testing tools.Fixes build error found with kdevops [1]:cc -I../shared -I. -I../../include -I../../../lib -g -Og -Wall-D_LGPL_SOURCE -fsanitize=address -fsanitize=undefined -c -oradix-tree.o radix-tree.cIn file included from ../shared/linux/idr.h:1, from radix-tree.c:18:../shared/linux/../../../../include/linux/idr.h:18:10: fatal error:linux/cleanup.h: No such file or directory 18 | #include <linux/cleanup.h> | ^~~~~~~~~~~~~~~~~compilation terminated.make: *** [<builtin>: radix-tree.o] Error 1[1] https://github.com/linux-kdevops/kdevopshttps://github.com/linux-kdevops/linux-mm-kpd/actions/runs/13971648496/job/39114756401[akpm@linux-foundation.org: remove unneeded header guards, per Sidhartha]Link: https://lkml.kernel.org/r/20250321-fix-radix-tree-build-v1-1-838a1e6540e2@samsung.comFixes: 6c8b0b835f00 ("perf/core: Simplify perf_pmu_register()")Signed-off-by: Daniel Gomez <da.gomez@samsung.com>Cc: Daniel Gomez <da.gomez@samsung.com>Cc: Ingo Molnar <mingo@kernel.org>Cc: Liam Howlett <liam.howlett@oracle.com>Cc: Luis Chamberalin <mcgrof@kernel.org>Cc: Matthew Wilcox (Oracle) <willy@infradead.org>Cc: Ravi Bangoria <ravi.bangoria@amd.com>Cc: Peter Zijlstra <peterz@infradead.org>Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/rbtree: enable userland test suite for rbtree related data structurePatch series "lib/interval_tree: add some test cases and cleanup", v2.Since rbtree/augmented tree/interval tree share simil
lib/rbtree: enable userland test suite for rbtree related data structurePatch series "lib/interval_tree: add some test cases and cleanup", v2.Since rbtree/augmented tree/interval tree share similar data structure,besides new cases for interval tree, this patch set also does cleanup forothers.This patch (of 7):Currently we have some tests for rbtree related data structure, e.g. rbtree, augmented rbtree, interval tree, in lib/ as kernel module.To facilitate the test and debug for those fundamental data structure,this patch enable those tests in userland.Link: https://lkml.kernel.org/r/20250310074938.26756-1-richard.weiyang@gmail.comLink: https://lkml.kernel.org/r/20250310074938.26756-2-richard.weiyang@gmail.comSigned-off-by: Wei Yang <richard.weiyang@gmail.com>Cc: Matthew Wilcox <willy@infradead.org>Cc: Michel Lespinasse <michel@lespinasse.org>Cc: Jason Gunthorpe <jgg@nvidia.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools: fix atomic_set() definition to set the value correctlyCurrently vma test is failing because of the new vma_assert_attached()assertion. The check is failing because previous refcount_set()
tools: fix atomic_set() definition to set the value correctlyCurrently vma test is failing because of the new vma_assert_attached()assertion. The check is failing because previous refcount_set() insidevma_mark_attached() is a NoOp. Fix the definition of atomic_set() tocorrectly set the value of the atomic.Link: https://lkml.kernel.org/r/20241227222220.1726384-1-surenb@google.comFixes: 9325b8b5a1cb ("tools: add skeleton code for userland testing of VMA logic")Signed-off-by: Suren Baghdasaryan <surenb@google.com>Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>Cc: Jann Horn <jannh@google.com>Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>Cc: Vlastimil Babka <vbabka@suse.cz>Cc: <stable@vger.kernel.org>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Merge tag 'mm-nonmm-stable-2024-11-24-02-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mmPull non-MM updates from Andrew Morton: - The series "resource: A couple of cleanups" from And
Merge tag 'mm-nonmm-stable-2024-11-24-02-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mmPull non-MM updates from Andrew Morton: - The series "resource: A couple of cleanups" from Andy Shevchenko performs some cleanups in the resource management code - The series "Improve the copy of task comm" from Yafang Shao addresses possible race-induced overflows in the management of task_struct.comm[] - The series "Remove unnecessary header includes from {tools/}lib/list_sort.c" from Kuan-Wei Chiu adds some cleanups and a small fix to the list_sort library code and to its selftest - The series "Enhance min heap API with non-inline functions and optimizations" also from Kuan-Wei Chiu optimizes and cleans up the min_heap library code - The series "nilfs2: Finish folio conversion" from Ryusuke Konishi finishes off nilfs2's folioification - The series "add detect count for hung tasks" from Lance Yang adds more userspace visibility into the hung-task detector's activity - Apart from that, singelton patches in many places - please see the individual changelogs for details* tag 'mm-nonmm-stable-2024-11-24-02-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (71 commits) gdb: lx-symbols: do not error out on monolithic build kernel/reboot: replace sprintf() with sysfs_emit() lib: util_macros_kunit: add kunit test for util_macros.h util_macros.h: fix/rework find_closest() macros Improve consistency of '#error' directive messages ocfs2: fix uninitialized value in ocfs2_file_read_iter() hung_task: add docs for hung_task_detect_count hung_task: add detect count for hung tasks dma-buf: use atomic64_inc_return() in dma_buf_getfile() fs/proc/kcore.c: fix coccinelle reported ERROR instances resource: avoid unnecessary resource tree walking in __region_intersects() ocfs2: remove unused errmsg function and table ocfs2: cluster: fix a typo lib/scatterlist: use sg_phys() helper checkpatch: always parse orig_commit in fixes tag nilfs2: convert metadata aops from writepage to writepages nilfs2: convert nilfs_recovery_copy_block() to take a folio nilfs2: convert nilfs_page_count_clean_buffers() to take a folio nilfs2: remove nilfs_writepage nilfs2: convert checkpoint file to be folio-based ...
tools: testing: fix phys_addr_t size on 64-bit systemsThe phys_addr_t size is predicated on whether CONFIG_PHYS_ADDR_T_64BIT isset or not.In the VMA tests, virt_to_phys() from tools/include/linu
tools: testing: fix phys_addr_t size on 64-bit systemsThe phys_addr_t size is predicated on whether CONFIG_PHYS_ADDR_T_64BIT isset or not.In the VMA tests, virt_to_phys() from tools/include/linux casts a volatilevoid * pointer to phys_addr_t, if CONFIG_PHYS_ADDR_T_64BIT is not set,this will be 32-bit and trigger a warning.Obviously this might also lead to truncation, which we would rather avoid.Fix this by adjusting the generation of generated/bit-length.h to generatea CONFIG_PHYS_ADDR_T{bits}BIT define.This does result in the generation of the useless CONFIG_PHYS_ADDR_T_32BITdefine for 32-bit systems, but this should have no effect, and makesimplementation of this easier.This resolves the issue and the warning.[lorenzo.stoakes@oracle.com: VMA tests not properly importing bit-length.h] Link: https://lkml.kernel.org/r/a6183df9-3108-4d59-8128-4fc6c14e22a5@lucifer.localLink: https://lkml.kernel.org/r/20241017165638.95602-1-lorenzo.stoakes@oracle.comSigned-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>Tested-by: Liam R. Howlett <Liam.Howlett@Oracle.com>Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>Cc: Jann Horn <jannh@google.com>Cc: Vlastimil Babka <vbabka@suse.cz>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools: fix -Wunused-result in linux.cFix the following -Wunused-result warnings on posix_memalign()return values and add error handling../shared/linux.c:100:25: warning: ignoring return value of
tools: fix -Wunused-result in linux.cFix the following -Wunused-result warnings on posix_memalign()return values and add error handling../shared/linux.c:100:25: warning: ignoring return value of `posix_memalign' declared with attribute `warn_unused_result' [-Wunused-result] 100 | posix_memalign(&p, cachep->align, cachep->size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~../shared/linux.c: In function `kmem_cache_alloc_bulk':../shared/linux.c:198:33: warning: ignoring return value of `posix_memalign' declared with attribute `warn_unused_result' [-Wunused-result] 198 | posix_memalign(&p[i], cachep->align, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 199 | cachep->size); | ~~~~~~~~~~~~~Link: https://lkml.kernel.org/r/20241011225155.27607-1-skhan@linuxfoundation.orgSigned-off-by: Shuah Khan <skhan@linuxfoundation.org>Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>Cc: Vlastimil Babka <vbabka@suse.cz>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Merge tag 'mm-hotfixes-stable-2024-09-27-09-45' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mmPull misc fixes from Andrew Morton: "19 hotfixes. 13 are cc:stable. There's a focus on
Merge tag 'mm-hotfixes-stable-2024-09-27-09-45' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mmPull misc fixes from Andrew Morton: "19 hotfixes. 13 are cc:stable. There's a focus on fixes for the memfd_pin_folios() work which was added into 6.11. Apart from that, the usual shower of singleton fixes"* tag 'mm-hotfixes-stable-2024-09-27-09-45' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: ocfs2: fix uninit-value in ocfs2_get_block() zram: don't free statically defined names memory tiers: use default_dram_perf_ref_source in log message Revert "list: test: fix tests for list_cut_position()" kselftests: mm: fix wrong __NR_userfaultfd value compiler.h: specify correct attribute for .rodata..c_jump_table mm/damon/Kconfig: update DAMON doc URL mm: kfence: fix elapsed time for allocated/freed track ocfs2: fix deadlock in ocfs2_get_system_file_inode ocfs2: reserve space for inline xattr before attaching reflink tree mm: migrate: annotate data-race in migrate_folio_unmap() mm/hugetlb: simplify refs in memfd_alloc_folio mm/gup: fix memfd_pin_folios alloc race panic mm/gup: fix memfd_pin_folios hugetlb page allocation mm/hugetlb: fix memfd_pin_folios resv_huge_pages leak mm/hugetlb: fix memfd_pin_folios free_huge_pages leak mm/filemap: fix filemap_get_folios_contig THP panic mm: make SPLIT_PTE_PTLOCKS depend on SMP tools: fix shared radix-tree build
tools: fix shared radix-tree buildThe shared radix-tree build is not correctly recompiling whenlib/maple_tree.c and lib/test_maple_tree.c are modified - fix this byadding these core components to
tools: fix shared radix-tree buildThe shared radix-tree build is not correctly recompiling whenlib/maple_tree.c and lib/test_maple_tree.c are modified - fix this byadding these core components to the SHARED_DEPS list.Additionally, add missing header guards to shared header files.Link: https://lkml.kernel.org/r/20240924180724.112169-1-lorenzo.stoakes@oracle.comFixes: 74579d8dab47 ("tools: separate out shared radix-tree components")Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>Tested-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>Cc: Matthew Wilcox <willy@infradead.org>Cc: Vlastimil Babka <vbabka@suse.cz>Cc: <stable@vger.kernel.org>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Merge tag 'memblock-v6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblockPull memblock updates from Mike Rapoport: - new memblock_estimated_nr_free_pages() helper to replace
Merge tag 'memblock-v6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblockPull memblock updates from Mike Rapoport: - new memblock_estimated_nr_free_pages() helper to replace totalram_pages() which is less accurate when CONFIG_DEFERRED_STRUCT_PAGE_INIT is set - fixes for memblock tests* tag 'memblock-v6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: s390/mm: get estimated free pages by memblock api kernel/fork.c: get estimated free pages by memblock api mm/memblock: introduce a new helper memblock_estimated_nr_free_pages() memblock test: fix implicit declaration of function 'strscpy' memblock test: fix implicit declaration of function 'isspace' memblock test: fix implicit declaration of function 'memparse' memblock test: add the definition of __setup() memblock test: fix implicit declaration of function 'virt_to_phys' tools/testing: abstract two init.h into common include directory memblock tests: include export.h in linkage.h as kernel dose memblock tests: include memory_hotplug.h in mmzone.h as kernel dose
maple_tree: add test to replicate low memory race conditionsAdd new callback fields to the userspace implementation of structkmem_cache. This allows for executing callback functions in order tof
maple_tree: add test to replicate low memory race conditionsAdd new callback fields to the userspace implementation of structkmem_cache. This allows for executing callback functions in order tofurther test low memory scenarios where node allocation is retried.This callback can help test race conditions by calling a function when alow memory event is tested.Link: https://lkml.kernel.org/r/20240812190543.71967-2-sidhartha.kumar@oracle.comSigned-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>Cc: Matthew Wilcox <willy@infradead.org>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools: separate out shared radix-tree componentsThe core components contained within the radix-tree tests which provideshims for kernel headers and access to the maple tree are useful fortesting
tools: separate out shared radix-tree componentsThe core components contained within the radix-tree tests which provideshims for kernel headers and access to the maple tree are useful fortesting other things, so separate them out and make the radix tree testsdependent on the shared components.This lays the groundwork for us to add VMA tests of the newly introducedvma.c file.Link: https://lkml.kernel.org/r/1ee720c265808168e0d75608e687607d77c36719.1722251717.git.lorenzo.stoakes@oracle.comSigned-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>Acked-by: Vlastimil Babka <vbabka@suse.cz>Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>Cc: Alexander Viro <viro@zeniv.linux.org.uk>Cc: Brendan Higgins <brendanhiggins@google.com>Cc: Christian Brauner <brauner@kernel.org>Cc: David Gow <davidgow@google.com>Cc: Eric W. Biederman <ebiederm@xmission.com>Cc: Jan Kara <jack@suse.cz>Cc: Kees Cook <kees@kernel.org>Cc: Matthew Wilcox (Oracle) <willy@infradead.org>Cc: Rae Moar <rmoar@google.com>Cc: SeongJae Park <sj@kernel.org>Cc: Shuah Khan <shuah@kernel.org>Cc: Suren Baghdasaryan <surenb@google.com>Cc: Pengfei Xu <pengfei.xu@intel.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>