Messages in this thread | | | Date | Fri, 24 Feb 2006 22:16:51 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH] for_each_online_pgdat (take2) [1/5] define for_each_online_pgdat |
| |
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > > +static inline struct pglist_data *first_online_pgdat(void) > +{ > + return NODE_DATA(first_online_node); > +} > + > +static inline struct pglist_data *next_online_pgdat(struct pglist_data *pgdat) > +{ > + int nid = next_online_node(pgdat->node_id); > + > + if (nid == MAX_NUMNODES) > + return NULL; > + return NODE_DATA(nid); > +} > + > + > +/** > + * for_each_pgdat - helper macro to iterate over all nodes > + * @pgdat - pointer to a pg_data_t variable > + */ > +#define for_each_online_pgdat(pgdat) \ > + for (pgdat = first_online_pgdat(); \ > + pgdat; \ > + pgdat = next_online_pgdat(pgdat)) > + > +/* > + * next_zone - helper magic for for_each_zone() > + * Thanks to William Lee Irwin III for this piece of ingenuity. > + */ > +static inline struct zone *next_zone(struct zone *zone) > +{ > + pg_data_t *pgdat = zone->zone_pgdat; > + > + if (zone < pgdat->node_zones + MAX_NR_ZONES - 1) > + zone++; > + else { > + pgdat = next_online_pgdat(pgdat); > + if (pgdat) > + zone = pgdat->node_zones; > + else > + zone = NULL; > + } > + return zone; > +}
Some of these things must generate a large amount of code - would you have time to look into uninlining them, see what impact that has on .text size? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |