Re: [PATCH] mm/mempolicy.c: Remove unnecessary nodemask check in kernel_migrate_pages()

2019-08-06 Thread Kefeng Wang
On 2019/8/6 16:36, Vlastimil Babka wrote: > On 8/6/19 4:36 AM, Kefeng Wang wrote: [...] >> >> [QUESTION] >> >> SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, >> const unsigned long __user *, old_nodes, >> const unsigned long __user *, new_nodes

Re: [PATCH] mm/mempolicy.c: Remove unnecessary nodemask check in kernel_migrate_pages()

2019-08-06 Thread Vlastimil Babka
On 8/6/19 4:36 AM, Kefeng Wang wrote: > 1) task_nodes = cpuset_mems_allowed(current); >-> cpuset_mems_allowed() guaranteed to return some non-empty > subset of node_states[N_MEMORY]. Right, there's an explicit guarantee. > 2) nodes_and(*new, *new, task_nodes); >-> after nodes_and(),

[PATCH] mm/mempolicy.c: Remove unnecessary nodemask check in kernel_migrate_pages()

2019-08-05 Thread Kefeng Wang
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).