diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpuset.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 9f28e1f00185..44d13c246e5c 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -858,8 +858,7 @@ static int update_nodemask(struct cpuset *cs, char *buf) | |||
858 | 858 | ||
859 | mutex_lock(&callback_mutex); | 859 | mutex_lock(&callback_mutex); |
860 | cs->mems_allowed = trialcs.mems_allowed; | 860 | cs->mems_allowed = trialcs.mems_allowed; |
861 | atomic_inc(&cpuset_mems_generation); | 861 | cs->mems_generation = atomic_inc_return(&cpuset_mems_generation); |
862 | cs->mems_generation = atomic_read(&cpuset_mems_generation); | ||
863 | mutex_unlock(&callback_mutex); | 862 | mutex_unlock(&callback_mutex); |
864 | 863 | ||
865 | set_cpuset_being_rebound(cs); /* causes mpol_copy() rebind */ | 864 | set_cpuset_being_rebound(cs); /* causes mpol_copy() rebind */ |
@@ -1770,8 +1769,7 @@ static long cpuset_create(struct cpuset *parent, const char *name, int mode) | |||
1770 | atomic_set(&cs->count, 0); | 1769 | atomic_set(&cs->count, 0); |
1771 | INIT_LIST_HEAD(&cs->sibling); | 1770 | INIT_LIST_HEAD(&cs->sibling); |
1772 | INIT_LIST_HEAD(&cs->children); | 1771 | INIT_LIST_HEAD(&cs->children); |
1773 | atomic_inc(&cpuset_mems_generation); | 1772 | cs->mems_generation = atomic_inc_return(&cpuset_mems_generation); |
1774 | cs->mems_generation = atomic_read(&cpuset_mems_generation); | ||
1775 | fmeter_init(&cs->fmeter); | 1773 | fmeter_init(&cs->fmeter); |
1776 | 1774 | ||
1777 | cs->parent = parent; | 1775 | cs->parent = parent; |
@@ -1861,7 +1859,7 @@ int __init cpuset_init_early(void) | |||
1861 | struct task_struct *tsk = current; | 1859 | struct task_struct *tsk = current; |
1862 | 1860 | ||
1863 | tsk->cpuset = &top_cpuset; | 1861 | tsk->cpuset = &top_cpuset; |
1864 | tsk->cpuset->mems_generation = atomic_read(&cpuset_mems_generation); | 1862 | tsk->cpuset->mems_generation = atomic_inc_return(&cpuset_mems_generation); |
1865 | return 0; | 1863 | return 0; |
1866 | } | 1864 | } |
1867 | 1865 | ||
@@ -1880,8 +1878,7 @@ int __init cpuset_init(void) | |||
1880 | top_cpuset.mems_allowed = NODE_MASK_ALL; | 1878 | top_cpuset.mems_allowed = NODE_MASK_ALL; |
1881 | 1879 | ||
1882 | fmeter_init(&top_cpuset.fmeter); | 1880 | fmeter_init(&top_cpuset.fmeter); |
1883 | atomic_inc(&cpuset_mems_generation); | 1881 | top_cpuset.mems_generation = atomic_inc_return(&cpuset_mems_generation); |
1884 | top_cpuset.mems_generation = atomic_read(&cpuset_mems_generation); | ||
1885 | 1882 | ||
1886 | init_task.cpuset = &top_cpuset; | 1883 | init_task.cpuset = &top_cpuset; |
1887 | 1884 | ||