From: Andrew Morton <akpm@zip.com.au>
To: Peter Zaitsev <pz@spylog.ru>
Cc: theowl@freemail.c3.hu, theowl@freemail.hu,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@transmeta.com>,
Andrea Arcangeli <andrea@suse.de>
Subject: Re: your mail on mmap() to the kernel list
Date: Sun, 02 Dec 2001 15:34:54 -0800 [thread overview]
Message-ID: <3C0ABA9E.5E652392@zip.com.au> (raw)
In-Reply-To: <3C08A4BD.1F737E36@zip.com.au>, <3C082244.8587.80EF082@localhost>, <3C082244.8587.80EF082@localhost> <61437219298.20011201113130@spylog.ru> <3C08A4BD.1F737E36@zip.com.au> <142576153324.20011203020702@spylog.ru>
Peter Zaitsev wrote:
>
> ...
It's very simple. The kernel has a linked list of vma's for your
process. It is kept in address order. Each time you request a
new mapping, the kernel walks down that list looking for an address
at which to place the new mapping. This data structure is set up
for efficient find-by-address, not for efficient find-a-gap.
Question is: do we need to optimise for this case?
If it's just a single file, then you'd be better off just mapping the
whole thing. If you need to map lots and lots of files then
you'll hit the maximum file limit fairly early and the mmap()
performance will be not great, but maybe acceptable.
One scenario where this could be a problem is for a file
which is too large to be mapped in its entirety, but the
application needs access to lots of bits of it at the same
time. There doesn't seem to be much alternative to setting
up a distinct mapping for each access window in this case.
> Also As you see other patterns also show fast performance degradation
> over increasing number of pages. I can also test random allocation and
> freeing but something tells me the result will be the same.
Is this proving to be a problem in a real-world application?
What are you trying to do here?
-
next prev parent reply other threads:[~2001-12-03 8:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3C082244.8587.80EF082@localhost>
2001-12-01 8:31 ` Re[2]: your mail on mmap() to the kernel list Peter Zaitsev
2001-12-01 9:37 ` Andrew Morton
2001-12-02 23:07 ` Re[2]: " Peter Zaitsev
2001-12-02 23:34 ` Andrew Morton [this message]
2001-12-03 10:10 ` Peter Zaitsev
2001-12-04 14:18 ` Andrea Arcangeli
2001-12-04 14:15 ` Andrea Arcangeli
2001-12-04 15:36 ` Re[2]: " Peter Zaitsev
2001-12-04 16:42 ` Rik van Riel
2001-12-04 16:55 ` Andrea Arcangeli
2001-12-05 14:38 ` Re[2]: " Peter Zaitsev
2001-12-05 14:36 ` Re[3]: " Peter Zaitsev
2001-12-04 16:48 ` Andrea Arcangeli
2001-12-05 16:12 ` Re[2]: " Peter Zaitsev
2001-12-05 16:23 ` Andrea Arcangeli
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=3C0ABA9E.5E652392@zip.com.au \
--to=akpm@zip.com.au \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pz@spylog.ru \
--cc=theowl@freemail.c3.hu \
--cc=theowl@freemail.hu \
--cc=torvalds@transmeta.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