ANDROID: memory relinquish: Fix build dependencies

Memory relinquish interface is used by both memory ballooning and
by page reporting. It must be built if either is specified.

Bug: 258944680
Change-Id: I3b949dadbfc4a2b17dba1809a46f0a7386e70ebf
Signed-off-by: Keir Fraser <keirf@google.com>
This commit is contained in:
Keir Fraser
2022-11-13 10:34:43 +00:00
parent b1af43d3a3
commit 7e1fba9965
4 changed files with 12 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ void kvm_arm_init_hyp_services(void);
void kvm_init_memshare_services(void);
void kvm_init_ioremap_services(void);
#ifdef CONFIG_MEMORY_BALLOON
#ifdef CONFIG_MEMORY_RELINQUISH
void kvm_init_memrelinquish_services(void);
#else
static inline void kvm_init_memrelinquish_services(void) {}

View File

@@ -3,7 +3,7 @@ obj-y := dma-mapping.o extable.o fault.o init.o \
cache.o copypage.o flush.o \
ioremap.o mem_encrypt.o mmap.o pgd.o mmu.o \
context.o proc.o pageattr.o
obj-$(CONFIG_MEMORY_BALLOON) += mem_relinquish.o
obj-$(CONFIG_MEMORY_RELINQUISH) += mem_relinquish.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
obj-$(CONFIG_PTDUMP_CORE) += ptdump.o
obj-$(CONFIG_PTDUMP_DEBUGFS) += ptdump_debugfs.o

View File

@@ -7,14 +7,14 @@
#ifndef __MEM_RELINQUISH_H__
#define __MEM_RELINQUISH_H__
#ifdef CONFIG_ARCH_HAS_MEM_RELINQUISH
#ifdef CONFIG_MEMORY_RELINQUISH
#include <asm/mem_relinquish.h>
#else /* !CONFIG_ARCH_HAS_MEM_RELINQUISH */
#else /* !CONFIG_MEMORY_RELINQUISH */
static inline void page_relinquish(struct page *page) { }
#endif /* CONFIG_ARCH_HAS_MEM_RELINQUISH */
#endif /* CONFIG_MEMORY_RELINQUISH */
#endif /* __MEM_RELINQUISH_H__ */

View File

@@ -188,6 +188,13 @@ config ARCH_ENABLE_SPLIT_PMD_PTLOCK
config MEMORY_BALLOON
bool
#
# support for memory relinquish
config MEMORY_RELINQUISH
def_bool y
depends on ARCH_HAS_MEM_RELINQUISH
depends on MEMORY_BALLOON || PAGE_REPORTING
#
# support for memory balloon compaction
config BALLOON_COMPACTION