summaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorPaul Jackson <pj@sgi.com>2006-03-24 03:16:01 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 07:33:22 -0800
commit8a39cc60bfa5a72f32d975729a354daca124f6de (patch)
treec8a364e6fc5186293bca85152c442a4a23df4822 /kernel/cpuset.c
parent7b5b9ef0e17d52c188fe73ea78e884fe67079e6c (diff)
downloadop-kernel-dev-8a39cc60bfa5a72f32d975729a354daca124f6de.zip
op-kernel-dev-8a39cc60bfa5a72f32d975729a354daca124f6de.tar.gz
[PATCH] cpuset use combined atomic_inc_return calls
Replace pairs of calls to <atomic_inc, atomic_read>, with a single call atomic_inc_return, saving a few bytes of source and kernel text. Signed-off-by: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 9f28e1f..44d13c2 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -858,8 +858,7 @@ static int update_nodemask(struct cpuset *cs, char *buf)
mutex_lock(&callback_mutex);
cs->mems_allowed = trialcs.mems_allowed;
- atomic_inc(&cpuset_mems_generation);
- cs->mems_generation = atomic_read(&cpuset_mems_generation);
+ cs->mems_generation = atomic_inc_return(&cpuset_mems_generation);
mutex_unlock(&callback_mutex);
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)
atomic_set(&cs->count, 0);
INIT_LIST_HEAD(&cs->sibling);
INIT_LIST_HEAD(&cs->children);
- atomic_inc(&cpuset_mems_generation);
- cs->mems_generation = atomic_read(&cpuset_mems_generation);
+ cs->mems_generation = atomic_inc_return(&cpuset_mems_generation);
fmeter_init(&cs->fmeter);
cs->parent = parent;
@@ -1861,7 +1859,7 @@ int __init cpuset_init_early(void)
struct task_struct *tsk = current;
tsk->cpuset = &top_cpuset;
- tsk->cpuset->mems_generation = atomic_read(&cpuset_mems_generation);
+ tsk->cpuset->mems_generation = atomic_inc_return(&cpuset_mems_generation);
return 0;
}
@@ -1880,8 +1878,7 @@ int __init cpuset_init(void)
top_cpuset.mems_allowed = NODE_MASK_ALL;
fmeter_init(&top_cpuset.fmeter);
- atomic_inc(&cpuset_mems_generation);
- top_cpuset.mems_generation = atomic_read(&cpuset_mems_generation);
+ top_cpuset.mems_generation = atomic_inc_return(&cpuset_mems_generation);
init_task.cpuset = &top_cpuset;
OpenPOWER on IntegriCloud