[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: [LKML]kmalloc -contiguous locations ?
From:       tabris <tabris () tabris ! net>
Date:       2004-05-31 23:24:00
Message-ID: 200405311924.06505.tabris () tabris ! net
[Download RAW message or body]

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

Configure | About | News | Add a list | Sponsored by KoreLogic