The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Zhonglin Zhang <zhonglinzh@mobilesoft.com.cn>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: a little improvement  for vmalloc
Date: Thu, 06 Jan 2005 11:18:52 +0800	[thread overview]
Message-ID: <1104981532.628.10.camel@milo> (raw)

Hello,

In FUNCTION __vmalloc ,

There is a statement;

if (!size || (size >> PAGE_SHIFT) > num_physpages)
        return NULL;

I think the condition (num_phypages >>PAGE_SHIFT) > num_physpages 
is not very accurate. As we all know, linux kernel and other stuff
occupy some memory,so it is better to express like below, I think. 

if (!size || size > max_vmalloc_size)
	return NULL;

max_vmalloc_size = (num_physpages >> PAGE_SHIFT) - kernel_size          
                             -reserved_space_for_emergence_use


BTW, I would like to know whether there are reserved physical memory for
emergence use.

Thanks in advance!

Milo



             reply	other threads:[~2005-01-06  3:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-06  3:18 Zhonglin Zhang [this message]
2005-01-06  3:38 ` a little improvement for vmalloc Andrew Morton
2005-01-06  9:26   ` Anton Altaparmakov

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=1104981532.628.10.camel@milo \
    --to=zhonglinzh@mobilesoft.com.cn \
    --cc=akpm@osdl.org \
    --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