Skip to content

Commit d80be7c

Browse files
rientjestorvalds
authored andcommitted
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>
1 parent e8569dd commit d80be7c

1 file changed

Lines changed: 0 additions & 32 deletions

File tree

‎include/linux/mempolicy.h‎

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -211,20 +211,8 @@ static inline void mpol_get(struct mempolicy *pol)
211211
{
212212
}
213213

214-
static inline struct mempolicy *mpol_dup(struct mempolicy *old)
215-
{
216-
return NULL;
217-
}
218-
219214
struct shared_policy {};
220215

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-
228216
static inline void mpol_shared_policy_init(struct shared_policy *sp,
229217
struct mempolicy *mpol)
230218
{
@@ -234,12 +222,6 @@ static inline void mpol_free_shared_policy(struct shared_policy *p)
234222
{
235223
}
236224

237-
static inline struct mempolicy *
238-
mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx)
239-
{
240-
return NULL;
241-
}
242-
243225
#define vma_policy(vma) NULL
244226

245227
static inline int
@@ -266,10 +248,6 @@ static inline void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new)
266248
{
267249
}
268250

269-
static inline void mpol_fix_fork_child_flag(struct task_struct *p)
270-
{
271-
}
272-
273251
static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma,
274252
unsigned long addr, gfp_t gfp_flags,
275253
struct mempolicy **mpol, nodemask_t **nodemask)
@@ -284,12 +262,6 @@ static inline bool init_nodemask_of_mempolicy(nodemask_t *m)
284262
return false;
285263
}
286264

287-
static inline bool mempolicy_nodemask_intersects(struct task_struct *tsk,
288-
const nodemask_t *mask)
289-
{
290-
return false;
291-
}
292-
293265
static inline int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
294266
const nodemask_t *to, int flags)
295267
{
@@ -307,10 +279,6 @@ static inline int mpol_parse_str(char *str, struct mempolicy **mpol)
307279
}
308280
#endif
309281

310-
static inline void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
311-
{
312-
}
313-
314282
static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma,
315283
unsigned long address)
316284
{

0 commit comments

Comments
 (0)