From: Andrew Morton <akpm@osdl.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] for_each_online_pgdat (take2) [1/5] define for_each_online_pgdat
Date: Fri, 24 Feb 2006 22:16:51 -0800 [thread overview]
Message-ID: <20060224221651.58950b8c.akpm@osdl.org> (raw)
In-Reply-To: <20060225150528.98386921.kamezawa.hiroyu@jp.fujitsu.com>
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?
next prev parent reply other threads:[~2006-02-25 6:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-25 6:05 KAMEZAWA Hiroyuki
2006-02-25 6:16 ` Andrew Morton [this message]
2006-02-25 6:22 ` KAMEZAWA Hiroyuki
2006-02-25 7:07 ` KAMEZAWA Hiroyuki
2006-02-25 7:30 ` Andrew Morton
2006-02-25 7:38 ` KAMEZAWA Hiroyuki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060224221651.58950b8c.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®