Re: [PATCH] shrink_all_memory() use sc.nr_reclaimed

From: KOSAKI Motohiro
Date: Tue Feb 10 2009 - 15:41:38 EST


>> {
>> struct zone *zone;
>> - unsigned long nr_to_scan, ret = 0;
>> + unsigned long nr_to_scan;
>> enum lru_list l;
>
> Basing it on swsusp-clean-up-shrink_all_zones.patch probably makes it
> easier for Andrew to pick it up.

ok, thanks.

>> reclaim_state.reclaimed_slab = 0;
>> - shrink_slab(nr_pages, sc.gfp_mask, global_lru_pages());
>> - ret += reclaim_state.reclaimed_slab;
>> - } while (ret < nr_pages && reclaim_state.reclaimed_slab > 0);
>> + shrink_slab(nr_pages, sc.gfp_mask,
>> + global_lru_pages());
>> + sc.nr_reclaimed += reclaim_state.reclaimed_slab;
>> + } while (sc.nr_reclaimed < nr_pages &&
>> + reclaim_state.reclaimed_slab > 0);
>
> :(
>
> Is this really an improvement? `ret' is better to read than
> `sc.nr_reclaimed'.

I know it's debetable thing.
but I still think code consistency is important than variable name preference.
--
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/