From: Andrew Morton <akpm@osdl.org>
To: Ray Bryant <raybry@sgi.com>
Cc: ak@suse.de, lse-tech@lists.sourceforge.net,
linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Lse-tech] Re: Hugetlbpages in very large memory
Date: Sun, 14 Mar 2004 08:57:37 +0000 [thread overview]
Message-ID: <20040314005737.7f57b8ad.akpm@osdl.org> (raw)
In-Reply-To: <40541A09.3050600@sgi.com>
Ray Bryant <raybry@sgi.com> wrote:
>
>
> I agree with the compatibility concern, but the other part of the problem
> is that while hugetlb_prefault() is running, it holds both the mm->mmap_sem in
> write mode and the mm->page_table_lock. So not only does it take 500 s for
> the mmap() to return on our test system, but ps, top, etc all freeze for the
> duration. Very irritating, especially on a 64 or 128 P system.
Well that's just a dumb implementation. hugetlb_prefault() doesn't need
page_table_lock while it is zeroing the page: just drop it, test for
-EEXIST returned from add_to_page_cache().
In fact we need to do that anyway: the current code is buggy if some other
process with a different mm gets in there and instantiates the page in the
pagecache before this process does: hugetlb_prefault() will return -EEXIST
instead of simply accepting the race and using the page which someone else
put there.
After we have the page in pagecache we need to retake page_table_lock and
check that the target pte is still pte_none(). If it is not, you know that
some other thread has already instantiated a pte there so the new ref to
the pagecache page can simply be dropped. See how do_no_page() handles it.
Of course, this only applies if mmap_sem is no longer held in there.
As for holding mmap_sem for too long, well, that can presumably be worked
around by not mmapping the whole lot in one hit?
next prev parent reply other threads:[~2004-03-14 8:57 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-13 3:44 Hugetlbpages in very large memory machines Ray Bryant
2004-03-13 3:45 ` Ray Bryant
2004-03-13 3:48 ` Andi Kleen
2004-03-13 5:49 ` William Lee Irwin III
2004-03-13 16:10 ` [Lse-tech] " Andi Kleen
2004-03-14 0:05 ` William Lee Irwin III
2004-03-14 5:22 ` Peter Chubb
2004-03-15 23:31 ` Seth, Rohit
2004-03-14 2:45 ` Andrew Morton
2004-03-14 4:06 ` [Lse-tech] " Anton Blanchard
2004-03-17 19:05 ` [Lse-tech] Re: Hugetlbpages in very large memory Andy Whitcroft
2004-03-18 20:25 ` Andrew Morton
2004-03-18 21:22 ` Stephen Smalley
2004-03-18 22:21 ` Andy Whitcroft
2004-03-23 17:30 ` Andy Whitcroft
2004-03-24 17:38 ` Andy Whitcroft
2004-03-14 8:38 ` [Lse-tech] Re: Hugetlbpages in very large memory machines Ray Bryant
2004-03-14 8:48 ` William Lee Irwin III
2004-03-14 8:57 ` Andrew Morton [this message]
2004-03-14 9:02 ` [Lse-tech] Re: Hugetlbpages in very large memory Andrew Morton
2004-03-14 9:07 ` [Lse-tech] Re: Hugetlbpages in very large memory machines William Lee Irwin III
2004-03-15 6:45 ` Ray Bryant
2004-03-15 23:54 ` William Lee Irwin III
2004-03-13 3:55 ` William Lee Irwin III
2004-03-13 4:56 ` Hirokazu Takahashi
2004-03-16 0:30 ` Nobuhiko Yoshida
2004-03-16 1:54 ` Andi Kleen
2004-03-16 2:32 ` Hirokazu Takahashi
2004-03-16 3:20 ` Hirokazu Takahashi
2004-03-16 3:15 ` Nobuhiko Yoshida
2004-04-01 9:10 ` Nobuhiko Yoshida
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=20040314005737.7f57b8ad.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=ak@suse.de \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=raybry@sgi.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