All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux-foundation.org>
To: David VomLehn <dvomlehn@cisco.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
	C Michael Sundius <Michael.sundius@sciatl.com>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mm@kvack.org, linux-mips@linux-mips.org,
	jfraser@broadcom.com, Andy Whitcroft <apw@shadowen.org>
Subject: Re: sparsemem support for mips with highmem
Date: Wed, 20 Aug 2008 15:51:23 -0500	[thread overview]
Message-ID: <48AC83CB.4000100@linux-foundation.org> (raw)
In-Reply-To: <48AC7056.8070903@cisco.com>

David VomLehn wrote:
> 
> For a flat memory model, the page descriptors array memmap is
> contiguously allocated in low memory. For sparse memory, you only
> allocate memory to hold page descriptors that actually exist. If you
> don't enable CONFIG_SPARSEMEM_VMEMMAP, you introduce a level of
> indirection where the top bits of an address gives you an index into an
> array that points to an array of page descriptors for that section of
> memory. This has some performance impact relative to flat memory due to
> the extra memory access to read the pointer to the array of page
> descriptors.

Right.

> If you do enable CONFIG_SPARSEMEM_VMEMMAP, you still allocate memory to
> hold page descriptors, but you map that memory into virtual space so
> that a given page descriptor for a physical address is at the offset
> from the beginning of the virtual memmap corresponding to the page frame
> number of that address. This gives you a single memmap, just like you
> had in the flat memory case, though memmap now lives in virtual address
> space. Since memmap now lives in virtual address space, you don't need
> to use any memory to back the virtual addresses that correspond to the
> holes in your physical memory, which is how you save a lot of physical
> memory. The performance impact relative to flag memory is now that of
> having to go through the TLB to get to the page descriptor.

Correct.

> If you are using CONFIG_SPARSEMEM_VMEMMAP and the corresponding TLB
> entry is present, you expect this will be faster than the extra memory
> access you do when CONFIG_SPARSEMEM_VMEMMAP is not enabled, even if that
> memory is in cache. This seems like a pretty reasonable expectation to
> me. Since TLB entries cover much more memory than the cache, it also
> seems like there would be a much better chance that you already have the
> corresponding TLB entry than having the indirect memory pointer in
> cache. And, in the worst case, reading the TLB entry is just another
> memory access, so it's closely equivalent to not enabling
> CONFIG_SPARSEMEM_VMEMMAP.

Exactly.

> So, if I understand this right, the overhead on a MIPS processor using
> flat memory versus using sparse memory with CONFIG_SPARSEMEM_VMEMMAP
> enabled would be mostly the difference between accessing unmapped
> memory, which doesn't go through the TLB, and mapped memory, which does.
> Even though there is some impact due to TLB misses, this should be
> pretty reasonable. What a way cool approach!

Great. Thanks.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Lameter <cl@linux-foundation.org>
To: David VomLehn <dvomlehn@cisco.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
	C Michael Sundius <Michael.sundius@sciatl.com>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mm@kvack.org, linux-mips@linux-mips.org,
	jfraser@broadcom.com, Andy Whitcroft <apw@shadowen.org>
Subject: Re: sparsemem support for mips with highmem
Date: Wed, 20 Aug 2008 15:51:23 -0500	[thread overview]
Message-ID: <48AC83CB.4000100@linux-foundation.org> (raw)
In-Reply-To: <48AC7056.8070903@cisco.com>

David VomLehn wrote:
> 
> For a flat memory model, the page descriptors array memmap is
> contiguously allocated in low memory. For sparse memory, you only
> allocate memory to hold page descriptors that actually exist. If you
> don't enable CONFIG_SPARSEMEM_VMEMMAP, you introduce a level of
> indirection where the top bits of an address gives you an index into an
> array that points to an array of page descriptors for that section of
> memory. This has some performance impact relative to flat memory due to
> the extra memory access to read the pointer to the array of page
> descriptors.

Right.

> If you do enable CONFIG_SPARSEMEM_VMEMMAP, you still allocate memory to
> hold page descriptors, but you map that memory into virtual space so
> that a given page descriptor for a physical address is at the offset
> from the beginning of the virtual memmap corresponding to the page frame
> number of that address. This gives you a single memmap, just like you
> had in the flat memory case, though memmap now lives in virtual address
> space. Since memmap now lives in virtual address space, you don't need
> to use any memory to back the virtual addresses that correspond to the
> holes in your physical memory, which is how you save a lot of physical
> memory. The performance impact relative to flag memory is now that of
> having to go through the TLB to get to the page descriptor.

Correct.

> If you are using CONFIG_SPARSEMEM_VMEMMAP and the corresponding TLB
> entry is present, you expect this will be faster than the extra memory
> access you do when CONFIG_SPARSEMEM_VMEMMAP is not enabled, even if that
> memory is in cache. This seems like a pretty reasonable expectation to
> me. Since TLB entries cover much more memory than the cache, it also
> seems like there would be a much better chance that you already have the
> corresponding TLB entry than having the indirect memory pointer in
> cache. And, in the worst case, reading the TLB entry is just another
> memory access, so it's closely equivalent to not enabling
> CONFIG_SPARSEMEM_VMEMMAP.

Exactly.

> So, if I understand this right, the overhead on a MIPS processor using
> flat memory versus using sparse memory with CONFIG_SPARSEMEM_VMEMMAP
> enabled would be mostly the difference between accessing unmapped
> memory, which doesn't go through the TLB, and mapped memory, which does.
> Even though there is some impact due to TLB misses, this should be
> pretty reasonable. What a way cool approach!

Great. Thanks.



--
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>

  reply	other threads:[~2008-08-20 20:51 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-14 22:05 sparsemem support for mips with highmem C Michael Sundius
2008-08-14 22:35 ` Dave Hansen
2008-08-14 22:35   ` Dave Hansen
2008-08-14 23:16   ` C Michael Sundius
2008-08-14 23:16     ` C Michael Sundius
2008-08-14 23:52   ` C Michael Sundius
2008-08-15  0:02     ` Dave Hansen
2008-08-15  0:02       ` Dave Hansen
2008-08-15  8:03     ` Thomas Bogendoerfer
2008-08-15  8:03       ` Thomas Bogendoerfer
2008-08-15 15:48       ` Dave Hansen
2008-08-15 15:48         ` Dave Hansen
2008-08-15 16:12         ` C Michael Sundius
2008-08-15 16:12           ` C Michael Sundius
2008-08-15 16:20           ` Dave Hansen
2008-08-15 16:20             ` Dave Hansen
2008-08-15 16:33           ` Thomas Bogendoerfer
2008-08-15 16:33             ` Thomas Bogendoerfer
2008-08-15 17:16             ` C Michael Sundius
2008-08-15 17:16               ` C Michael Sundius
2008-08-15 17:37               ` Dave Hansen
2008-08-15 17:37                 ` Dave Hansen
2008-08-15 18:17                 ` C Michael Sundius
2008-08-15 18:17                   ` C Michael Sundius
2008-08-15 18:23                   ` Dave Hansen
2008-08-15 18:23                     ` Dave Hansen
2008-08-16 20:07                     ` Thomas Bogendoerfer
2008-08-16 20:07                       ` Thomas Bogendoerfer
2008-08-18 16:44                   ` Randy Dunlap
2008-08-18 16:44                     ` Randy Dunlap
2008-08-18 21:24                     ` Christoph Lameter
2008-08-18 21:24                       ` Christoph Lameter
2008-08-18 21:27                       ` Dave Hansen
2008-08-18 21:27                         ` Dave Hansen
2008-08-18 21:33                         ` Christoph Lameter
2008-08-18 21:33                           ` Christoph Lameter
2009-01-16 21:46                           ` Michael Sundius
2009-01-16 21:46                             ` Michael Sundius
2009-01-21 14:39                             ` Christoph Lameter
2009-01-21 14:39                               ` Christoph Lameter
2008-08-18 21:57                       ` David VomLehn
2008-08-18 21:57                         ` David VomLehn
2008-08-19 13:06                         ` Christoph Lameter
2008-08-19 13:06                           ` Christoph Lameter
2008-08-19 23:38                           ` David VomLehn
2008-08-19 23:38                             ` David VomLehn
2008-08-19 23:53                             ` Jon Fraser
2008-08-19 23:53                               ` Jon Fraser
2008-08-20 13:58                             ` Christoph Lameter
2008-08-20 13:58                               ` Christoph Lameter
2008-08-20 19:28                               ` David VomLehn
2008-08-20 19:28                                 ` David VomLehn
2008-08-20 20:51                                 ` Christoph Lameter [this message]
2008-08-20 20:51                                   ` Christoph Lameter
2008-08-15 16:30         ` Thomas Bogendoerfer
2008-08-15 16:30           ` Thomas Bogendoerfer
2008-08-26  9:09     ` Andy Whitcroft
2008-08-26  9:09       ` Andy Whitcroft
2008-10-06 20:15       ` Have ever checked in your mips sparsemem code into mips-linux tree? C Michael Sundius

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=48AC83CB.4000100@linux-foundation.org \
    --to=cl@linux-foundation.org \
    --cc=Michael.sundius@sciatl.com \
    --cc=apw@shadowen.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=dvomlehn@cisco.com \
    --cc=jfraser@broadcom.com \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-mm@kvack.org \
    --cc=rdunlap@xenotime.net \
    --cc=tsbogend@alpha.franken.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.