All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Scott Wood <scottwood@freescale.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Michael Ellerman <mpe@ellerman.id.au>
Cc: Scott Wood <scottwood@freescale.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/hugetlb: Call mm_dec_nr_pmds() in hugetlb_free_pmd_range()
Date: Tue, 14 Apr 2015 12:44:10 +0530	[thread overview]
Message-ID: <87fv83rxkt.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1428713105-11796-1-git-send-email-scottwood@freescale.com>

Scott Wood <scottwood@freescale.com> writes:

> Commit dc6c9a35b66b5 ("mm: account pmd page tables to the process")
> added a counter that is incremented whenever a PMD is allocated and
> decremented whenever a PMD is freed.  For hugepages on PPC, common code
> is used to allocated PMDs, but arch-specific code is used to free PMDs.
>
> This results in kernel output such as "BUG: non-zero nr_pmds on freeing
> mm: 1" when using hugepages.
>
> Update the PPC hugepage PMD freeing code to decrement the count, just
> as the above commit did for free_pmd_range().
>
> Fixes: dc6c9a35b66b5 ("mm: account pmd page tables to the process")
> Signed-off-by: Scott Wood <scottwood@freescale.com>

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

May be we need to move that mm_dec_nr_pmds to pmd_free_tlb() ?

> ---
> Should we also be touching nr_ptes when we alloc/free hugepage PTEs?
>
>  arch/powerpc/mm/hugetlbpage.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> index 7e408bf..cecbe00 100644
> --- a/arch/powerpc/mm/hugetlbpage.c
> +++ b/arch/powerpc/mm/hugetlbpage.c
> @@ -581,6 +581,7 @@ static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
>  	pmd = pmd_offset(pud, start);
>  	pud_clear(pud);
>  	pmd_free_tlb(tlb, pmd, start);
> +	mm_dec_nr_pmds(tlb->mm);
>  }
>  
>  static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
> -- 
> 2.1.0
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

      reply	other threads:[~2015-04-14  7:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-11  0:45 [PATCH] powerpc/hugetlb: Call mm_dec_nr_pmds() in hugetlb_free_pmd_range() Scott Wood
2015-04-14  7:14 ` Aneesh Kumar K.V [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fv83rxkt.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=scottwood@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.