Skip to content

Commit 4406548

Browse files
Kefeng Wangtorvalds
authored andcommitted
mm/mempolicy.c: remove unnecessary nodemask check in kernel_migrate_pages()
1) task_nodes = cpuset_mems_allowed(current); -> cpuset_mems_allowed() guaranteed to return some non-empty subset of node_states[N_MEMORY]. 2) nodes_and(*new, *new, task_nodes); -> after nodes_and(), the 'new' should be empty or appropriate nodemask(online node and with memory). After 1) and 2), we could remove unnecessary check whether the 'new' AND node_states[N_MEMORY] is empty. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Kefeng Wang <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Dan Williams <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Oscar Salvador <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 32aaf05 commit 4406548

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

mm/mempolicy.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,10 +1512,6 @@ static int kernel_migrate_pages(pid_t pid, unsigned long maxnode,
15121512
if (nodes_empty(*new))
15131513
goto out_put;
15141514

1515-
nodes_and(*new, *new, node_states[N_MEMORY]);
1516-
if (nodes_empty(*new))
1517-
goto out_put;
1518-
15191515
err = security_task_movememory(task);
15201516
if (err)
15211517
goto out_put;

0 commit comments

Comments
 (0)