public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tabris <tabris@tabris.net>
To: Shobhit Mathur <shobhitmmathur@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [LKML]kmalloc -contiguous locations ?
Date: Mon, 31 May 2004 19:24:00 -0400	[thread overview]
Message-ID: <200405311924.06505.tabris@tabris.net> (raw)
In-Reply-To: <20040531094939.74138.qmail@web51007.mail.yahoo.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 31 May 2004 5:49 am, Shobhit Mathur wrote:
> Hello,
>
> I would like to know whether kmalloc() guarantees
> virtually contiguous memory locations ?
> Is there a limit on the amount of contiguous memory
> that can be returned by kmalloc() ?
	First, kmalloc returns physically contiguous memory.
	second, the limit (on x86) is 128kb (32 pages), allocatable in powers of two 
pages. (1,2,4,8,16,32. often called 0-order thru 5-order allocations)

	vmalloc returns virtual contiguous allocations, with no guarantee on physical 
contiguity. The problem with vmalloc, iirc, is that there's a [total] limit 
of 128MB for vmallocs.

	Also remember that all kernel memory allocated with vmalloc() or kmalloc() is 
non-swappable.

	I don't know how this changes under any other architecture, such as x86-64 or 
PPC32/64.
>
> - Thank you
>
> - Shobhit Mathur

- --
tabris
- -
	A master was explaining the nature of Tao to one of his novices.
"The Tao is embodied in all software -- regardless of how insignificant,"
said the master.
	"Is Tao in a hand-held calculator?" asked the novice.
	"It is," came the reply.
	"Is the Tao in a video game?" continued the novice.
	"It is even in a video game," said the master.
	"And is the Tao in the DOS for a personal computer?"
	The master coughed and shifted his position slightly.  "The lesson
is over for today," he said.
		-- Geoffrey James, "The Tao of Programming"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAu76V1U5ZaPMbKQcRAh8MAJ4nXgcFr/AENZql4BDFIRL+HGGJzACeNqej
TPVXSEF6E0ud+MfA8g5tQqE=
=sgpU
-----END PGP SIGNATURE-----

      reply	other threads:[~2004-05-31 23:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-31  9:49 [LKML]kmalloc -contiguous locations ? Shobhit Mathur
2004-05-31 23:24 ` tabris [this message]

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=200405311924.06505.tabris@tabris.net \
    --to=tabris@tabris.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shobhitmmathur@yahoo.com \
    /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