linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: mel@skynet.ie (Mel Gorman)
To: Lee Schermerhorn <Lee.Schermerhorn@hp.com>,
	ak@suse.de, Christoph Lameter <clameter@sgi.com>,
	apw@shadowen.org, kamezawa.hiroyu@jp.fujitsu.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: bind_zonelist() - are we definitely sizing this correctly?
Date: Thu, 26 Jul 2007 15:25:50 +0100	[thread overview]
Message-ID: <20070726142550.GA14891@skynet.ie> (raw)
In-Reply-To: <20070726141756.GB18825@skynet.ie>

On (26/07/07 15:17), Mel Gorman didst pronounce:
> I was looking closer at bind_zonelist() and it has the following snippet
> 
>         struct zonelist *zl;
>         int num, max, nd;
>         enum zone_type k;
> 
>         max = 1 + MAX_NR_ZONES * nodes_weight(*nodes);
>         max++;                  /* space for zlcache_ptr (see mmzone.h) */
>         zl = kmalloc(sizeof(struct zone *) * max, GFP_KERNEL);
>         if (!zl)
>                 return ERR_PTR(-ENOMEM);
> 
> That set off alarm bells because we are allocating based on the size of a
> zone, not the size of the zonelist.
> 

Never mind me, I'm a tool as it's now semi-obvious. When statically defined,
zlcache_ptr is pointing to something useful as it's setup at boottime. When
dynamically allocated in bind_zonelist, the zlcache_ptr is set to NULL so
it never gets used by zlc_setup().

This could have done with a comment.

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-07-26 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-26 14:17 Mel Gorman
2007-07-26 14:25 ` Mel Gorman [this message]
2007-07-26 17:58   ` Christoph Lameter

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=20070726142550.GA14891@skynet.ie \
    --to=mel@skynet.ie \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=ak@suse.de \
    --cc=apw@shadowen.org \
    --cc=clameter@sgi.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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