public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: akpm@osdl.org, hch@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] Making compound pages mandatory
Date: Wed, 17 Nov 2004 11:43:09 +0000	[thread overview]
Message-ID: <17633.1100691789@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0411161746110.2222@ppc970.osdl.org>


> > Do you have any objection to compound pages being made mandatory, even
> > without HUGETLB support?
> 
> I haven't really looked into it, so I cannot make an informed decision.  
> How big is the overhead? And what's the _point_, since we don't seem to 
> need them normally, but the code is there for people who _do_ need them? 

The reason they might be useful under uClinux is that access_process_vm()
mucks around with pages in the middle of a high-order allocation.

Technically, with what was integrated to support uClinux and with the patch I
added, it's not actually necessary to use compound pages, I think, if only
because access_process_vm() provides some protections against munmap() and
exit().

However, that doesn't mean there isn't something I and the uClinux community
haven't noticed, or that situations won't arise in the future where the
current scheme is going to cause the kernel to explode.

> I don't generally like two paths, but quite frankly, I consider the
> non-compound case the regular case right now. How expensive does the
> compound pages end up being? Is it just one more pointer chase on every
> get_page/put_page, or what?

No, it's not. In put_page() it's _always_ going to be at least one more
pointer chase, and sometimes it's going to be two more; though the dcache may
offset this. put_page() refers not only to data in the first real page of a
compound page, but the second real page too.

Furthermore, put_page() becomes out of line. This means you've got register
clobberage and the mechanisms of function calls to deal with. Also you've got
more conditional instructions. I would propose also that the condition
checking for PG_compound be marked unlikely().

> Does anybody have numbers for before/after that are otherwise comparable?

I don't. However, the people hassling me about it might (hch for one).

David

      parent reply	other threads:[~2004-11-17 11:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-16 18:48 [RFC] Making compound pages mandatory David Howells
2004-11-16 19:20 ` Andrew Morton
2004-11-16 19:41   ` David Howells
2004-11-17  1:50 ` Linus Torvalds
2004-11-17  2:28   ` Andrew Morton
2004-11-17  3:13     ` Nick Piggin
2004-11-17  3:22       ` Nick Piggin
2004-11-17  3:37         ` Nick Piggin
2004-11-17  3:42           ` Nick Piggin
2004-11-17  3:14     ` Linus Torvalds
2004-11-17 12:03       ` David Howells
2004-11-17 11:47     ` David Howells
2004-11-17 11:43   ` David Howells [this message]

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=17633.1100691789@redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@osdl.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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