Re: [PATCH] mm/hugetl.c: keep the page mapping info when free_huge_page() hit the VM_BUG_ON_PAGE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Maintainer,
Actually i met a VM_BUG_ON_PAGE issue in centos7.4 some days ago.When the issue first happen,
i just can know that it happen in free_huge_page() when doing soft offline huge page.
But because page->mapping is set to null,i can not get any further information how the issue happen.

So i modified the code as the patch show,and apply the new code to our produce line and wait some time,
then the issue come again.And this time i can know the whole file path which trigger the issue by using 
crash tool to get the inode、dentry and so on,that help me to find a way to reproduce the issue quite easily
and finally found the root cause and solve it.

I think if keep the page->mapping,we can even do the rmap to check more detail info too by using the crash tool to analyse the coredump.
So i think preservning the page state would more or less help to debug.
But if it is not so meaningful,just let it go. ^_^

Thank you for your time.

Best Regards

On Tue, Nov 13, 2018 at 9:04 PM Michal Hocko <mhocko@xxxxxxxxxx> wrote:
On Tue 13-11-18 20:38:16, Yongkai Wu wrote:
> It is better to keep page mapping info when free_huge_page() hit the
> VM_BUG_ON_PAGE,
> so we can get more infomation from the coredump for further analysis.

The patch seems to be whitespace damaged. Put that aside, have you
actually seen a case where preservning the page state would help to nail
down any bug.

I am not objecting to the patch, it actually makes some sense to me, I
am just curious about a background motivation.

> Signed-off-by: Yongkai Wu <nic_w@xxxxxxx>
> ---
>  mm/hugetlb.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index c007fb5..ba693bb 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1248,10 +1248,11 @@ void free_huge_page(struct page *page)
>   (struct hugepage_subpool *)page_private(page);
>   bool restore_reserve;
>
> +        VM_BUG_ON_PAGE(page_count(page), page);
> +        VM_BUG_ON_PAGE(page_mapcount(page), page);
> +
>   set_page_private(page, 0);
>   page->mapping = NULL;
> - VM_BUG_ON_PAGE(page_count(page), page);
> - VM_BUG_ON_PAGE(page_mapcount(page), page);
>   restore_reserve = PagePrivate(page);
>   ClearPagePrivate(page);
>
> --
> 1.8.3.1

--
Michal Hocko
SUSE Labs

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux