Re: [PATCH] vmscan: initialize sc->nr_reclaimed properly take2

From: Andrew Morton
Date: Tue Feb 10 2009 - 17:08:01 EST


On Tue, 10 Feb 2009 21:58:04 +0900 (JST)
KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> wrote:

> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1665,6 +1665,7 @@ unsigned long try_to_free_pages(struct z
> gfp_t gfp_mask)
> {
> struct scan_control sc = {
> + .nr_reclaimed = 0,
> .gfp_mask = gfp_mask,
> .may_writepage = !laptop_mode,
> .swap_cluster_max = SWAP_CLUSTER_MAX,
> @@ -1686,6 +1687,7 @@ unsigned long try_to_free_mem_cgroup_pag
> unsigned int swappiness)
> {
> struct scan_control sc = {
> + .nr_reclaimed = 0,
> .may_writepage = !laptop_mode,
> .may_swap = 1,
> .swap_cluster_max = SWAP_CLUSTER_MAX,
> @@ -2245,6 +2247,7 @@ static int __zone_reclaim(struct zone *z
> struct reclaim_state reclaim_state;
> int priority;
> struct scan_control sc = {
> + .nr_reclaimed = 0,
> .may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
> .may_swap = !!(zone_reclaim_mode & RECLAIM_SWAP),
> .swap_cluster_max = max_t(unsigned long, nr_pages,

Confused. The compiler already initialises any unmentioned fields to zero,
so this patch has no effect.

--
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/