lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090210142138.GD4023@csn.ul.ie>
Date:	Tue, 10 Feb 2009 14:21:39 +0000
From:	Mel Gorman <mel@....ul.ie>
To:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-mm <linux-mm@...ck.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] introduce for_each_populated_zone() macro

On Tue, Feb 10, 2009 at 11:13:12PM +0900, KOSAKI Motohiro wrote:
> Hi
> 
> >> +#define for_each_populated_zone(zone)                        \
> >> +     for (zone = (first_online_pgdat())->node_zones; \
> >> +          zone;                                      \
> >> +          zone = next_zone(zone))                    \
> >> +             if (!populated_zone(zone))              \
> >> +                     ; /* do nothing */              \
> >> +             else
> >> +
> >> +
> >> +
> >> +
> >
> > There is tabs vs whitespace damage in there.
> 
> ??
> I'm look at it again. but I don't found whitespace damage.
> 

Maybe there is some oddity in my mailer, but the second part of the for
loop with "zone;" looks like a tab followed by spaces to me. Not a big
deal, probably looks better with the spaces in this case.

> > Multiple empty lines are introduced for no apparent reason.
> 
> Will fix. thanks.
> 
> > It's not clear why you did not use if (populated_zone(zone))
> > instead of an if/else.
> 
> Good question.
> if we make following macro,
> 
> #define for_each_populated_zone(zone)                        \
>      for (zone = (first_online_pgdat())->node_zones; \
>           zone;                                      \
>           zone = next_zone(zone))                    \
>              if (populated_zone(zone))
> 
> and, writing following caller code.
> 
> if (always_true_assumption)
>   for_each_populated_zone(){
>      /* some code */
>   }
> else
>   panic();
> 
> expand to
> 
> if (always_true_assumption)
>   for()
>      if (populated_zone() {
>      /* some code */
>   }
> else
>   panic();
> 
> then, memoryless node cause panic().
> 

Oof, that's tricky but you're correct. The macro has to work as you suggest
or weird things can happen.

> >
> > Otherwise, I did not spot anything out of the ordinary. Nice cleanup.
> 

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ