android: binder: Add allocator selftest
authorSherry Yang <sherryy@android.com>
Wed, 23 Aug 2017 15:46:40 +0000 (08:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 14:47:17 +0000 (16:47 +0200)
commit4175e2b46fd4b9021ef81f18f1be9474b2f45d4a
treef71d84f71001cecc96563950400c15f609375619
parente21762196118c272321532fe64c512efaa088b7e
android: binder: Add allocator selftest

binder_alloc_selftest tests that alloc_new_buf handles page allocation and
deallocation properly when allocate and free buffers. The test allocates 5
buffers of various sizes to cover all possible page alignment cases, and
frees the buffers using a list of exhaustive freeing order.

Test: boot the device with ANDROID_BINDER_IPC_SELFTEST config option
enabled. Allocator selftest passes.

Signed-off-by: Sherry Yang <sherryy@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/Kconfig
drivers/android/Makefile
drivers/android/binder.c
drivers/android/binder_alloc.h
drivers/android/binder_alloc_selftest.c [new file with mode: 0644]