Re: [PATCH] slabasap-mm5_A2

Andrew Morton
2002-09-08T20:54:24Z

Andrew Morton wrote:
>
> ...
> If we have the pruner callbacks then vmscan can just do:
>
> kmem_shrink_stuff(ratio);
>
> and then kmem_shrink_stuff() can do:
>
> cachep->nr_to_prune += cacheb->inuse / ratio;
> if (cachep->nr_to_prune > cachep->prune_batch) {
> int prune = cachep->nr_to_prune;
>
> cachep->nr_to_prune = 0;
> (*cachep->pruner)(nr_to_prune);
> }

OK, I get it. `ratio' here can easily be 100,000, which would
result in zero objects to prune all the time. So it's

cachep->nr_to_prune += cacheb->inuse / ratio + 1;

yes?