diff --git a/ashmem/ashmem.c b/ashmem/ashmem.c index 6b1be9e..9c38c9e 100644 --- a/ashmem/ashmem.c +++ b/ashmem/ashmem.c @@ -874,7 +874,11 @@ static int __init ashmem_init(void) return ret; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0)) + register_shrinker(&ashmem_shrinker, "android-ashmem"); +#else register_shrinker(&ashmem_shrinker); +#endif return 0; } diff --git a/binder/binder_alloc.c b/binder/binder_alloc.c index 61dd545..dbd96fa 100644 --- a/binder/binder_alloc.c +++ b/binder/binder_alloc.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "binder_alloc.h" #include "binder_trace.h" @@ -1079,7 +1080,11 @@ int binder_alloc_shrinker_init(void) int ret = list_lru_init(&binder_alloc_lru); if (ret == 0) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0)) + ret = register_shrinker(&binder_shrinker, "android-binder"); +#else ret = register_shrinker(&binder_shrinker); +#endif if (ret) list_lru_destroy(&binder_alloc_lru); }