History

mm: mempolicy: Add MPOL_MF_LAZY

NOTE: Once again there is a lot of patch stealing and the end result is sufficiently different that I had to drop the signed-offs. Will re-add if the original authors are ok with that. This patch adds another mbind() flag to request "lazy migration". The flag, MPOL_MF_LAZY, modifies MPOL_MF_MOVE* such that the selected pages are marked PROT_NONE. The pages will be migrated in the fault path on "first touch", if the policy dictates at that time. "Lazy Migration" will allow testing of migrate-on-fault via mbind(). Also allows applications to specify that only subsequently touched pages be migrated to obey new policy, instead of all pages in range. This can be useful for multi-threaded applications working on a large shared data area that is initialized by an initial thread resulting in all pages on one [or a few, if overflowed] nodes. After PROT_NONE, the pages in regions assigned to the worker threads will be automatically migrated local to the threads on 1st touch.

Lee Schermerhorn committed 14 years ago

Commit b24f53a1 parent 4daae3b3 files · +185 −18Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/mempolicy.h+10−3
@@ -49,9 +49,16 @@ enum mpol_rebind_step { · 48 unmodified lines
4949
5050 /* Flags for mbind */
5151 #define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */
52−#define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform to mapping */
53−#define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to mapping */
54−#define MPOL_MF_INTERNAL (1<<3) /* Internal flags start here */
52+#define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform
53+ to policy */
54+#define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to policy */
55+#define MPOL_MF_LAZY (1<<3) /* Modifies '_MOVE: lazy migrate on fault */
56+#define MPOL_MF_INTERNAL (1<<4) /* Internal flags start here */
57+
58+#define MPOL_MF_VALID (MPOL_MF_STRICT | \
59+ MPOL_MF_MOVE | \
60+ MPOL_MF_MOVE_ALL | \
61+ MPOL_MF_LAZY)
5562
5663 /*
5764 * Internal flags that share the struct mempolicy flags word with

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t