Vlastimil Babka 45816682b2 mm, mempolicy: stop adjusting current->il_next in mpol_rebind_nodemask()
The task->il_next variable stores the next allocation node id for task's
MPOL_INTERLEAVE policy.  mpol_rebind_nodemask() updates interleave and
bind mempolicies due to changing cpuset mems.  Currently it also tries
to make sure that current->il_next is valid within the updated nodemask.
This is bogus, because 1) we are updating potentially any task's
mempolicy, not just current, and 2) we might be updating a per-vma
mempolicy, not task one.

The interleave_nodes() function that uses il_next can cope fine with the
value not being within the currently allowed nodes, so this hasn't
manifested as an actual issue.

We can remove the need for updating il_next completely by changing it to
il_prev and store the node id of the previous interleave allocation
instead of the next id.  Then interleave_nodes() can calculate the next
id using the current nodemask and also store it as il_prev, except when
querying the next node via do_get_mempolicy().

Link: http://lkml.kernel.org/r/20170517081140.30654-3-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Christoph Lameter <cl@linux.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-06 16:24:34 -07:00
..
2017-04-12 18:51:01 +02:00
2017-07-04 11:48:27 -07:00
2017-07-03 20:55:59 -07:00
2017-04-21 10:45:01 -04:00
2017-07-04 11:55:21 -07:00
2017-06-03 19:29:26 +09:00
2017-07-03 01:43:45 -07:00
2017-06-29 17:34:57 +02:00
2017-06-08 09:03:33 +02:00
2016-12-22 22:58:37 -05:00
2017-06-08 18:52:36 -07:00
2017-02-10 15:52:24 -05:00
2017-07-06 16:24:33 -07:00
2017-01-25 13:17:47 -05:00
2017-07-01 16:15:13 -07:00
2017-07-01 16:15:13 -07:00
2017-07-03 02:22:52 -07:00
2017-04-26 23:54:06 -04:00
2017-03-30 09:37:20 +02:00
2017-05-24 12:43:30 -04:00
2017-06-05 16:59:12 +02:00
2017-04-18 20:41:12 +02:00
2017-07-05 11:46:59 -07:00
2017-06-22 15:43:47 +01:00
2017-06-09 11:52:07 +02:00
2017-05-18 10:30:19 -06:00
2017-07-03 20:27:48 -07:00
2017-04-10 17:15:02 +02:00
2017-04-27 05:13:04 -04:00
2016-12-25 17:21:22 +01:00
2017-06-05 16:59:10 +02:00
2017-03-21 10:15:47 +02:00
2017-04-05 18:11:48 +02:00
2017-05-04 19:15:35 -07:00
2017-05-18 10:07:41 -04:00
2017-05-18 10:07:40 -04:00
2017-06-21 14:37:12 -04:00
2017-06-20 07:12:03 -06:00
2017-05-08 17:15:12 -07:00
2017-01-05 15:01:55 -06:00
2017-05-03 15:52:10 -07:00
2017-02-24 17:46:57 -08:00
2017-06-19 21:50:20 +08:00
2017-05-03 19:12:27 -07:00
2017-04-24 14:30:46 -04:00
2017-01-12 16:48:26 -05:00
2017-02-23 11:53:22 -08:00
2017-05-10 13:03:38 -07:00
2017-04-26 13:03:04 -04:00
2017-06-05 16:59:16 +02:00
2017-05-09 15:15:47 -07:00
2017-05-05 11:36:44 -07:00
2017-05-26 10:10:37 +02:00
2017-07-04 13:39:41 -07:00
2016-12-13 16:07:55 -08:00
2017-05-18 10:07:40 -04:00
2017-07-03 15:12:52 -07:00
2017-02-13 21:44:09 -05:00
2017-06-29 10:48:57 +01:00
2017-05-03 15:52:10 -07:00
2017-06-08 10:35:49 +02:00
2017-05-08 17:15:12 -07:00
2017-07-06 16:24:30 -07:00
2017-03-26 15:09:45 +02:00
2017-06-15 12:12:40 -04:00
2016-12-26 23:53:46 -05:00
2017-06-08 18:52:42 -07:00
2017-06-01 14:53:04 -04:00
2017-05-05 18:49:20 -07:00
2017-03-09 15:42:33 +01:00
2017-06-25 21:58:46 -04:00
2017-01-10 18:31:55 -08:00
2017-07-03 20:04:16 -07:00
2017-07-05 17:09:27 -07:00
2017-05-09 16:43:22 +03:00
2017-06-09 11:54:54 +02:00