public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [00/14] Virtual Compound Page Support V3
@ 2008-03-21  6:17 Christoph Lameter
  2008-03-21  6:17 ` [01/14] vcompound: Return page array on vunmap Christoph Lameter
                   ` (14 more replies)
  0 siblings, 15 replies; 89+ messages in thread
From: Christoph Lameter @ 2008-03-21  6:17 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel

Allocations of larger pages are not reliable in Linux. If larger
pages have to be allocated then one faces various choices of allowing
graceful fallback or using vmalloc with a performance penalty due
to the use of a page table. Virtual Compound pages are
a simple solution out of this dilemma.

A virtual compound allocation means that there will be first of all
an attempt to satisfy the request with physically contiguous memory.
If that is not possible then a virtually contiguous memory will be
created.

This has two advantages:

1. Current uses of vmalloc can be converted to allocate virtual
   compounds instead. In most cases physically contiguous
   memory can be used which avoids the vmalloc performance
   penalty. See f.e. the e1000 driver patch.

2. Uses of higher order allocations (stacks, buffers etc) can be
   converted to use virtual compounds instead. Physically contiguous
   memory will still be used for those higher order allocs in general
   but the system can degrade to the use of vmalloc should memory
   become heavily fragmented.

There is a compile time option to switch on fallback for
testing purposes. Virtually mapped mmemory may behave differently
and the CONFIG_FALLBACK_ALWAYS option will ensure that the code is
tested to deal with virtual memory.

V2->V3:
- Put the code into mm/vmalloc.c and leave the page allocator alone.
- Add a series of examples where virtual compound pages can be used.
- Diffed on top of the page flags and the vmalloc info patches
  already in mm.
- Simplify things by omitting some of the more complex code
  that used to be in there.

V1->V2
- Remove some cleanup patches and the SLUB patches from this set.
- Transparent vcompound support through page_address() and
  virt_to_head_page().
- Additional use cases.
- Factor the code better for an easier read
- Add configurable stack size.
- Follow up on various suggestions made for V1

RFC->V1
- Complete support for all compound functions for virtual compound pages
  (including the compound_nth_page() necessary for LBS mmap support)
- Fix various bugs
- Fix i386 build

-- 

^ permalink raw reply	[flat|nested] 89+ messages in thread
* Re: larger default page sizes...
@ 2008-03-25 23:47 J.C. Pizarro
  2008-03-26 15:57 ` H. Peter Anvin
  0 siblings, 1 reply; 89+ messages in thread
From: J.C. Pizarro @ 2008-03-25 23:47 UTC (permalink / raw)
  To: David Miller, LKML

On Tue, 25 Mar 2008 16:22:44 -0700 (PDT), David Miller wrote:
> > On Mon, 24 Mar 2008, David Miller wrote:
> >
> > > There are ways to get large pages into the process address space for
> > > compute bound tasks, without suffering the well known negative side
> > > effects of using larger pages for everything.
> >
> > These hacks have limitations. F.e. they do not deal with I/O and
> > require application changes.
>
> Transparent automatic hugepages are definitely doable, I don't know
> why you think this requires application changes.
>
> People want these larger pages for HPC apps.

But there is a general problem of larger pages in systems that
don't support them natively (in hardware) depending in how it's
implemented the memory manager in the kernel:

   "Doubling the soft page size implies
      halfing the TLB soft-entries in the old hardware".

   "x4 soft page size=> 1/4 TLB soft-entries, ... and so on."

Assuming one soft double-sized page represents 2 real-sized pages,
one replacing of one soft double-sized page implies replacing
2 TLB's entries containing the 2 real-sized pages.

The TLB is very small, its entries are around 24 entries aprox. in
some processors!.

Assuming soft 64 KiB page using real 4 KiB pages => 1/16 TLB soft-entries.
If the TLB has 24 entries then calculating 24/16=1.5 soft-entries,
   the TLB will have only 1 soft-entry for soft 64 KiB pages!!! Weird!!!

The normal soft sizes are 8 KiB or 16 KiB for non-native processors, not more.
  So, the TLB of 24 entries of real 4 KiB will have 12 or 6
soft-entries respect.

^ permalink raw reply	[flat|nested] 89+ messages in thread

end of thread, other threads:[~2008-03-27  3:00 UTC | newest]

Thread overview: 89+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-21  6:17 [00/14] Virtual Compound Page Support V3 Christoph Lameter
2008-03-21  6:17 ` [01/14] vcompound: Return page array on vunmap Christoph Lameter
2008-03-21  6:17 ` [02/14] vcompound: pageflags: Add PageVcompound() Christoph Lameter
2008-03-21  6:17 ` [03/14] vmallocinfo: Support display of vcompound for a virtual compound page Christoph Lameter
2008-03-21  7:55   ` Eric Dumazet
2008-03-21 17:32     ` Christoph Lameter
2008-03-21  6:17 ` [04/14] vcompound: Core piece Christoph Lameter
2008-03-22 12:10   ` KOSAKI Motohiro
2008-03-24 18:28     ` Christoph Lameter
2008-03-21  6:17 ` [05/14] vcompound: Debugging aid Christoph Lameter
2008-03-21  6:17 ` [06/14] vcompound: Virtual fallback for sparsemem Christoph Lameter
2008-03-21  6:17 ` [07/14] vcompound: bit waitqueue support Christoph Lameter
2008-03-21  6:17 ` [08/14] vcompound: Fallback for zone wait table Christoph Lameter
2008-03-21  6:17 ` [09/14] vcompound: crypto: Fallback for temporary order 2 allocation Christoph Lameter
2008-03-21  6:17 ` [10/14] vcompound: slub: Use for buffer to correlate allocation addresses Christoph Lameter
2008-03-21  6:17 ` [11/14] vcompound: Fallbacks for order 1 stack allocations on IA64 and x86 Christoph Lameter
2008-03-21  7:25   ` David Miller
2008-03-21  8:39     ` Ingo Molnar
2008-03-21 17:33       ` Christoph Lameter
2008-03-21 19:02         ` Ingo Molnar
2008-03-21 19:04           ` Christoph Lameter
2008-03-21 17:40     ` Christoph Lameter
2008-03-21 21:57       ` David Miller
2008-03-24 18:27         ` Christoph Lameter
2008-03-24 20:37           ` larger default page sizes David Miller
2008-03-24 21:05             ` Christoph Lameter
2008-03-24 21:43               ` David Miller
2008-03-25 17:48                 ` Christoph Lameter
2008-03-25 23:22                   ` David Miller
2008-03-25 23:41                     ` Peter Chubb
2008-03-25 23:49                       ` David Miller
2008-03-26  0:25                         ` Peter Chubb
2008-03-26  0:31                           ` David Miller
2008-03-26  0:34                       ` David Mosberger-Tang
2008-03-26  0:39                         ` David Miller
2008-03-26  0:57                         ` Peter Chubb
2008-03-26  4:16                           ` John Marvin
2008-03-26  4:36                             ` David Miller
2008-03-24 21:25             ` Luck, Tony
2008-03-24 21:46               ` David Miller
2008-03-25  3:29             ` Paul Mackerras
2008-03-25  4:15               ` David Miller
2008-03-25 11:50                 ` Paul Mackerras
2008-03-25 23:32                   ` David Miller
2008-03-25 23:49                     ` Luck, Tony
2008-03-26  0:16                       ` David Miller
2008-03-26 15:54                       ` Nish Aravamudan
2008-03-26 17:05                         ` Luck, Tony
2008-03-26 18:54                           ` Mel Gorman
2008-03-25 12:05               ` Andi Kleen
2008-03-25 21:27                 ` Paul Mackerras
2008-03-26  5:24                 ` Paul Mackerras
2008-03-26 15:59                   ` Linus Torvalds
2008-03-27  1:08                     ` Paul Mackerras
2008-03-26 17:56                   ` Christoph Lameter
2008-03-26 23:21                     ` David Miller
2008-03-27  3:00                     ` Paul Mackerras
2008-03-25 18:27               ` Dave Hansen
2008-03-24 21:13           ` [11/14] vcompound: Fallbacks for order 1 stack allocations on IA64 and x86 Luck, Tony
2008-03-25 17:42             ` Christoph Lameter
2008-03-25 19:09               ` Luck, Tony
2008-03-25 19:25                 ` Christoph Lameter
2008-03-21 22:30   ` Andi Kleen
2008-03-24 19:53     ` Christoph Lameter
2008-03-25  7:51       ` Andi Kleen
2008-03-25 17:55         ` Christoph Lameter
2008-03-25 18:07           ` Andi Kleen
2008-03-21  6:17 ` [12/14] vcompound: Avoid vmalloc in e1000 driver Christoph Lameter
2008-03-21 17:27   ` Kok, Auke
2008-03-21  6:17 ` [13/14] vcompound: Use vcompound for swap_map Christoph Lameter
2008-03-21 21:25   ` Andi Kleen
2008-03-21 21:33     ` Christoph Lameter
2008-03-24 19:54     ` Christoph Lameter
2008-03-25  7:52       ` Andi Kleen
2008-03-25 17:45         ` Christoph Lameter
2008-03-25 17:55           ` Andi Kleen
2008-03-25 17:51             ` Christoph Lameter
2008-03-21  6:17 ` [14/14] vcompound: Avoid vmalloc for ehash_locks Christoph Lameter
2008-03-21  7:02   ` Eric Dumazet
2008-03-21  7:03     ` Christoph Lameter
2008-03-21  7:31       ` David Miller
2008-03-21  7:42         ` Eric Dumazet
2008-03-21  7:31     ` David Miller
2008-03-21 17:31       ` Christoph Lameter
2008-03-22 18:40 ` [00/14] Virtual Compound Page Support V3 Arjan van de Ven
2008-03-24 18:31   ` Christoph Lameter
2008-03-24 19:29     ` Christoph Lameter
  -- strict thread matches above, loose matches on Subject: below --
2008-03-25 23:47 larger default page sizes J.C. Pizarro
2008-03-26 15:57 ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox