Re: ~500 megs cached yet 2.6.5 goes into swap hell

From: Pavel Machek
Date: Fri May 07 2004 - 09:28:04 EST


Hi!

> > > How on earth is the kernel supposed to know that for this one particular
> > > job you don't care if it takes 3 hours instead of 10 minutes,
> >
> > I'd pay ten bucks (yeah, I'm a cheapskate) for an option that I could
> > twiddle that would mark my nightly updatedb and backup jobs as ones to
> > use reduced memory footprint (both for file caching and backing user
> > virtual address space), even if it took much longer.
> >
> > So, rather than protest in mock outrage that it's impossible for the
> > kernel to know this, instead answer the question as stated in all
> > seriousness ... well ... how _could_ the kernel know, and what _could_
> > the kernel do if it knew. What mechanism(s) would be needed so that
> > the kernel could restrict a jobs memory usage?
>
> Two things:
>
> a) a knob to say "only reclaim pagecache". We have that now.
>
> b) a knob to say "reclaim vfs caches harder". That's simply a matter of boosting
> the return value from shrink_dcache_memory() and perhaps shrink_icache_memory().
>
> It's not quite what you're after, but it's close.

Perhaps what we really want is "swap_back_in" script? That way you
could do "updatedb; swap_back_in" in cron and be happy.

Pavel
--
When do you have heart between your knees?
-
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/