Re: [PATCH 08/10] mm: vmscan: Have kswapd shrink slab only once per priority

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 10, 2013 at 02:21:42PM +0900, Joonsoo Kim wrote:
> > > > @@ -2673,9 +2674,15 @@ static bool kswapd_shrink_zone(struct zone *zone,
> > > >  	sc->nr_to_reclaim = max(SWAP_CLUSTER_MAX, high_wmark_pages(zone));
> > > >  	shrink_zone(zone, sc);
> > > >  
> > > > -	reclaim_state->reclaimed_slab = 0;
> > > > -	nr_slab = shrink_slab(&shrink, sc->nr_scanned, lru_pages);
> > > > -	sc->nr_reclaimed += reclaim_state->reclaimed_slab;
> > > > +	/*
> > > > +	 * Slabs are shrunk for each zone once per priority or if the zone
> > > > +	 * being balanced is otherwise unreclaimable
> > > > +	 */
> > > > +	if (shrinking_slab || !zone_reclaimable(zone)) {
> > > > +		reclaim_state->reclaimed_slab = 0;
> > > > +		nr_slab = shrink_slab(&shrink, sc->nr_scanned, lru_pages);
> > > > +		sc->nr_reclaimed += reclaim_state->reclaimed_slab;
> > > > +	}
> > > >  
> > > >  	if (nr_slab == 0 && !zone_reclaimable(zone))
> > > >  		zone->all_unreclaimable = 1;
> > > 
> > > Why shrink_slab() is called here?
> > 
> > Preserves existing behaviour.
> 
> Yes, but, with this patch, existing behaviour is changed, that is, we call
> shrink_slab() once per priority. For now, there is no reason this function
> is called here. How about separating it and executing it outside of
> zone loop?
> 

We are calling it fewer times but it's still receiving the same information
from sc->nr_scanned it received before. With the change you are suggesting
it would be necessary to accumulating sc->nr_scanned for each zone shrunk
and then pass the sum to shrink_slab() once per priority. While this is not
necessarily wrong, there is little or no motivation to alter the shrinkers
in this manner in this series.

-- 
Mel Gorman
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]