mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: Christoph Hellwig <hch@lst.de>, Mel Gorman <mel@skynet.ie>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [00/17] [RFC] Virtual Compound Page Support
Date: 19 Sep 2007 10:24:22 +0200	[thread overview]
Message-ID: <p73ejgvvz9l.fsf@bingen.suse.de> (raw)
In-Reply-To: <20070919033605.785839297@sgi.com>

Christoph Lameter <clameter@sgi.com> writes:

It seems like a good idea simply because the same functionality
is already open coded in a couple of places and unifying
that would be a good thing. But ...
 
> The patchset provides this functionality in stages. Stage 1 introduces
> the basic fall back mechanism necessary to replace vmalloc allocations
> with
> 
> 	alloc_page(GFP_VFALLBACK, order, ....)

Is there a reason this needs to be a GFP flag versus a wrapper
around alloc_page/free_page ?  page_alloc.c is already too complicated
and it's better to keep new features separated. The only drawback
would be that free_pages would need a different call, but that
doesn't seem like a big problem.

Especially integrating it into slab would seem wrong to me.
slab is already too complicated and for users who need that
large areas page granuality rounding to pages is probably fine.

Also such a wrapper could do the old alloc_page_exact() trick:
instead of always rounding up to next order return the left over
pages to the VM. In some cases this can save significant memory.

I'm also a little dubious about your attempts to do vmalloc in
interrupt context. Is that really needed? GFP_ATOMIC allocations of
large areas seem to be extremly unreliable to me and not design. Even
if it works sometimes free probably wouldn't work there due to the
flushes, which is very nasty. It would be better to drop that.

-Andi



> which signifies to the page allocator that a higher order is to be found
> but a virtual mapping may stand in if there is an issue with fragmentation.
> 
> Stage 1 functionality does not allow allocation and freeing of virtual
> mappings from interrupt contexts.
> 
> The stage 1 series ends with the conversion of a few key uses of vmalloc
> in the VM to alloc_pages() for the allocation of sparsemems memmap table
> and the wait table in each zone. Other uses of vmalloc could be converted
> in the same way.
> 
> 
> Stage 2 functionality enhances the fallback even more allowing allocation
> and frees in interrupt context.
> 
> SLUB is then modified to use the virtual mappings for slab caches
> that are marked with SLAB_VFALLBACK. If a slab cache is marked this way
> then we drop all the restraints regarding page order and allocate
> good large memory areas that fit lots of objects so that we rarely
> have to use the slow paths.
> 
> Two slab caches--the dentry cache and the buffer_heads--are then flagged
> that way. Others could be converted in the same way.
> 
> The patch set also provides a debugging aid through setting
> 
> 	CONFIG_VFALLBACK_ALWAYS
> 
> If set then all GFP_VFALLBACK allocations fall back to the virtual
> mappings. This is useful for verification tests. The test of this
> patch set was done by enabling that options and compiling a kernel.
> 
> 
> Stage 3 functionality could be the adding of support for the large
> buffer size patchset. Not done yet and not sure if it would be useful
> to do.
> 
> Much of this patchset may only be needed for special cases in which the
> existing defragmentation methods fail for some reason. It may be better to
> have the system operate without such a safety net and make sure that the
> page allocator can return large orders in a reliable way.
> 
> The initial idea for this patchset came from Nick Piggin's fsblock
> and from his arguments about reliability and guarantees. Since his
> fsblock uses the virtual mappings I think it is legitimate to
> generalize the use of virtual mappings to support higher order
> allocations in this way. The application of these ideas to the large
> block size patchset etc are straightforward. If wanted I can base
> the next rev of the largebuffer patchset on this one and implement
> fallback.
> 
> Contrary to Nick, I still doubt that any of this provides a "guarantee".
> Have said that I have to deal with various failure scenarios in the VM
> daily and I'd certainly like to see it work in a more reliable manner.
> 
> IMHO getting rid of the various workarounds to deal with the small 4k
> pages and avoiding additional layers that group these pages in subsystem
> specific ways is something that can simplify the kernel and make the
> kernel more reliable overall.
> 
> If people feel that a virtual fall back is needed then so be it. Maybe
> we can shed our security blanket later when the approaches to deal
> with fragmentation have matured.
> 
> The patch set is also available via git from the largeblock git tree via
> 
> git pull
>   git://git.kernel.org/pub/scm/linux/kernel/git/christoph/largeblocksize.git
>     vcompound
> 
> -- 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2007-09-19  8:24 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19  3:36 Christoph Lameter
2007-09-19  3:36 ` [01/17] Vmalloc: Move vmalloc_to_page to mm/vmalloc Christoph Lameter
2007-09-19  3:36 ` [02/17] Vmalloc: add const Christoph Lameter
2007-09-19  3:36 ` [03/17] is_vmalloc_addr(): Check if an address is within the vmalloc boundaries Christoph Lameter
2007-09-19  6:32   ` David Rientjes
2007-09-19  7:24     ` Anton Altaparmakov
2007-09-19  8:09       ` David Rientjes
2007-09-19  8:44         ` Anton Altaparmakov
2007-09-19  9:19           ` David Rientjes
2007-09-19 13:23             ` Anton Altaparmakov
2007-09-19 17:29           ` Christoph Lameter
2007-09-19 17:52             ` Anton Altaparmakov
2007-09-19 17:29       ` Christoph Lameter
2007-09-19 17:52         ` Anton Altaparmakov
2007-09-19  3:36 ` [04/17] vmalloc: clean up page array indexing Christoph Lameter
2007-09-19  3:36 ` [05/17] vunmap: return page array Christoph Lameter
2007-09-19  8:05   ` KAMEZAWA Hiroyuki
2007-09-19 22:15     ` Christoph Lameter
2007-09-20  0:47       ` KAMEZAWA Hiroyuki
2007-09-19  3:36 ` [06/17] vmalloc_address(): Determine vmalloc address from page struct Christoph Lameter
2007-09-19  3:36 ` [07/17] GFP_VFALLBACK: Allow fallback of compound pages to virtual mappings Christoph Lameter
2007-09-19  3:36 ` [08/17] Pass vmalloc address in page->private Christoph Lameter
2007-09-19  3:36 ` [09/17] VFALLBACK: Debugging aid Christoph Lameter
2007-09-19  3:36 ` [10/17] Use GFP_VFALLBACK for sparsemem Christoph Lameter
2007-09-19  3:36 ` [11/17] GFP_VFALLBACK for zone wait table Christoph Lameter
2007-09-19  3:36 ` [12/17] Virtual Compound page allocation from interrupt context Christoph Lameter
2007-09-19  3:36 ` [13/17] Virtual compound page freeing in " Christoph Lameter
2007-09-18 20:36   ` Nick Piggin
2007-09-20 17:50     ` Christoph Lameter
2007-09-19  3:36 ` [14/17] Allow bit_waitqueue to wait on a bit in a vmalloc area Christoph Lameter
2007-09-19  4:12   ` Gabriel C
2007-09-19 17:40     ` Christoph Lameter
2007-09-19  3:36 ` [15/17] SLUB: Support virtual fallback via SLAB_VFALLBACK Christoph Lameter
2007-09-27 21:42   ` Nick Piggin
2007-09-28 17:33     ` Christoph Lameter
2007-09-28  5:14       ` Nick Piggin
2007-10-01 20:50         ` Christoph Lameter
2007-10-02  8:43           ` Nick Piggin
2007-10-04 16:16           ` SLUB performance regression vs SLAB Matthew Wilcox
2007-10-04 17:38             ` Christoph Lameter
2007-10-04 17:50               ` Arjan van de Ven
2007-10-04 17:58                 ` Christoph Lameter
2007-10-04 18:26                 ` Peter Zijlstra
2007-10-04 20:48                 ` David Miller
2007-10-04 20:58                   ` Matthew Wilcox
2007-10-04 21:05                     ` David Miller
2007-10-04 21:11                     ` Christoph Lameter
2007-10-04 23:39                   ` David Schwartz
2007-10-04 23:49                     ` Chuck Ebbert
2007-10-05  4:18                       ` David Schwartz
2007-10-04 18:32               ` Matthew Wilcox
2007-10-04 17:49                 ` Christoph Lameter
2007-10-04 19:28                   ` Matthew Wilcox
2007-10-04 19:05                     ` Christoph Lameter
2007-10-04 19:46                       ` Siddha, Suresh B
2007-10-04 20:55                     ` David Miller
2007-10-04 21:02                       ` Chuck Ebbert
2007-10-04 21:11                         ` David Miller
2007-10-04 21:47                           ` Chuck Ebbert
2007-10-04 22:07                             ` David Miller
2007-10-04 22:23                               ` David Chinner
2007-10-05  6:48                                 ` Jens Axboe
2007-10-05  9:19                                   ` Pekka Enberg
2007-10-05  9:28                                     ` Jens Axboe
2007-10-05 11:12                                       ` Andi Kleen
2007-10-05 12:39                                         ` Jens Axboe
2007-10-05 19:31                                           ` Christoph Lameter
2007-10-05 19:32                                             ` Christoph Lameter
2007-10-05 11:56                                   ` Matthew Wilcox
2007-10-05 12:37                                     ` Jens Axboe
2007-10-05 19:27                                     ` Christoph Lameter
2007-10-05 20:32                         ` Peter Zijlstra
2007-10-05 21:31                           ` David Miller
2007-10-04 21:05                       ` Matthew Wilcox
2007-10-05  2:43                         ` Christoph Lameter
2007-10-05  2:53                           ` Arjan van de Ven
2007-09-28 17:55       ` [15/17] SLUB: Support virtual fallback via SLAB_VFALLBACK Peter Zijlstra
2007-09-28 18:20         ` Christoph Lameter
2007-09-28 18:25           ` Peter Zijlstra
2007-09-28 18:41             ` Christoph Lameter
2007-09-28 20:22               ` Nick Piggin
2007-09-28 21:14               ` Mel Gorman
2007-09-28 20:59             ` Mel Gorman
2007-09-29  8:13             ` Andrew Morton
2007-09-29  8:47               ` Peter Zijlstra
2007-09-29  8:53                 ` Peter Zijlstra
2007-09-29  9:01                   ` Andrew Morton
2007-09-29  9:14                     ` Peter Zijlstra
2007-09-29  9:27                       ` Andrew Morton
2007-09-28 20:19                         ` Nick Piggin
2007-09-29 19:20                           ` Andrew Morton
2007-09-29 19:09                             ` Nick Piggin
2007-09-30 20:12                               ` Andrew Morton
2007-09-30  4:16                                 ` Nick Piggin
2007-09-29  9:00                 ` Andrew Morton
2007-10-01 20:55                   ` Christoph Lameter
2007-10-01 21:30                     ` Andrew Morton
2007-10-01 21:38                       ` Christoph Lameter
2007-10-01 21:45                         ` Andrew Morton
2007-10-01 21:52                           ` Christoph Lameter
2007-10-02  9:19                       ` Peter Zijlstra
2007-09-29  8:45           ` Peter Zijlstra
2007-10-01 21:01             ` Christoph Lameter
2007-10-02  8:37               ` Nick Piggin
2007-09-28 21:05       ` Mel Gorman
2007-10-01 21:10         ` Christoph Lameter
2007-09-19  3:36 ` [16/17] Allow virtual fallback for buffer_heads Christoph Lameter
2007-09-19  3:36 ` [17/17] Allow virtual fallback for dentries Christoph Lameter
2007-09-19  7:34 ` [00/17] [RFC] Virtual Compound Page Support Anton Altaparmakov
2007-09-19  8:34   ` Eric Dumazet
2007-09-19 17:33     ` Christoph Lameter
2007-09-19  8:24 ` Andi Kleen [this message]
2007-09-19 17:36   ` Christoph Lameter

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=p73ejgvvz9l.fsf@bingen.suse.de \
    --to=andi@firstfloor.org \
    --cc=clameter@sgi.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mel@skynet.ie \
    /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

Powered by JetHome