akpm@ wrote: > > The patch titled > Subject: mm: fix false-positive warning on exit due mm_nr_pmds(mm) > has been added to the -mm tree. Its filename is > mm-fix-false-positive-warning-on-exit-due-mm_nr_pmdsmm.patch > > This patch should soon appear at > http://ozlabs.org/~akpm/mmots/broken-out/mm-fix-false-positive-warning-on-exit-due-mm_nr_pmdsmm.patch > and later at > http://ozlabs.org/~akpm/mmotm/broken-out/mm-fix-false-positive-warning-on-exit-due-mm_nr_pmdsmm.patch > > Before you just go and hit "reply", please: > a) Consider who else should be cc'ed > b) Prefer to cc a suitable mailing list as well > c) Ideally: find the original patch on the mailing list and do a > reply-to-all to that, adding suitable additional cc's > > *** Remember to use Documentation/SubmitChecklist when testing your code *** > > The -mm tree is included into linux-next and is updated > there every 3-4 working days > > ------------------------------------------------------ > From: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> > Subject: mm: fix false-positive warning on exit due mm_nr_pmds(mm) > > The problem is that we check nr_ptes/nr_pmds in exit_mmap() which happens > *before* pgd_free(). And if an arch does pte/pmd allocation in > pgd_alloc() and frees them in pgd_free() we see offset in counters by the > time of the checks. > > We tried to workaround this by offsetting expected counter value according > to FIRST_USER_ADDRESS for both nr_pte and nr_pmd in exit_mmap(). But it > doesn't work in some cases: > > 1. ARM with LPAE enabled also has non-zero USER_PGTABLES_CEILING, but > upper addresses occupied with huge pmd entries, so the trick with > offsetting expected counter value will get really ugly: we will have > to apply it nr_pmds, but not nr_ptes. > > 2. Metag has non-zero FIRST_USER_ADDRESS, but doesn't do allocation > pte/pmd page tables allocation in pgd_alloc(), just setup a pgd entry > which is allocated at boot and shared accross all processes. > > The proposal is to move the check to check_mm() which happens *after* > pgd_free() and do proper accounting during pgd_alloc() and pgd_free() > which would bring counters to zero if nothing leaked. > > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> > Reported-by: Tyler Baker <tyler.baker@xxxxxxxxxx> > Tested-by: Nishanth Menon <nm@xxxxxx> > Cc: Russell King <linux@xxxxxxxxxxxxxxxx> > Cc: James Hogan <james.hogan@xxxxxxxxxx> > Cc: Guan Xuetao <gxt@xxxxxxxxxxxxxxx> > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > --- Small fix up for the patch. >From 56147105dc8691e9ec0026437dbd72971a65df34 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> Date: Mon, 9 Feb 2015 16:37:37 +0200 Subject: [PATCH] mm: fix missing \n in error messages in check_mm() Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> --- kernel/fork.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index 56b82deb6457..cf65139615a0 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -606,10 +606,10 @@ static void check_mm(struct mm_struct *mm) } if (atomic_long_read(&mm->nr_ptes)) - pr_alert("BUG: non-zero nr_ptes on freeing mm: %ld", + pr_alert("BUG: non-zero nr_ptes on freeing mm: %ld\n", atomic_long_read(&mm->nr_ptes)); if (mm_nr_pmds(mm)) - pr_alert("BUG: non-zero nr_pmds on freeing mm: %ld", + pr_alert("BUG: non-zero nr_pmds on freeing mm: %ld\n", mm_nr_pmds(mm)); #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS -- 2.1.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>