From: Robert Hancock <hancockr@shaw.ca>
To: "Brian D. McGrew" <brian@visionpro.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Memory Allocation
Date: Mon, 16 Apr 2007 23:08:53 -0600 [thread overview]
Message-ID: <46245665.2050402@shaw.ca> (raw)
In-Reply-To: <fa.BkbRyK9fXhgijRwEDN4ejyJhMRQ@ifi.uio.no>
Brian D. McGrew wrote:
> Good evening gents!
>
> I need some help in allocating memory and understanding how the system
> allocates memory with physical versus virtual page tables. Please
> consider the following snippet of code. Please, no wisecracks about bad
> code; it was written in 30 seconds in haste :-)
(snip)
> My test machine is a Dell Precision 490 with dual 5140 processors and
> 3GB of RAM. If I reduced kMaxSize to (2048 * 2048 * 236) is works.
> However, I need to allocate an array of char that is (2048 * 2048 * 256)
> and maybe even as large at (2048 * 2048 * 512).
>
> Obviously I have enough physical memory in the box to do this. However,
> I suspect that I'm running out of page table entries. Please, correct
> me if I'm wrong; but if I allocate (2048 * 2048 * 236) it work. When I
Pretty sure you're wrong.
> increment to 256 or 512 it fails and it is my suspicion that I just
> don't have enough more in kernel memory to allocate this much memory in
> user space.
Are you using a 32-bit kernel? If so, most likely you're hitting a limit
of the address space layout - there's just not enough room in the
address space for an allocation of this size.
>
> Because of a piece of 3rd party hardware, I'm forced to run the kernel
> in the 4GB memory model. What I need to be able to do is allocate an
> array of char (2048 * 2048 * (up to 512)) in user space *** AND *** I
> need the addresses that I get back to be contiguous, that's just the way
> my 3rd party hardware works.
>
> I'm inclined to believe that this in not specifically a Linux problem
> but maybe an architecture problem??? But maybe there is some kind of
> work around in the kernel for it??? I'd find it hard to believe that
> I'm the first one that ever needed to use this much memory.
>
> I ran this same code on two difference Macs. One of them a Powerbook G4
> with 4GB of RAM and it was successful. The other was a Macbook Pro with
> 4GB of RAM and it failed. Both running OS 10.4.9. And of course it
> runs just lovely on my Sun workstation with Solaris. Thus, I'm thinking
> it's an Intel/X86 issue!
>
> How the heck to I get past this problem in Linux on the X86 plateform???
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
next parent reply other threads:[~2007-04-17 5:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.BkbRyK9fXhgijRwEDN4ejyJhMRQ@ifi.uio.no>
2007-04-17 5:08 ` Robert Hancock [this message]
2007-04-17 2:17 Memory Allocation Brian D. McGrew
2007-04-17 7:06 ` Eric Dumazet
2007-04-18 4:47 ` David Schwartz
-- strict thread matches above, loose matches on Subject: below --
2004-08-13 12:27 memory_allocation simon.guinot
2004-08-13 12:34 ` memory_allocation Henry Margies
2004-08-13 13:01 ` memory_allocation Jan-Benedict Glaw
2003-09-14 18:44 1:1 M:N threading Breno
2003-09-14 19:11 ` Robert Love
2003-09-16 15:04 ` Memory allocation Breno
2001-02-27 16:55 Ivan Stepnikov
2001-02-27 17:51 ` Wayne Whitney
2001-02-27 17:55 ` Peter Samuelson
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=46245665.2050402@shaw.ca \
--to=hancockr@shaw.ca \
--cc=brian@visionpro.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.