mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roberto Fichera <kernel@tekno-soft.it>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to use memory over 4GB
Date: Mon, 16 May 2005 15:16:28 +0200	[thread overview]
Message-ID: <6.2.1.2.2.20050516150628.06682cd0@mail.tekno-soft.it> (raw)
In-Reply-To: <42889890.8090505@tls.msk.ru>

At 14.56 16/05/2005, Michael Tokarev wrote:

>Roberto Fichera wrote:
> > Hi All,
> >
> > I've a dual Xeon 3.2GHz HT with 8GB of memory running kernel 2.6.11.
> > I whould like to know the way how to use all the memory in a single
> > process, the application is a big simulation which needs big memory
> > chuncks.
> > I have readed about hugetlbfs, shmfs and tmpfs, but don't understand how
> > I can access
> > the whole memory. Ok! I can create a big file on tmpfs using shm_open() and
> > than map it by using mmap() or mmap2() but how can I access over 4GB using
> > standard pointers (if I had to use it)?
>
>There's no "standard" and simple way to utilize more than 4Gb memory on
>i386 hardware, especially in a userspace.  That is, the size of a pointer
>is 32bits, which is 4GB addresspace maximum.  i386 architecture just can't
>have a pointer of greather size.
>
>All "extra" (>4GB) space can be used like a file in a filesystem, not like
>a plain memory.  Think of read()/write() (or pread()/pwrite() for that 
>matter),
>but much faster ones compared to disk-based storage -- in tmpfs.  You can
>also mmap() *parts* of such a file, but will be still limited to 4GB at
>once -- in order to have more, you will have to unmap() something.
>
>All the "large applications" (most notable large database systems such as
>Oracle) can't use more than 4GB memory directly, but can utilize it for
>database cache.  In directly-addressible space there's a "table of content"
>of cached buffers is keept, and when a buffer is needed, it is mmap()'ed
>into the application's address space, and unmapped right away when it isn't
>needed anymore (but it is still in memory).

I was thinking to create as many object I need by the usual shm_open(), 
than mmap()
it on a process until I get ENOMEM. So, when I get a ENOMEM I start to
munmap() objects in order to free some user space memory and create the needed
space to complete mmap() for the requested object.

>Ofcourse you can't have
>usual pointers into that memory, but you can use something like
>(block-number,offset) instead of a pointer (pagetables).

Could you explain better this approch?


>/mjt
>-
>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/

Roberto Fichera. 


  reply	other threads:[~2005-05-16 13:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-16 12:42 Roberto Fichera
2005-05-16 12:56 ` Michael Tokarev
2005-05-16 13:16   ` Roberto Fichera [this message]
2005-05-16 15:10     ` William Lee Irwin III
2005-05-16 15:47       ` Roberto Fichera
2005-05-16 15:54         ` William Lee Irwin III
2005-05-16 16:37           ` Roberto Fichera
2005-05-16 19:14   ` Bill Davidsen
2005-05-16 12:57 ` Eric Dumazet
2005-05-16 13:18   ` Roberto Fichera
2005-05-16 14:17     ` Eric Dumazet
2005-05-16 14:50       ` Roberto Fichera
2005-05-16 21:34         ` Nix
2005-05-17  7:15           ` Roberto Fichera
2005-05-16 15:22       ` William Lee Irwin III
2005-05-16 12:55 li nux
2005-05-16 13:06 ` Roberto Fichera

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=6.2.1.2.2.20050516150628.06682cd0@mail.tekno-soft.it \
    --to=kernel@tekno-soft.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjt@tls.msk.ru \
    /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

all inboxes | Powered by JetHome®