Re: [patch] balanced highmem subsystem under pre7-9

Ingo Molnar
2000-05-12T19:36:13Z

On Fri, 12 May 2000, Linus Torvalds wrote:

> > i initially tested pre7-9 and it showed bad behavior: high kswapd activity
> > trying to balance highmem, while the pagecache is primarily filled from
> > the highmem. I dont think this can be fixed without 'silencing'
> > ZONE_HIGHMEM's balancing activities: the pagecache allocates from highmem
> > so it puts direct pressure on the highmem zone.
>
> If this is true, then that is a bug in the allocator.

i just re-checked final pre7-2.3.99, and saw similar behavior. Once
ZONE_HIGHMEM is empty kswapd eats ~6% CPU time (constantly running),
highmem freecount (in /proc/meminfo) fluctuating slightly above zero, but
pagecache is not growing anymore - although there is still lots of
ZONE_NORMAL RAM around.

> anyway. So before you touch the memory allocator logic, you might want to
> change the
>
> if (tsk->need_resched)
> schedule();
>
> to a
>
> if (tsk->need_resched)
> goto sleep;
>
> (and add a "sleep:" thing to inside the if-statement that makes us go to
> sleep). That way, if we end up scheduling away from kswapd, we won't waste
> time scheduling back unless we really should.

ok, will try this, and will try to find where it fails.

Ingo