2016-06-06-16-15 merged

Michal Hocko (2):
      Reverted "reiserfs: avoid uninitialized variable use"
      khugepaged: simplify khugepaged vs. __mmput

Sudip Mukherjee (1):
      mm/page_owner: avoid null pointer dereference

Tetsuo Handa (1):
      oom_reaper: avoid pointless atomic_inc_not_zero usage.
khugepaged: simplify khugepaged vs. __mmput

__khugepaged_exit is called during the final __mmput and it employs a
complex synchronization dances to make sure it doesn't race with the
khugepaged which might be scanning this mm at the same time.  This is all
caused by the fact that khugepaged doesn't pin mm_users.  Things would
simplify considerably if we simply check the mm at khugepaged_scan_mm_slot
and if mm_users was already 0 then we know it is dead and we can unhash
the mm_slot and move on to another one.  This will also guarantee that
__khugepaged_exit cannot race with khugepaged and so we can free up the
slot if it is still hashed.

Link: http://lkml.kernel.org/r/20160603134934.GJ20676@dhcp22.suse.cz
Signed-off-by: Michal Hocko <mhocko@suse.com>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 file changed