mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda@ilport.com.ua>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 03/11] memory hotplug prep: __section_nr helper
Date: Sat, 3 Sep 2005 17:59:06 +0300	[thread overview]
Message-ID: <200509031759.06449.vda@ilport.com.ua> (raw)
In-Reply-To: <20050902205645.FD6DE397@kernel.beaverton.ibm.com>

On Friday 02 September 2005 23:56, Dave Hansen wrote:
> 
> A little helper that we use in the hotplug code.
> 
> Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
> ---
> 
>  memhotplug-dave/include/linux/mmzone.h |   25 +++++++++++++++++++++++++
>  1 files changed, 25 insertions(+)
> 
> diff -puN include/linux/mmzone.h~C3-__section_nr include/linux/mmzone.h
> --- memhotplug/include/linux/mmzone.h~C3-__section_nr	2005-08-18 14:59:45.000000000 -0700
> +++ memhotplug-dave/include/linux/mmzone.h	2005-08-18 14:59:45.000000000 -0700
> @@ -511,6 +511,31 @@ static inline struct mem_section *__nr_t
>  }
>  
>  /*
> + * Although written for the SPARSEMEM_EXTREME case, this happens
> + * to also work for the flat array case becase
> + * NR_SECTION_ROOTS==NR_MEM_SECTIONS.
> + */
> +static inline int __section_nr(struct mem_section* ms)
> +{
> +	unsigned long root_nr;
> +	struct mem_section* root;
> +
> +	for (root_nr = 0;
> +	     root_nr < NR_MEM_SECTIONS;
> +	     root_nr += SECTIONS_PER_ROOT) {
> +		root = __nr_to_section(root_nr);
> +
> +		if (!root)
> +			continue;
> +
> +		if ((ms >= root) && (ms < (root + SECTIONS_PER_ROOT)))
> +		     break;
> +	}
> +
> +	return (root_nr * SECTIONS_PER_ROOT) + (ms - root);
> +}
> +
> +/*

isn't it too much for the inlining?
--
vda

  reply	other threads:[~2005-09-03 14:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-02 20:56 [PATCH 01/11] memory hotplug prep: kill local_mapnr Dave Hansen
2005-09-02 20:56 ` [PATCH 02/11] memory hotplug prep: break out zone initialization Dave Hansen
2005-09-02 20:56 ` [PATCH 03/11] memory hotplug prep: __section_nr helper Dave Hansen
2005-09-03 14:59   ` Denis Vlasenko [this message]
2005-09-02 20:56 ` [PATCH 04/11] memory hotplug prep: fixup bad_range() Dave Hansen
2005-09-02 20:56 ` [PATCH 06/11] memory hotplug locking: zone span seqlock Dave Hansen
2005-09-02 20:56 ` [PATCH 05/11] memory hotplug locking: node_size_lock Dave Hansen
2005-09-02 20:56 ` [PATCH 07/11] memory hotplug: sysfs and add/remove functions Dave Hansen
2005-09-02 22:13   ` Andrew Morton
2005-09-02 22:18     ` Dave Hansen
2005-09-02 20:56 ` [PATCH 08/11] memory hotplug: move section_mem_map alloc to sparse.c Dave Hansen
2005-09-02 20:56 ` [PATCH 09/11] memory hotplug: call setup_per_zone_pages_min after hotplug Dave Hansen
2005-09-02 20:56 ` [PATCH 10/11] memory hotplug: i386 addition functions Dave Hansen
2005-09-02 20:56 ` [PATCH 11/11] memory hotplug: ppc64 specific hot-add functions Dave Hansen
2005-09-07  9:37 ` [PATCH 01/11] memory hotplug prep: kill local_mapnr Andrew Morton
2005-09-07 17:03   ` Dave Hansen

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=200509031759.06449.vda@ilport.com.ua \
    --to=vda@ilport.com.ua \
    --cc=akpm@osdl.org \
    --cc=haveblue@us.ibm.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®