Re: several messages
From: Bill Davidsen
Date: Tue May 11 2004 - 13:03:24 EST
Thank all of you for this information. This is an interesting way to
overcome the kernel memory fragmentation issue. I would have thought it
was more important to address having the memory so fragmented that there
is no 8k chunk left "even with many megabytes free" as someone wrote.
On Mon, 10 May 2004, Horst von Brand wrote:
> Bill Davidsen <davidsen@xxxxxxx> said:
> > I tried 4k stack, I couldn't measure any improvement in anything (as in
> > no visible speedup or saving in memory).
> 4K stacks lets the kernel create new threads/processes as long as there is
> free memory; with 8K stacks it needs two consecutive free page frames in
> physical memory, when memory is fragmented (and large) they are hard to
> come by...
> Dr. Horst H. von Brand User #22616 counter.li.org
> Departamento de Informatica Fono: +56 32 654431
> Universidad Tecnica Federico Santa Maria +56 32 654239
> Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513
On Mon, 10 May 2004, Andrew Morton wrote:
> Horst von Brand <vonbrand@xxxxxxxxxxxx> wrote:
> > Bill Davidsen <davidsen@xxxxxxx> said:
> > [...]
> > > I tried 4k stack, I couldn't measure any improvement in anything (as in
> > > no visible speedup or saving in memory).
> > 4K stacks lets the kernel create new threads/processes as long as there is
> > free memory; with 8K stacks it needs two consecutive free page frames in
> > physical memory, when memory is fragmented (and large) they are hard to
> > come by...
> This is true to a surprising extent. A couple of weeks ago I observed my
> 256MB box freeing over 20MB of pages before it could successfully acquire a
> single 1-order page.
> That was during an updatedb run.
> And a 1-order GFP_NOFS allocation was actually livelocking, because
> !__GFP_FS allocations aren't allowed to enter dentry reclaim. Which is why
> VFS caches are now forced to use 0-order allocations.
On Tue, 11 May 2004, Helge Hafting wrote:
> Bill Davidsen wrote:
> > Arjan van de Ven wrote:
> >>> It's probably a Bad Idea to push this to Linus before the vendors
> >>> that have
> >>> significant market-impact issues (again - anybody other than NVidia
> >>> here?)
> >>> have gotten their stuff cleaned up...
> >> Ok I don't want to start a flamewar but... Do we want to hold linux back
> >> until all binary only module vendors have caught up ??
> > My questions is, hold it back from what? Having the 4k option is fine,
> > it's just eliminating the current default which I think is
> > undesirable. I tried 4k stack, I couldn't measure any improvement in
> > anything (as in no visible speedup or saving in memory).
> The memory saving is usually modest: 4k per thread. It might make a
> difference for
> those with many thousands of threads. I believe this is unswappable
> which is much more valuable than ordinary process memory.
> More interesting is that it removes one way for fork() to fail. With 8k
> the new process needs to allocate two consecutive pages for those 8k. That
> might be impossible due to fragmentation, even if there are megabytes of
> memory. Such a problem usually only shows up after a long time. Now we
> only need to
> allocate a single page, which always works as long as there is any free
> memory at all.
> > For an embedded system, where space is tight and the code paths well
> > known, sure, but I haven't been able to find or generate any objective
> > improvement, other than some posts saying smaller is always better.
> > Nothing slows a system down like a crash, even if it isn't followed by
> > a restore from backup.
> Consider the case when your server (web/mail/other) fails to fork, and then
> you can't login because that requires fork() too. 4k stacks remove this
> and is a stability improvement.
> Helge Hafting
bill davidsen <davidsen@xxxxxxx>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/