lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070726142550.GA14891@skynet.ie>
Date:	Thu, 26 Jul 2007 15:25:50 +0100
From:	mel@...net.ie (Mel Gorman)
To:	Lee Schermerhorn <Lee.Schermerhorn@...com>, ak@...e.de,
	Christoph Lameter <clameter@....com>, apw@...dowen.org,
	kamezawa.hiroyu@...fujitsu.com
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: bind_zonelist() - are we definitely sizing this correctly?

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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ