From: "'David Gibson'" <david@gibson.dropbear.id.au>
To: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org,
lse-tech@lists.sourceforge.net, raybry@sgi.com,
'Andy Whitcroft' <apw@shadowen.org>,
'Andrew Morton' <akpm@osdl.org>
Subject: Re: hugetlb demand paging patch part [2/3]
Date: Fri, 16 Apr 2004 04:49:17 +0000 [thread overview]
Message-ID: <20040416044917.GB26707@zax> (raw)
In-Reply-To: <200404160413.i3G4DcF13729@unix-os.sc.intel.com>
On Thu, Apr 15, 2004 at 09:13:38PM -0700, Chen, Kenneth W wrote:
> David Gibson wrote on Thursday, April 15, 2004 8:27 PM
> > Ah! So it's just an optimiziation - it makes a bit more sense to me
> > now. I had assumed that this case (hugepage get_user_pages()) would
> > be sufficiently rare that it would not require optimization.
> > Apparently not.
>
> It's a huge deal because for *every* I/O, kernel has to do get_user_pages()
> to lock the page, it's really gets in the way with the spin_lock as well.
>
> spin_lock(&mm->page_table_lock);
> do {
> struct page *map;
> int lookup_write = write;
> while (!(map = follow_page(mm, start, lookup_write))) {
>
> With current state of art platform, I/O requirement pushes into 200K
> per second, this become quite significant.
Ok. This makes sense now that you explain it.
> > Do you know where the cycles are going without this optimization? In
> > particular, could it be just the find_vma() in hugepage_vma() called
> > before follow_huge_addr()? I note that IA64 is the only arch to have
> > a non-trivial hugepage_vma()/follow_huge_addr() and that its
> > follow_huge_addr() doesn't actually use the vma passed in.
>
> That's one, plus the spin lock mentioned above.
And akpm has just explained why it can be avoided in the hugepage
case.
> > If we could get rid of follow_hugetlb_pages() it would remove an ugly
> > function from every arch, which would be nice.
>
> I hope the goal here is not to trim code for existing prefaulting scheme.
> That function has to go for demand paging, and demand paging comes with
> a performance price most people don't realize. If the goal here is to
> make the code prettier, I vote against that.
Well, I'm attempting to understand the hugepage code across all the
archs, so that I can try to implement copy-on-write with a minimum of
arch specific gunk. Simplifying and consolidating the existing code
across archs would be a helpful first step, if possible.
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
next prev parent reply other threads:[~2004-04-16 4:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-13 23:22 hugetlb demand paging patch part [2/3] Chen, Kenneth W
2004-04-15 7:17 ` David Gibson
2004-04-15 17:27 ` Chen, Kenneth W
2004-04-16 2:34 ` 'David Gibson'
2004-04-16 2:58 ` Chen, Kenneth W
2004-04-16 3:27 ` 'David Gibson'
2004-04-16 4:13 ` Chen, Kenneth W
2004-04-16 4:49 ` 'David Gibson' [this message]
2004-04-16 19:05 ` Ray Bryant
2004-04-17 12:05 ` 'David Gibson'
2004-04-18 17:36 ` [Lse-tech] " Ray Bryant
2004-04-19 0:47 ` 'David Gibson'
2004-04-16 5:56 ` Chen, Kenneth W
2004-04-16 6:15 ` 'David Gibson'
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=20040416044917.GB26707@zax \
--to=david@gibson.dropbear.id.au \
--cc=akpm@osdl.org \
--cc=apw@shadowen.org \
--cc=kenneth.w.chen@intel.com \
--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