History

mm, mempolicy: simplify rebinding mempolicies when updating cpusets

Commit c0ff7453bb5c ("cpuset,mm: fix no node to alloc memory when changing cpuset's mems") has introduced a two-step protocol when rebinding task's mempolicy due to cpuset update, in order to avoid a parallel allocation seeing an empty effective nodemask and failing. Later, commit cc9a6c877661 ("cpuset: mm: reduce large amounts of memory barrier related damage v3") introduced a seqlock protection and removed the synchronization point between the two update steps. At that point (or perhaps later), the two-step rebinding became unnecessary. Currently it only makes sure that the update first adds new nodes in step 1 and then removes nodes in step 2. Without memory barriers the effects are questionable, and even then this cannot prevent a parallel zonelist iteration checking the nodemask at each step to observe all nodes as unusable for allocation. We now fully rely on the seqlock to prevent premature OOMs and allocation failures. We can thus remove the two-step update parts and simplify the code.

Vlastimil Babka committed 9 years ago

Commit 213980c1 parent 04ec6264 files · +21 −99Browse files

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

Unified · Split

include/uapi/linux/mempolicy.h+0−8
@@ -24,13 +24,6 @@ enum { · 23 unmodified lines
24 MPOL_MAX, /* always last member of enum */24 MPOL_MAX, /* always last member of enum */
25};25};
26 26
27enum mpol_rebind_step {
28 MPOL_REBIND_ONCE, /* do rebind work at once(not by two step) */
29 MPOL_REBIND_STEP1, /* first step(set all the newly nodes) */
30 MPOL_REBIND_STEP2, /* second step(clean all the disallowed nodes)*/
31 MPOL_REBIND_NSTEP,
32};
33
34/* Flags for set_mempolicy */27/* Flags for set_mempolicy */
35#define MPOL_F_STATIC_NODES (1 << 15)28#define MPOL_F_STATIC_NODES (1 << 15)
36#define MPOL_F_RELATIVE_NODES (1 << 14)29#define MPOL_F_RELATIVE_NODES (1 << 14)
@@ -65,7 +58,6 @@ enum mpol_rebind_step { · 28 unmodified lines
65 */58 */
66#define MPOL_F_SHARED (1 << 0) /* identify shared policies */59#define MPOL_F_SHARED (1 << 0) /* identify shared policies */
67#define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */60#define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */
68#define MPOL_F_REBINDING (1 << 2) /* identify policies in rebinding */
69#define MPOL_F_MOF (1 << 3) /* this policy wants migrate on fault */61#define MPOL_F_MOF (1 << 3) /* this policy wants migrate on fault */
70#define MPOL_F_MORON (1 << 4) /* Migrate On protnone Reference On Node */62#define MPOL_F_MORON (1 << 4) /* Migrate On protnone Reference On Node */
71 63