linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Williams <steve@icarus.com>
To: linuxppc-embedded@ozlabs.org
Subject: Performance of mmap/munmap on linuxppc 2.4
Date: Fri, 01 Oct 2004 08:50:34 -0700	[thread overview]
Message-ID: <415D7CCA.6090907@icarus.com> (raw)


I need to allocate, reallocate(down), and release lage image
buffers, and I've been thinking in terms of using mmap and
anonymous mapping to get the memory:

       void*ptr = mmap(0, cur->size_, PROT_READ|PROT_WRITE,
                       MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);

I also munmap the tail of this region when I know how big the
image really is, and munmap the rest when the image is done.
I'm doing this the hard way (instead of using malloc/realloc)
because I want to guarantee that the realoc functionality doesn't
move the data.

So am I shooting myself in the foot performance-wise here?
I'm using a 233MHz 405GPr. I expect to be allocating/freeing
these image buffers 30-50 times a second for 4meg-ish regions,
or somewhat slower for regions 60meg or so. I have no swap.


-- 
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
http://www.icarus.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

                 reply	other threads:[~2004-10-01 15:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=415D7CCA.6090907@icarus.com \
    --to=steve@icarus.com \
    --cc=linuxppc-embedded@ozlabs.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;
as well as URLs for NNTP newsgroup(s).