From 3bdafaa17a0e56f117a8efa088ef8e3c749c07e0 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Thu, 17 Jun 2004 18:06:43 -0700 Subject: [PATCH] Use numa policy API for boot time policy Suggested by Manfred Spraul. __get_free_pages had a hack to do node interleaving allocation at boot time. This patch sets an interleave process policy using the NUMA API for init and the idle threads instead. Before entering the user space init the policy is reset to default again. Result is the same. Advantage is less code and removing of a check from a fast path. Removes more code than it adds. I verified that the memory distribution after boot is roughly the same. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mempolicy.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/linux') diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 2aeecaf7145b..775c415908ae 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h @@ -153,6 +153,9 @@ void mpol_free_shared_policy(struct shared_policy *p); struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx); +extern void numa_default_policy(void); +extern void numa_policy_init(void); + #else struct mempolicy {}; @@ -215,6 +218,14 @@ mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx) #define vma_policy(vma) NULL #define vma_set_policy(vma, pol) do {} while(0) +static inline void numa_policy_init(void) +{ +} + +static inline void numa_default_policy(void) +{ +} + #endif /* CONFIG_NUMA */ #endif /* __KERNEL__ */ -- cgit v1.2.3