From: Hugh Dickins <hugh.dickins@tiscali.co.uk>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: linux-mm@kvack.org, Mel Gorman <mel@csn.ul.ie>
Subject: Re: mm/hugetlb: GFP_KERNEL allocation under spinlock?
Date: Sun, 2 Aug 2009 11:54:13 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0908021131080.11578@sister.anvils> (raw)
In-Reply-To: <4A755201.1010200@gmail.com>
On Sun, 2 Aug 2009, Jiri Slaby wrote:
>
> could anybody please confirm this cannot happen?
I'm no authority on hugetlb.c nowadays: you'll have studied this
in more detail than I have, so please don't believe me. (And I'm
no longer at my old address, but lkml's enjoying a quiet Sunday.)
>
> hugetlb_fault()
> -> spin_lock()
> -> hugetlb_cow()
> -> alloc_huge_page()
> -> vma_needs_reservation()
> -> region_chg() (either of the 2)
> -> kmalloc(*, GFP_KERNEL)
>
> Thanks.
That should be taken care of by the successful vma_needs_reservation()
on the same address in hugetlb_fault(), before taking page_table_lock,
shouldn't it?
It is possible that a hugetlb_vmtruncate() comes in between that
vma_needs_reservation() and taking the page_table_lock, which could
remove the region (or "nrg") needed.
But if that's the case then the pte_same test immediately after taking
page_table_lock should catch it: we're in the part of hugetlb_fault()
dealing with !huge_pte_none, whereas truncation would have made it
huge_pte_none (and it won't get to freeing the reservations before
it's nullified the page tables, holding page_table_lock).
Hugh
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-08-02 10:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-02 8:44 Jiri Slaby
2009-08-02 10:54 ` Hugh Dickins [this message]
2009-08-04 11:48 ` Mel Gorman
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=Pine.LNX.4.64.0908021131080.11578@sister.anvils \
--to=hugh.dickins@tiscali.co.uk \
--cc=jirislaby@gmail.com \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/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