提交 2c7c3a7d 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

mempolicy: kill do_set_mempolicy()->down_write(&mm->mmap_sem)

Remove down_write(&mm->mmap_sem) in do_set_mempolicy(). This logic
was never correct and it is no longer needed, see the previous patch.
Signed-off-by: NOleg Nesterov <oleg@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 498f2371
...@@ -802,7 +802,6 @@ static long do_set_mempolicy(unsigned short mode, unsigned short flags, ...@@ -802,7 +802,6 @@ static long do_set_mempolicy(unsigned short mode, unsigned short flags,
nodemask_t *nodes) nodemask_t *nodes)
{ {
struct mempolicy *new, *old; struct mempolicy *new, *old;
struct mm_struct *mm = current->mm;
NODEMASK_SCRATCH(scratch); NODEMASK_SCRATCH(scratch);
int ret; int ret;
...@@ -814,20 +813,11 @@ static long do_set_mempolicy(unsigned short mode, unsigned short flags, ...@@ -814,20 +813,11 @@ static long do_set_mempolicy(unsigned short mode, unsigned short flags,
ret = PTR_ERR(new); ret = PTR_ERR(new);
goto out; goto out;
} }
/*
* prevent changing our mempolicy while show_numa_maps()
* is using it.
* Note: do_set_mempolicy() can be called at init time
* with no 'mm'.
*/
if (mm)
down_write(&mm->mmap_sem);
task_lock(current); task_lock(current);
ret = mpol_set_nodemask(new, nodes, scratch); ret = mpol_set_nodemask(new, nodes, scratch);
if (ret) { if (ret) {
task_unlock(current); task_unlock(current);
if (mm)
up_write(&mm->mmap_sem);
mpol_put(new); mpol_put(new);
goto out; goto out;
} }
...@@ -837,9 +827,6 @@ static long do_set_mempolicy(unsigned short mode, unsigned short flags, ...@@ -837,9 +827,6 @@ static long do_set_mempolicy(unsigned short mode, unsigned short flags,
nodes_weight(new->v.nodes)) nodes_weight(new->v.nodes))
current->il_next = first_node(new->v.nodes); current->il_next = first_node(new->v.nodes);
task_unlock(current); task_unlock(current);
if (mm)
up_write(&mm->mmap_sem);
mpol_put(old); mpol_put(old);
ret = 0; ret = 0;
out: out:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册