History log of /linux/mm/damon/tests/ (Results 1 – 25 of 54)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
dafdba0904-Dec-2025 Arnd Bergmann <arnd@arndb.de>

mm/damon/tests/core-kunit: avoid damos_test_commit stack warning

The newly added damos_test_commit() constructs multiple large structures
on the stack, which exceeds the warning limit in some cases:

mm/damon/tests/core-kunit: avoid damos_test_commit stack warning

The newly added damos_test_commit() constructs multiple large structures
on the stack, which exceeds the warning limit in some cases:

In file included from mm/damon/core.c:2941:
mm/damon/tests/core-kunit.h: In function 'damos_test_commit':
mm/damon/tests/core-kunit.h:965:1: error: the frame size of 1520 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]

Split this function up into two separate ones that are called
sequentially, so they can occupy the same stack slots.

Link: https://lkml.kernel.org/r/20251204100403.1034980-1-arnd@kernel.org
Fixes: 299a88f6ec13 ("mm/damon/tests/core-kunit: add damos_commit() test")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: Quanmin Yan <yanquanmin1@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

a9ce09b121-Nov-2025 Dan Carpenter <dan.carpenter@linaro.org>

mm/damon/tests/sysfs-kunit: fix use after free on error path

Re-order these frees to avoid dereferencing "sysfs_target" after it has
been freed.

Link: https://lkml.kernel.org/r/aSBq5uSPIqsqH8zO@sta

mm/damon/tests/sysfs-kunit: fix use after free on error path

Re-order these frees to avoid dereferencing "sysfs_target" after it has
been freed.

Link: https://lkml.kernel.org/r/aSBq5uSPIqsqH8zO@stanley.mountain
Fixes: ee131696794c ("mm/damon/tests/sysfs-kunit: handle alloc failures on damon_sysfs_test_add_targets()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...


/linux/.mailmap
/linux/Documentation/devicetree/bindings/riscv/extensions.yaml
/linux/Documentation/mm/damon/maintainer-profile.rst
/linux/Documentation/mm/memory-model.rst
/linux/MAINTAINERS
/linux/arch/powerpc/kvm/book3s_hv_uvmem.c
/linux/arch/riscv/Kconfig
/linux/arch/riscv/include/asm/hwcap.h
/linux/arch/riscv/include/asm/pgtable-bits.h
/linux/arch/riscv/include/asm/pgtable.h
/linux/arch/riscv/kernel/cpufeature.c
/linux/arch/s390/mm/gmap.c
/linux/arch/s390/mm/gmap_helpers.c
/linux/arch/s390/mm/pgtable.c
/linux/drivers/block/zram/zram_drv.c
/linux/drivers/block/zram/zram_drv.h
/linux/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
/linux/drivers/gpu/drm/drm_pagemap.c
/linux/drivers/gpu/drm/nouveau/nouveau_dmem.c
/linux/drivers/gpu/drm/nouveau/nouveau_svm.c
/linux/drivers/gpu/drm/nouveau/nouveau_svm.h
/linux/drivers/pci/p2pdma.c
/linux/fs/proc/task_mmu.c
/linux/fs/userfaultfd.c
/linux/include/asm-generic/hugetlb.h
/linux/include/asm-generic/pgtable_uffd.h
/linux/include/linux/huge_mm.h
/linux/include/linux/hugetlb.h
/linux/include/linux/leafops.h
/linux/include/linux/memcontrol.h
/linux/include/linux/memremap.h
/linux/include/linux/migrate.h
/linux/include/linux/mm.h
/linux/include/linux/mm_inline.h
/linux/include/linux/mm_types.h
/linux/include/linux/pgtable.h
/linux/include/linux/shmem_fs.h
/linux/include/linux/swapops.h
/linux/include/linux/userfaultfd_k.h
/linux/include/linux/vmstat.h
/linux/include/ras/ras_event.h
/linux/include/trace/events/huge_memory.h
/linux/include/trace/events/memory-failure.h
/linux/lib/test_hmm.c
/linux/lib/test_hmm_uapi.h
/linux/mm/Kconfig
/linux/mm/damon/ops-common.c
sysfs-kunit.h
/linux/mm/debug_vm_pgtable.c
/linux/mm/filemap.c
/linux/mm/hmm.c
/linux/mm/huge_memory.c
/linux/mm/hugetlb.c
/linux/mm/internal.h
/linux/mm/khugepaged.c
/linux/mm/ksm.c
/linux/mm/madvise.c
/linux/mm/memcontrol.c
/linux/mm/memfd.c
/linux/mm/memory-failure.c
/linux/mm/memory.c
/linux/mm/mempolicy.c
/linux/mm/memremap.c
/linux/mm/migrate.c
/linux/mm/migrate_device.c
/linux/mm/mincore.c
/linux/mm/mmap.c
/linux/mm/mmap_lock.c
/linux/mm/mprotect.c
/linux/mm/mremap.c
/linux/mm/page-writeback.c
/linux/mm/page_idle.c
/linux/mm/page_table_check.c
/linux/mm/page_vma_mapped.c
/linux/mm/pagewalk.c
/linux/mm/pgtable-generic.c
/linux/mm/rmap.c
/linux/mm/shmem.c
/linux/mm/swap_state.c
/linux/mm/swapfile.c
/linux/mm/userfaultfd.c
/linux/mm/vma.c
/linux/mm/vma_exec.c
/linux/mm/vmalloc.c
/linux/mm/vmscan.c
/linux/mm/workingset.c
/linux/tools/testing/selftests/damon/sysfs.py
/linux/tools/testing/selftests/mm/gup_test.c
/linux/tools/testing/selftests/mm/hmm-tests.c
/linux/tools/testing/selftests/mm/soft-dirty.c
/linux/tools/testing/selftests/mm/uffd-unit-tests.c
/linux/tools/testing/vma/vma_internal.h
10e8c7ba12-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: remove DAMON_MIN_REGION redefinition

A few DAMON core functions including damon_set_regions() were hard-coded
to use DAMON_MIN_REGION as their regions management granulari

mm/damon/tests/core-kunit: remove DAMON_MIN_REGION redefinition

A few DAMON core functions including damon_set_regions() were hard-coded
to use DAMON_MIN_REGION as their regions management granularity. For
simple and human-readable unit tests' expectations, DAMON core layer kunit
test re-defines DAMON_MIN_REGION to '1'.

A previous patch series [1] has removed the hard-coded part but kept the
redefinition and updated related function calls to explicitly use
DAMON_MIN_REGION. Remove the unnecessary redefinition and update relevant
function calls to pass literals (number '1') instead of the
DAMON_MIN_REGION.

Link: https://lkml.kernel.org/r/20251112154114.66053-7-sj@kernel.org
Link: https://lore.kernel.org/20250828171242.59810-1-sj@kernel.org [1]
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Bill Wendling <morbo@google.com>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

53298afe12-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon: rename damos->filters to damos->core_filters

DAMOS filters that are handled by the ops layer are linked to
damos->ops_filters. Owing to the ops_ prefix on the name, it is easy to
understa

mm/damon: rename damos->filters to damos->core_filters

DAMOS filters that are handled by the ops layer are linked to
damos->ops_filters. Owing to the ops_ prefix on the name, it is easy to
understand it is for ops layer handled filters. The other types of
filters, which are handled by the core layer, are linked to
damos->filters. Because of the name, it is easy to confuse the list is
there for not only core layer handled ones but all filters. Avoid such
confusions by renaming the field to core_filters.

Link: https://lkml.kernel.org/r/20251112154114.66053-3-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Bill Wendling <morbo@google.com>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

603f67eb11-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: add damon_commit_target_regions() test

Add a new test for damon_commit_target_regions().

Link: https://lkml.kernel.org/r/20251111184415.141757-12-sj@kernel.org
Signed-off

mm/damon/tests/core-kunit: add damon_commit_target_regions() test

Add a new test for damon_commit_target_regions().

Link: https://lkml.kernel.org/r/20251111184415.141757-12-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

299a88f611-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: add damos_commit() test

Add a new unit test for damos_commit().

Link: https://lkml.kernel.org/r/20251111184415.141757-11-sj@kernel.org
Signed-off-by: SeongJae Park <sj@ke

mm/damon/tests/core-kunit: add damos_commit() test

Add a new unit test for damos_commit().

Link: https://lkml.kernel.org/r/20251111184415.141757-11-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

eec573b811-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: add damos_commit_dests() test

Add a new unit test for damos_commit_dests().

Link: https://lkml.kernel.org/r/20251111184415.141757-10-sj@kernel.org
Signed-off-by: SeongJae

mm/damon/tests/core-kunit: add damos_commit_dests() test

Add a new unit test for damos_commit_dests().

Link: https://lkml.kernel.org/r/20251111184415.141757-10-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

11bb980d11-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: add damos_commit_quota() test

Add a new unit test for damos_commit_quota().

Link: https://lkml.kernel.org/r/20251111184415.141757-8-sj@kernel.org
Signed-off-by: SeongJae

mm/damon/tests/core-kunit: add damos_commit_quota() test

Add a new unit test for damos_commit_quota().

Link: https://lkml.kernel.org/r/20251111184415.141757-8-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

d9adfb8a11-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: add damos_commit_quota_goals() test

Add a new unit test for damos_commit_quota_goals().

Link: https://lkml.kernel.org/r/20251111184415.141757-7-sj@kernel.org
Signed-off-b

mm/damon/tests/core-kunit: add damos_commit_quota_goals() test

Add a new unit test for damos_commit_quota_goals().

Link: https://lkml.kernel.org/r/20251111184415.141757-7-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

99f89deb11-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: add damos_commit_quota_goal() test

Add a new unit test for damos_commit_quota_goal().

Link: https://lkml.kernel.org/r/20251111184415.141757-6-sj@kernel.org
Signed-off-by:

mm/damon/tests/core-kunit: add damos_commit_quota_goal() test

Add a new unit test for damos_commit_quota_goal().

Link: https://lkml.kernel.org/r/20251111184415.141757-6-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

3caf767e11-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: add test cases to damos_test_commit_filter()

damos_test_commit_filter() is covering only a single test case. Extend it
to cover multiple combinations of inputs.

Link: ht

mm/damon/tests/core-kunit: add test cases to damos_test_commit_filter()

damos_test_commit_filter() is covering only a single test case. Extend it
to cover multiple combinations of inputs.

Link: https://lkml.kernel.org/r/20251111184415.141757-5-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

1b43b79511-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: extend damos_test_commit_filter_for() for union fields

damos_commit_filter() also updates union fields of 'struct damos_filter'.
Extend damos_test_commit_filter_for() to

mm/damon/tests/core-kunit: extend damos_test_commit_filter_for() for union fields

damos_commit_filter() also updates union fields of 'struct damos_filter'.
Extend damos_test_commit_filter_for() to cover the expectations of the
union fields.

Link: https://lkml.kernel.org/r/20251111184415.141757-4-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

1968236f11-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: split out damos_test_commit_filter() core logic

damos_test_commit_filter() is written for only a single test case. Split
out the core logic of damos_test_commit_filter()

mm/damon/tests/core-kunit: split out damos_test_commit_filter() core logic

damos_test_commit_filter() is written for only a single test case. Split
out the core logic of damos_test_commit_filter() as a general one so that
it can be reused for multiple test cases.

Link: https://lkml.kernel.org/r/20251111184415.141757-3-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

3710428611-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: remove dynamic allocs on damos_test_commit_filter()

Patch series "mm/damon/tests: add more tests for online parameters commit".

A DAMON feature called parameters "commit"

mm/damon/tests/core-kunit: remove dynamic allocs on damos_test_commit_filter()

Patch series "mm/damon/tests: add more tests for online parameters commit".

A DAMON feature called parameters "commit" allows DAMON API callers and
ABI users to update nearly every DAMON parameter while DAMON is running.
This is being used for flexible DAMON use cases such as taking a snapshot
of the monitoring results with minimum overhead, or adjusting access-aware
system operations (DAMOS) for user-space driven auto-tuning or
investigations.

Compared to the usefulness of the feature and size of the implementation,
the test coverage is pretty small. Only the filter commit part has a
single test case, namely damos_test_commit_filter(). Actually, we found
and fixed a few bugs of the feature in the past. The single existing test
was also added to avoid reintroduction of a found bug.

Add more unit tests for the feature.

First four patches (1-4) refactor and extend the existing test for DAMOS
filter commit for multiple test cases.

Next three patches (5-7) add tests for DAMOS quota commit.

Next two patches (8 and 9) refactor damos_commit_dests() for ease of code
reading and test writing, and implement a new unit test of the function
that is being refactored in a test-friendly way.

Final two patches (10 and 11) further add new unit tests for
damos_commit() and damon_commit_target_regions().


This patch (of 11):

damos_test_commit_filter() is dynamically allocating test-purpose DAMOS
filters. Allocation failure checks are making the code longer,
complicated, and difficult to extend for more test cases. Refactor the
code to remove the dynamic allocation.

Link: https://lkml.kernel.org/r/20251111184415.141757-1-sj@kernel.org
Link: https://lkml.kernel.org/r/20251111184415.141757-2-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

80d725f901-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: remove unused ctx in damon_test_split_regions_of()

damon_test_split_regions_of() dynamically allocates a 'struct damon_ctx'
object, but it is not really being used in the

mm/damon/tests/core-kunit: remove unused ctx in damon_test_split_regions_of()

damon_test_split_regions_of() dynamically allocates a 'struct damon_ctx'
object, but it is not really being used in the code other than handling
the allocation failure and deallocating it at the end of the function.
Remove the unnecessary allocation and deallocation of the object.

Link: https://lkml.kernel.org/r/20251101182021.74868-23-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

40b11d1e01-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: remove unnecessary damon_ctx variable on damon_test_split_at()

damon_test_split_at() dynamically allocates a 'struct damon_ctx' object,
but it is not really being used in

mm/damon/tests/core-kunit: remove unnecessary damon_ctx variable on damon_test_split_at()

damon_test_split_at() dynamically allocates a 'struct damon_ctx' object,
but it is not really being used in the code other than handling the
allocation failure and deallocating it at the end of the function. Remove
the unnecessary allocation and deallocation of the object.

Link: https://lkml.kernel.org/r/20251101182021.74868-22-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

7d808bf101-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/sysfs-kunit: handle alloc failures on damon_sysfs_test_add_targets()

damon_sysfs_test_add_targets() is assuming all dynamic memory allocation
in it will succeed. Those are indeed lik

mm/damon/tests/sysfs-kunit: handle alloc failures on damon_sysfs_test_add_targets()

damon_sysfs_test_add_targets() is assuming all dynamic memory allocation
in it will succeed. Those are indeed likely in the real use cases since
those allocations are too small to fail, but theoretically those could
fail. In the case, inappropriate memory access can happen. Fix it by
appropriately cleanup pre-allocated memory and skip the execution of the
remaining tests in the failure cases.

Link: https://lkml.kernel.org/r/20251101182021.74868-21-sj@kernel.org
Fixes: b8ee5575f763 ("mm/damon/sysfs-test: add a unit test for damon_sysfs_set_targets()")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org> [6.7+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

0a63a0e701-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/vaddr-kunit: handle alloc failures on damon_test_split_evenly_succ()

damon_test_split_evenly_succ() is assuming all dynamic memory allocation
in it will succeed. Those are indeed lik

mm/damon/tests/vaddr-kunit: handle alloc failures on damon_test_split_evenly_succ()

damon_test_split_evenly_succ() is assuming all dynamic memory allocation
in it will succeed. Those are indeed likely in the real use cases since
those allocations are too small to fail, but theoretically those could
fail. In the case, inappropriate memory access can happen. Fix it by
appropriately cleanup pre-allocated memory and skip the execution of the
remaining tests in the failure cases.

Link: https://lkml.kernel.org/r/20251101182021.74868-20-sj@kernel.org
Fixes: 17ccae8bb5c9 ("mm/damon: add kunit tests")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org> [5.15+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

7890e5b501-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/vaddr-kunit: handle alloc failures in damon_test_split_evenly_fail()

damon_test_split_evenly_fail() is assuming all dynamic memory allocation
in it will succeed. Those are indeed lik

mm/damon/tests/vaddr-kunit: handle alloc failures in damon_test_split_evenly_fail()

damon_test_split_evenly_fail() is assuming all dynamic memory allocation
in it will succeed. Those are indeed likely in the real use cases since
those allocations are too small to fail, but theoretically those could
fail. In the case, inappropriate memory access can happen. Fix it by
appropriately cleanup pre-allocated memory and skip the execution of the
remaining tests in the failure cases.

Link: https://lkml.kernel.org/r/20251101182021.74868-19-sj@kernel.org
Fixes: 17ccae8bb5c9 ("mm/damon: add kunit tests")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org> [5.15+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

2b22d0fc01-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/vaddr-kunit: handle alloc failures on damon_do_test_apply_three_regions()

damon_do_test_apply_three_regions() is assuming all dynamic memory
allocation in it will succeed. Those are

mm/damon/tests/vaddr-kunit: handle alloc failures on damon_do_test_apply_three_regions()

damon_do_test_apply_three_regions() is assuming all dynamic memory
allocation in it will succeed. Those are indeed likely in the real use
cases since those allocations are too small to fail, but theoretically
those could fail. In the case, inappropriate memory access can happen.
Fix it by appropriately cleanup pre-allocated memory and skip the
execution of the remaining tests in the failure cases.

Link: https://lkml.kernel.org/r/20251101182021.74868-18-sj@kernel.org
Fixes: 17ccae8bb5c9 ("mm/damon: add kunit tests")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org> [5.15+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

84be856c01-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: handle alloc failures on damon_test_set_filters_default_reject()

damon_test_set_filters_default_reject() is assuming all dynamic memory
allocation in it will succeed. Tho

mm/damon/tests/core-kunit: handle alloc failures on damon_test_set_filters_default_reject()

damon_test_set_filters_default_reject() is assuming all dynamic memory
allocation in it will succeed. Those are indeed likely in the real use
cases since those allocations are too small to fail, but theoretically
those could fail. In the case, inappropriate memory access can happen.
Fix it by appropriately cleanup pre-allocated memory and skip the
execution of the remaining tests in the failure cases.

Link: https://lkml.kernel.org/r/20251101182021.74868-17-sj@kernel.org
Fixes: 094fb14913c7 ("mm/damon/tests/core-kunit: add a test for damos_set_filters_default_reject()")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org> [6.16+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

d14d567101-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: handle alloc failures on damos_test_filter_out()

damon_test_filter_out() is assuming all dynamic memory allocation in it
will succeed. Those are indeed likely in the real

mm/damon/tests/core-kunit: handle alloc failures on damos_test_filter_out()

damon_test_filter_out() is assuming all dynamic memory allocation in it
will succeed. Those are indeed likely in the real use cases since those
allocations are too small to fail, but theoretically those could fail. In
the case, inappropriate memory access can happen. Fix it by appropriately
cleanup pre-allocated memory and skip the execution of the remaining tests
in the failure cases.

Link: https://lkml.kernel.org/r/20251101182021.74868-16-sj@kernel.org
Fixes: 26713c890875 ("mm/damon/core-test: add a unit test for __damos_filter_out()")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org> [6.6+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

3e5c4a1a01-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: handle alloc failure on damos_test_commit_filter()

damon_test_commit_filter() is assuming all dynamic memory allocation in it
will succeed. Those are indeed likely in the

mm/damon/tests/core-kunit: handle alloc failure on damos_test_commit_filter()

damon_test_commit_filter() is assuming all dynamic memory allocation in it
will succeed. Those are indeed likely in the real use cases since those
allocations are too small to fail, but theoretically those could fail. In
the case, inappropriate memory access can happen. Fix it by appropriately
cleanup pre-allocated memory and skip the execution of the remaining tests
in the failure cases.

Link: https://lkml.kernel.org/r/20251101182021.74868-15-sj@kernel.org
Fixes: f6a4a150f1ec ("mm/damon/tests/core-kunit: add damos_commit_filter test")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org> [6.18+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

28ab226501-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: handle alloc failres in damon_test_new_filter()

damon_test_new_filter() is assuming all dynamic memory allocation in it
will succeed. Those are indeed likely in the real

mm/damon/tests/core-kunit: handle alloc failres in damon_test_new_filter()

damon_test_new_filter() is assuming all dynamic memory allocation in it
will succeed. Those are indeed likely in the real use cases since those
allocations are too small to fail, but theoretically those could fail. In
the case, inappropriate memory access can happen. Fix it by appropriately
cleanup pre-allocated memory and skip the execution of the remaining tests
in the failure cases.

Link: https://lkml.kernel.org/r/20251101182021.74868-14-sj@kernel.org
Fixes: 2a158e956b98 ("mm/damon/core-test: add a test for damos_new_filter()")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org> [6.6+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

915a245301-Nov-2025 SeongJae Park <sj@kernel.org>

mm/damon/tests/core-kunit: handle alloc failure on damon_test_set_attrs()

damon_test_set_attrs() is assuming all dynamic memory allocation in it
will succeed. Those are indeed likely in the real us

mm/damon/tests/core-kunit: handle alloc failure on damon_test_set_attrs()

damon_test_set_attrs() is assuming all dynamic memory allocation in it
will succeed. Those are indeed likely in the real use cases since those
allocations are too small to fail, but theoretically those could fail. In
the case, inappropriate memory access can happen. Fix it by appropriately
cleanup pre-allocated memory and skip the execution of the remaining tests
in the failure cases.

Link: https://lkml.kernel.org/r/20251101182021.74868-13-sj@kernel.org
Fixes: aa13779be6b7 ("mm/damon/core-test: add a test for damon_set_attrs()")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org> [6.5+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

show more ...

123