diff options
author | Mel Gorman <mgorman@suse.de> | 2014-08-28 19:34:44 +0100 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-09-26 11:51:56 +0200 |
commit | 337c9823cf0b93c8f4d1c4654bd93cf24e5b837b (patch) | |
tree | 76c04b196afd4d715011190e8ecffac1a9f05eaf /kernel | |
parent | 8010da4957163cce03a9a27b7f3dbeb5a77a3954 (diff) | |
download | lwn-337c9823cf0b93c8f4d1c4654bd93cf24e5b837b.tar.gz lwn-337c9823cf0b93c8f4d1c4654bd93cf24e5b837b.zip |
mm: optimize put_mems_allowed() usage
commit d26914d11751b23ca2e8747725f2cae10c2f2c1b upstream.
Since put_mems_allowed() is strictly optional, its a seqcount retry, we
don't need to evaluate the function if the allocation was in fact
successful, saving a smp_rmb some loads and comparisons on some relative
fast-paths.
Since the naming, get/put_mems_allowed() does suggest a mandatory
pairing, rename the interface, as suggested by Mel, to resemble the
seqcount interface.
This gives us: read_mems_allowed_begin() and read_mems_allowed_retry(),
where it is important to note that the return value of the latter call
is inverted from its previous incarnation.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpuset.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 0b29c52479a6..15ae2b7e3846 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1022,7 +1022,7 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk, task_lock(tsk); /* * Determine if a loop is necessary if another thread is doing - * get_mems_allowed(). If at least one node remains unchanged and + * read_mems_allowed_begin(). If at least one node remains unchanged and * tsk does not have a mempolicy, then an empty nodemask will not be * possible when mems_allowed is larger than a word. */ |