mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
binder: Convert binder_alloc selftests to KUnit
Convert the existing binder_alloc_selftest tests into KUnit tests. These tests allocate and free an exhaustive combination of buffers with various sizes and alignments. This change allows them to be run without blocking or otherwise interfering with other processes in binder. This test is refactored into more meaningful cases in the subsequent patch. Signed-off-by: Tiffany Yang <ynaffit@google.com> Acked-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20250714185321.2417234-6-ynaffit@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5e024582f4
commit
f6544dcdd0
@@ -697,6 +697,7 @@ struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc,
|
||||
out:
|
||||
return buffer;
|
||||
}
|
||||
EXPORT_SYMBOL_IF_KUNIT(binder_alloc_new_buf);
|
||||
|
||||
static unsigned long buffer_start_page(struct binder_buffer *buffer)
|
||||
{
|
||||
@@ -875,6 +876,7 @@ void binder_alloc_free_buf(struct binder_alloc *alloc,
|
||||
binder_free_buf_locked(alloc, buffer);
|
||||
mutex_unlock(&alloc->mutex);
|
||||
}
|
||||
EXPORT_SYMBOL_IF_KUNIT(binder_alloc_free_buf);
|
||||
|
||||
/**
|
||||
* binder_alloc_mmap_handler() - map virtual address space for proc
|
||||
@@ -1211,6 +1213,7 @@ err_mmap_read_lock_failed:
|
||||
err_mmget:
|
||||
return LRU_SKIP;
|
||||
}
|
||||
EXPORT_SYMBOL_IF_KUNIT(binder_alloc_free_page);
|
||||
|
||||
static unsigned long
|
||||
binder_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
|
||||
|
||||
Reference in New Issue
Block a user