Re: [PATCH] mmzone: Introduce for_each_populated_zone_pgdat()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 24, 2023 at 11:07:56AM +0800, Yajun Deng wrote:
> Instead of define an index and determining if the zone has memory,
> introduce for_each_populated_zone_pgdat() helper that can be used
> to iterate over each populated zone in pgdat, and convert the most
> obvious users to it.

I don't think the complexity of the helper justifies the simplification
of the users.

> +++ b/include/linux/mmzone.h
> @@ -1580,6 +1580,14 @@ extern struct zone *next_zone(struct zone *zone);
>  			; /* do nothing */		\
>  		else
>  
> +#define for_each_populated_zone_pgdat(zone, pgdat, max) \
> +	for (zone = pgdat->node_zones;                  \
> +	     zone < pgdat->node_zones + max;            \
> +	     zone++)                                    \
> +		if (!populated_zone(zone))		\
> +			; /* do nothing */		\
> +		else
> +



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux