Re: [PATCH] vmscan: ZVC updates in shrink_active_list() can be done once

From: Minchan Kim
Date: Mon May 04 2009 - 22:46:25 EST


Reviewed-by: Minchan Kim <minchan.kim@xxxxxxxxx>

This fine-grained ZVC update in shrink_active_list was made for
determination problem of the dirty
ratio(c878538598d1e7ab41ecc0de8894e34e2fdef630).
The 32 page reclaim time in normal reclaim situation is too short to
change current VM behavior.
So I think this make sense to me.

On Tue, May 5, 2009 at 8:44 AM, Wu Fengguang <fengguang.wu@xxxxxxxxx> wrote:
> This effectively lifts the unit of nr_inactive_* and pgdeactivate updates
> from PAGEVEC_SIZE=14 to SWAP_CLUSTER_MAX=32.
>
> Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
> ---
> Âmm/vmscan.c | Â 11 +++--------
> Â1 file changed, 3 insertions(+), 8 deletions(-)
>
> --- linux.orig/mm/vmscan.c
> +++ linux/mm/vmscan.c
> @@ -1228,7 +1228,6 @@ static void shrink_active_list(unsigned
> Â Â Â Â Â Â Â Â Â Â Â Âstruct scan_control *sc, int priority, int file)
> Â{
> Â Â Â Âunsigned long pgmoved;
> - Â Â Â int pgdeactivate = 0;
> Â Â Â Âunsigned long pgscanned;
> Â Â Â ÂLIST_HEAD(l_hold); Â Â Â/* The pages which were snipped off */
> Â Â Â ÂLIST_HEAD(l_inactive);
> @@ -1257,7 +1256,7 @@ static void shrink_active_list(unsigned
> Â Â Â Â Â Â Â Â__mod_zone_page_state(zone, NR_ACTIVE_ANON, -pgmoved);
> Â Â Â Âspin_unlock_irq(&zone->lru_lock);
>
> - Â Â Â pgmoved = 0;
> + Â Â Â pgmoved = 0; Â/* count referenced (mapping) mapped pages */
> Â Â Â Âwhile (!list_empty(&l_hold)) {
> Â Â Â Â Â Â Â Âcond_resched();
> Â Â Â Â Â Â Â Âpage = lru_to_page(&l_hold);
> @@ -1291,7 +1290,7 @@ static void shrink_active_list(unsigned
> Â Â Â Â */
> Â Â Â Âreclaim_stat->recent_rotated[!!file] += pgmoved;
>
> - Â Â Â pgmoved = 0;
> + Â Â Â pgmoved = 0; Â/* count pages moved to inactive list */
> Â Â Â Âwhile (!list_empty(&l_inactive)) {
> Â Â Â Â Â Â Â Âpage = lru_to_page(&l_inactive);
> Â Â Â Â Â Â Â Âprefetchw_prev_lru_page(page, &l_inactive, flags);
> @@ -1304,10 +1303,7 @@ static void shrink_active_list(unsigned
> Â Â Â Â Â Â Â Âmem_cgroup_add_lru_list(page, lru);
> Â Â Â Â Â Â Â Âpgmoved++;
> Â Â Â Â Â Â Â Âif (!pagevec_add(&pvec, page)) {
> - Â Â Â Â Â Â Â Â Â Â Â __mod_zone_page_state(zone, NR_LRU_BASE + lru, pgmoved);
> Â Â Â Â Â Â Â Â Â Â Â Âspin_unlock_irq(&zone->lru_lock);
> - Â Â Â Â Â Â Â Â Â Â Â pgdeactivate += pgmoved;
> - Â Â Â Â Â Â Â Â Â Â Â pgmoved = 0;
> Â Â Â Â Â Â Â Â Â Â Â Âif (buffer_heads_over_limit)
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âpagevec_strip(&pvec);
> Â Â Â Â Â Â Â Â Â Â Â Â__pagevec_release(&pvec);
> @@ -1315,9 +1311,8 @@ static void shrink_active_list(unsigned
> Â Â Â Â Â Â Â Â}
> Â Â Â Â}
> Â Â Â Â__mod_zone_page_state(zone, NR_LRU_BASE + lru, pgmoved);
> - Â Â Â pgdeactivate += pgmoved;
> Â Â Â Â__count_zone_vm_events(PGREFILL, zone, pgscanned);
> - Â Â Â __count_vm_events(PGDEACTIVATE, pgdeactivate);
> + Â Â Â __count_vm_events(PGDEACTIVATE, pgmoved);
> Â Â Â Âspin_unlock_irq(&zone->lru_lock);
> Â Â Â Âif (buffer_heads_over_limit)
> Â Â Â Â Â Â Â Âpagevec_strip(&pvec);
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@xxxxxxxxxx ÂFor more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>
>



--
Thanks,
Minchan Kim
--
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/