Skip to contentSkip to conversation

mm/mpol: Split and explose some mempolicy functions

tip:sched/numa tip-bot for Peter Zijlstra 1 participant 1 message May 18, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  5dca4a9119807320b6571ecae878249eef46fa92
Gitweb:     http://git.kernel.org/tip/5dca4a9119807320b6571ecae878249eef46fa92
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Mon, 9 Jan 2012 11:41:03 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 18 May 2012 08:16:20 +0200

mm/mpol: Split and explose some mempolicy functions

In order to allow creating 'custom' mpols, expose some guts. In particular means to allocate fresh mpols and to bind them to memory ranges, skipping out on the intermediate -- policy -- part of sys_mbind().

Cc Suresh Siddha <[email protected]>
Cc Paul Turner <[email protected]>
Cc Dan Smith <[email protected]>
Cc Bharata B Rao <[email protected]>
Cc Lee Schermerhorn <[email protected]>
Cc Christoph Lameter <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Linus Torvalds <[email protected]>
---
 include/linux/mempolicy.h |    8 +++
 mm/mempolicy.c            |  111 +++++++++++++++++++++++++-------------------
 2 files changed, 71 insertions(+), 48 deletions(-)
include/linux/mempolicy.h +8 -0
index 3942845..578fcd0 100644
@@ -205,6 +205,12 @@ struct shared_policy {
 	spinlock_t lock;
 };
 
+extern struct mempolicy *mpol_new(unsigned short mode, unsigned short flags,
+				  nodemask_t *nodes);
+extern long mpol_do_mbind(unsigned long start, unsigned long len,
+				struct mempolicy *policy, unsigned long mode,
+				nodemask_t *nmask, unsigned long flags);
+
 void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol);
 int mpol_set_shared_policy(struct shared_policy *info,
 				struct vm_area_struct *vma,
@@ -218,6 +224,8 @@ struct mempolicy *get_vma_policy(struct task_struct *tsk,
 
 extern void numa_default_policy(void);
 extern void numa_policy_init(void);
+extern void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *new,
+				enum mpol_rebind_step step);
 extern void mpol_rebind_task(struct task_struct *tsk, const nodemask_t *new,
 				enum mpol_rebind_step step);
 extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
mm/mempolicy.c +63 -48

171 lines not on this page · raw message