linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: linux-mm <linux-mm@kvack.org>
Subject: Re: [BUG]thp: BUG at mm/huge_memory.c:1350
Date: Fri, 21 Jan 2011 19:14:42 +0100	[thread overview]
Message-ID: <20110121181442.GK9506@random.random> (raw)
In-Reply-To: <20110121175843.GA1534@barrios-desktop>

On Sat, Jan 22, 2011 at 02:58:43AM +0900, Minchan Kim wrote:
> I tested it again with some printk and I knew why it is out of memory.
> 
> do_page_fault(for write)
> -> do_huge_pmd_anonymous_page
>         -> alloc_hugepage_vma
> 
> Above is repeated by almost 400 times. It means 2M * 400 = 800M usage in my 2G system.
> Fragement can cause reclaim.
> Interesting one is that above is repeated by same faulty address of same process as looping.
> 
> Apparently, do_huge_pmd_anonymous_page maps pmd to entry.
> Nonetheless, page faults are repeated by same address.
> It seems set_pmd_at is nop.
> 
> Do you have any idea?

Well clearly 32bit x86 wasn't well tested... Maybe we should
temporarily disable the config option on x86 32bit.

> Sometime Xorg, Sometime kswapd, Sometime plymouthd, Sometime fsck.

That's good. So the most likely explanation of that BUG_ON you hit, is
the same bug that causes do_huge_pmd_anonymous_page to flood on the
same address (clearly if CPU can't solve the TLB miss using the
hugepmd, the rmap walk of split_huge_page will also fail to find the
page in the hugepmd, so it makes perfect sense).

That BUG_ON is by far my worst nightmare (that rmap walk of
split_huge_page must be as accurate as the
remove_migration_ptes/rmap_walk of migrate, it can't miss a hugepmd or
it'll be trouble, just like remove_migration_ptes/rmap_walk can't miss
a pte or it'll be trouble) and as far as common code is concerned I
had zero outstanding problems with it for a long time already, so
given your early debug info, I'm already optimistic and relieved that
64bit is not affected by this and this isn't a generic common code
issue and the most likely explanation is some silly arch specific bug
that sets the pmd wrong and affects the page fault too (not just the
rmap walk).

I'll try to reproduce. Checking the pagetable layout of the process at
the second page fault in the same address sounds good start to figure
out what's wrong on x86_32.

Thanks a lot for the help!
Andrea

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-01-21 18:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 15:49 [BUG]thp: BUG at mm/huge_memory.c:1350 Minchan Kim
2011-01-20 16:14 ` Andrea Arcangeli
2011-01-20 16:41   ` Minchan Kim
2011-01-21 17:58     ` Minchan Kim
2011-01-21 18:14       ` Andrea Arcangeli [this message]
2011-01-22  0:59         ` Minchan Kim
2011-01-22  1:08           ` Andrea Arcangeli
2011-01-22  2:16             ` Andrea Arcangeli
2011-01-22  2:20               ` Minchan Kim

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=20110121181442.GK9506@random.random \
    --to=aarcange@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=minchan.kim@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).