Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm, mempolicy: remove unneeded functions for UMA configs

Mempolicies only exist for CONFIG_NUMA configurations. Therefore, a
certain class of functions are unneeded in configurations where
CONFIG_NUMA is disabled such as functions that duplicate existing
mempolicies, lookup existing policies, set certain mempolicy traits, or
test mempolicies for certain attributes.

Remove the unneeded functions so that any future callers get a compile-
time error and protect their code with CONFIG_NUMA as required.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Rientjes and committed by
Linus Torvalds
d80be7c7 e8569dd2

-32
-32
include/linux/mempolicy.h
··· 211 211 { 212 212 } 213 213 214 - static inline struct mempolicy *mpol_dup(struct mempolicy *old) 215 - { 216 - return NULL; 217 - } 218 - 219 214 struct shared_policy {}; 220 - 221 - static inline int mpol_set_shared_policy(struct shared_policy *info, 222 - struct vm_area_struct *vma, 223 - struct mempolicy *new) 224 - { 225 - return -EINVAL; 226 - } 227 215 228 216 static inline void mpol_shared_policy_init(struct shared_policy *sp, 229 217 struct mempolicy *mpol) ··· 220 232 221 233 static inline void mpol_free_shared_policy(struct shared_policy *p) 222 234 { 223 - } 224 - 225 - static inline struct mempolicy * 226 - mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx) 227 - { 228 - return NULL; 229 235 } 230 236 231 237 #define vma_policy(vma) NULL ··· 248 266 { 249 267 } 250 268 251 - static inline void mpol_fix_fork_child_flag(struct task_struct *p) 252 - { 253 - } 254 - 255 269 static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, 256 270 unsigned long addr, gfp_t gfp_flags, 257 271 struct mempolicy **mpol, nodemask_t **nodemask) ··· 258 280 } 259 281 260 282 static inline bool init_nodemask_of_mempolicy(nodemask_t *m) 261 - { 262 - return false; 263 - } 264 - 265 - static inline bool mempolicy_nodemask_intersects(struct task_struct *tsk, 266 - const nodemask_t *mask) 267 283 { 268 284 return false; 269 285 } ··· 278 306 return 1; /* error */ 279 307 } 280 308 #endif 281 - 282 - static inline void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) 283 - { 284 - } 285 309 286 310 static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma, 287 311 unsigned long address)