Skip to content

Commit

Permalink
mm, oom: fix missing tlb_finish_mmu() in __oom_reap_task_mm().
Browse files Browse the repository at this point in the history
Commit 93065ac ("mm, oom: distinguish blockable mode for mmu
notifiers") has added an ability to skip over vmas with blockable mmu
notifiers. This however didn't call tlb_finish_mmu as it should.

As a result inc_tlb_flush_pending has been called without its pairing
dec_tlb_flush_pending and all callers mm_tlb_flush_pending would flush
even though this is not really needed.  This alone is not harmful and it
seems there shouldn't be any such callers for oom victims at all but
there is no real reason to skip tlb_finish_mmu on early skip either so
call it.

[[email protected]: new changelog]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Tetsuo Handa <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: David Rientjes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Tetsuo Handa authored and torvalds committed Sep 4, 2018
1 parent 3100dab commit 79cc810
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ bool __oom_reap_task_mm(struct mm_struct *mm)

tlb_gather_mmu(&tlb, mm, start, end);
if (mmu_notifier_invalidate_range_start_nonblock(mm, start, end)) {
tlb_finish_mmu(&tlb, start, end);
ret = false;
continue;
}
Expand Down

0 comments on commit 79cc810

Please sign in to comment.