From: Satya <satyakiran@gmail.com>
To: "Benjamin Herrenschmidt" <benh@kernel.crashing.org>
Cc: kazutomo@mcs.anl.gov, linuxppc-dev@ozlabs.org,
edi@linux.vnet.ibm.com, david@gibson.dropbear.id.au
Subject: Re: hugetlbfs for ppc440 - kernel BUG -- follow up
Date: Tue, 17 Jul 2007 21:18:47 -0500 [thread overview]
Message-ID: <acbcf3840707171918h5dee75d9t96d6a62e8a0161fa@mail.gmail.com> (raw)
In-Reply-To: <1184723616.25235.186.camel@localhost.localdomain>
On 7/17/07, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> On Tue, 2007-07-17 at 16:07 -0500, Satya wrote:
> > hello,
> >
> > Upon investigating the below issue further, I found that
> > pte_alloc_map() calls kmap_atomic. The allocated pte page must be
> > unmapped before invoking any function that might_sleep.
> >
> > In this case clear_huge_page() is being called without invoking
> > pte_unmap(). The 'normal' counterpart of hugetlb_no_page (which is
> > do_no_page() in mm/memory.c) does call pte_unmap() before calling
> > alloc_page() (which might sleep).
> >
> > So, I believe pte_unmap() must be invoked first in hugetlb_no_page().
> > But the problem here is, we do not have a reference to the pmd to map
> > the pte again (using pte_offset_map()). The do_no_page() function does
> > have a pmd_t* parameter, so it can remap the pte when required.
> >
> > For now, I resolved the problem by expanding the pte_alloc_map() macro
> > by hand and replacing kmap_atomic with kmap(), although I think it is
> > not the right thing to do.
> >
> > Let me know if my analysis is helping you figure out the problem here. Thanks!
>
> Except that I don't see where pte_alloc_map() has been called before
> hand... hugetlb_no_page() is called by hugetlb_fault() which is called
> by __handle_mm_fault(), with no lock held.
>
the calling sequence is :
__handle_mm_fault -> hugetlb_fault -> huge_pte_alloc() -> pte_alloc_map()
where -> stands for 'calls'.
hugetlb_fault() calls hugetlb_no_page() after returning from huge_pte_alloc().
[huge_pte_alloc() is an arch specific call back implemented in the
patch referred to in my earlier posts]
Satya.
> Ben.
>
>
>
--
...what's remarkable, is that atoms have assembled into entities which
are somehow able to ponder their origins.
--
http://cs.uic.edu/~spopuri
next prev parent reply other threads:[~2007-07-18 2:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-17 21:07 hugetlbfs for ppc440 - kernel BUG -- follow up Satya
2007-07-18 1:53 ` Benjamin Herrenschmidt
2007-07-18 2:18 ` Satya [this message]
2007-07-18 3:01 ` Benjamin Herrenschmidt
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=acbcf3840707171918h5dee75d9t96d6a62e8a0161fa@mail.gmail.com \
--to=satyakiran@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=david@gibson.dropbear.id.au \
--cc=edi@linux.vnet.ibm.com \
--cc=kazutomo@mcs.anl.gov \
--cc=linuxppc-dev@ozlabs.org \
/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).