Re: [PATCH] mm, oom: allow oom reaper to race with exit_mmap
From: kbuild test robot
Date: Mon Jul 24 2017 - 12:42:41 EST
Hi Michal,
[auto build test ERROR on mmotm/master]
[also build test ERROR on v4.13-rc2 next-20170724]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Michal-Hocko/mm-oom-allow-oom-reaper-to-race-with-exit_mmap/20170724-233159
base: git://git.cmpxchg.org/linux-mmotm.git master
config: x86_64-randconfig-x016-201730 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
mm/oom_kill.c: In function '__oom_reap_task_mm':
>> mm/oom_kill.c:523:9: error: 'ret' undeclared (first use in this function)
return ret;
^~~
mm/oom_kill.c:523:9: note: each undeclared identifier is reported only once for each function it appears in
>> mm/oom_kill.c:524:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
vim +/ret +523 mm/oom_kill.c
03049269d Michal Hocko 2016-03-25 468
7ebffa455 Tetsuo Handa 2016-10-07 469 static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
aac453635 Michal Hocko 2016-03-25 470 {
aac453635 Michal Hocko 2016-03-25 471 struct mmu_gather tlb;
aac453635 Michal Hocko 2016-03-25 472 struct vm_area_struct *vma;
e2fe14564 Michal Hocko 2016-05-27 473
aac453635 Michal Hocko 2016-03-25 474 if (!down_read_trylock(&mm->mmap_sem)) {
fa60da35c Andrew Morton 2017-07-14 475 trace_skip_task_reaping(tsk->pid);
ed7a155c6 Michal Hocko 2017-07-24 476 return false;
e5e3f4c4f Michal Hocko 2016-07-26 477 }
e5e3f4c4f Michal Hocko 2016-07-26 478
ed7a155c6 Michal Hocko 2017-07-24 479 /* There is nothing to reap so bail out without signs in the log */
ed7a155c6 Michal Hocko 2017-07-24 480 if (!mm->mmap)
ed7a155c6 Michal Hocko 2017-07-24 481 goto unlock;
aac453635 Michal Hocko 2016-03-25 482
fa60da35c Andrew Morton 2017-07-14 483 trace_start_task_reaping(tsk->pid);
fa60da35c Andrew Morton 2017-07-14 484
3f70dc38c Michal Hocko 2016-10-07 485 /*
3f70dc38c Michal Hocko 2016-10-07 486 * Tell all users of get_user/copy_from_user etc... that the content
3f70dc38c Michal Hocko 2016-10-07 487 * is no longer stable. No barriers really needed because unmapping
3f70dc38c Michal Hocko 2016-10-07 488 * should imply barriers already and the reader would hit a page fault
3f70dc38c Michal Hocko 2016-10-07 489 * if it stumbled over a reaped memory.
3f70dc38c Michal Hocko 2016-10-07 490 */
3f70dc38c Michal Hocko 2016-10-07 491 set_bit(MMF_UNSTABLE, &mm->flags);
3f70dc38c Michal Hocko 2016-10-07 492
aac453635 Michal Hocko 2016-03-25 493 tlb_gather_mmu(&tlb, mm, 0, -1);
aac453635 Michal Hocko 2016-03-25 494 for (vma = mm->mmap ; vma; vma = vma->vm_next) {
235190738 Kirill A. Shutemov 2017-02-22 495 if (!can_madv_dontneed_vma(vma))
aac453635 Michal Hocko 2016-03-25 496 continue;
aac453635 Michal Hocko 2016-03-25 497
aac453635 Michal Hocko 2016-03-25 498 /*
aac453635 Michal Hocko 2016-03-25 499 * Only anonymous pages have a good chance to be dropped
aac453635 Michal Hocko 2016-03-25 500 * without additional steps which we cannot afford as we
aac453635 Michal Hocko 2016-03-25 501 * are OOM already.
aac453635 Michal Hocko 2016-03-25 502 *
aac453635 Michal Hocko 2016-03-25 503 * We do not even care about fs backed pages because all
aac453635 Michal Hocko 2016-03-25 504 * which are reclaimable have already been reclaimed and
aac453635 Michal Hocko 2016-03-25 505 * we do not want to block exit_mmap by keeping mm ref
aac453635 Michal Hocko 2016-03-25 506 * count elevated without a good reason.
aac453635 Michal Hocko 2016-03-25 507 */
aac453635 Michal Hocko 2016-03-25 508 if (vma_is_anonymous(vma) || !(vma->vm_flags & VM_SHARED))
aac453635 Michal Hocko 2016-03-25 509 unmap_page_range(&tlb, vma, vma->vm_start, vma->vm_end,
3e8715fdc Kirill A. Shutemov 2017-02-22 510 NULL);
aac453635 Michal Hocko 2016-03-25 511 }
aac453635 Michal Hocko 2016-03-25 512 tlb_finish_mmu(&tlb, 0, -1);
bc448e897 Michal Hocko 2016-03-25 513 pr_info("oom_reaper: reaped process %d (%s), now anon-rss:%lukB, file-rss:%lukB, shmem-rss:%lukB\n",
bc448e897 Michal Hocko 2016-03-25 514 task_pid_nr(tsk), tsk->comm,
bc448e897 Michal Hocko 2016-03-25 515 K(get_mm_counter(mm, MM_ANONPAGES)),
bc448e897 Michal Hocko 2016-03-25 516 K(get_mm_counter(mm, MM_FILEPAGES)),
bc448e897 Michal Hocko 2016-03-25 517 K(get_mm_counter(mm, MM_SHMEMPAGES)));
36324a990 Michal Hocko 2016-03-25 518
fa60da35c Andrew Morton 2017-07-14 519 trace_finish_task_reaping(tsk->pid);
ed7a155c6 Michal Hocko 2017-07-24 520 unlock:
ed7a155c6 Michal Hocko 2017-07-24 521 up_read(&mm->mmap_sem);
ed7a155c6 Michal Hocko 2017-07-24 522
aac453635 Michal Hocko 2016-03-25 @523 return ret;
aac453635 Michal Hocko 2016-03-25 @524 }
aac453635 Michal Hocko 2016-03-25 525
:::::: The code at line 523 was first introduced by commit
:::::: aac453635549699c13a84ea1456d5b0e574ef855 mm, oom: introduce oom reaper
:::::: TO: Michal Hocko <mhocko@xxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip