Michal, IIUC it's to prevent the infinite loop, as in the end of the do-while there's if (!nr_reclaimed && (next_mz == NULL || loop > MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS)) break; so the loop will break earlier if all groups are iterated once and no pages are freed. Thanks, Zhu Yanhai 2011/3/29 Michal Hocko <mhocko@xxxxxxx>: > Hi, > while reading the code I have encountered the following thing. It is no > biggie but... > --- > From: Michal Hocko <mhocko@xxxxxxx> > Subject: Remove pointless next_mz nullification in mem_cgroup_soft_limit_reclaim > > next_mz is assigned to NULL if __mem_cgroup_largest_soft_limit_node selects > the same mz. This doesn't make much sense as we assign to the variable > right in the next loop. > > Compiler will probably optimize this out but it is little bit confusing for > the code reading. > > Signed-off-by: Michal Hocko <mhocko@xxxxxxx> > > Index: linux-2.6.38-rc8/mm/memcontrol.c > =================================================================== > --- linux-2.6.38-rc8.orig/mm/memcontrol.c    2011-03-28 11:25:14.000000000 +0200 > +++ linux-2.6.38-rc8/mm/memcontrol.c  Â2011-03-29 15:24:08.000000000 +0200 > @@ -3349,7 +3349,6 @@ unsigned long mem_cgroup_soft_limit_recl >                Â__mem_cgroup_largest_soft_limit_node(mctz); >                Âif (next_mz == mz) { >                    Âcss_put(&next_mz->mem->css); > -                    next_mz = NULL; >                Â} else /* next_mz == NULL or other memcg */ >                    Âbreak; >            Â} while (1); > -- > Michal Hocko > SUSE Labs > SUSE LINUX s.r.o. > Lihovarska 1060/12 > 190 00 Praha 9 > Czech Republic > > -- > 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/ . > Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ > Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a> > -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href