From: "Martin J. Bligh" <mbligh@aracnet.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andrew Morton <akpm@digeo.com>,
andrea@suse.de, mingo@elte.hu, hugh@veritas.com,
dmccr@us.ibm.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, Bill Irwin <wli@holomorphy.com>,
Rik van Riel <riel@conectiva.com.br>
Subject: subobj-rmap
Date: Sun, 06 Apr 2003 14:34:12 -0700 [thread overview]
Message-ID: <1070000.1049664851@[10.10.2.4]> (raw)
In-Reply-To: <77670000.1049645582@[10.10.2.4]>
> Humpf. Well I have a fairly simple plan to fix it now. I'll either publish
> some code or the plan later today, once I've thought about it a bit more.
I'm not sure we need a full 2-d tree to solve this, because the 2 dimensions
aren't independant. What we have is a list of virtual ranges of the
address_space, which might (but probably don't) overlap. If they never
overlapped, this would be easy, we'd just keep a sorted structure (list or
tree) of regions, and find the region we lay in. In fact, Dave already did
that (sort by start addr) ... but we have to walk the rest of the chains
as well to find other regions.
Supposing we keep a list of areas (hung from the address_space) that
describes independant linear ranges of memory that have the same set
of vma's mapping them (call those subobjects). Each subobject has a
chain of vma's from it that are mapping that subobject.
address_space ---> subobject ---> subobject ---> subobject ---> subobject
| | | |
v v v v
vma vma vma vma
| | |
v v v
vma vma vma
| |
v v
vma vma
Now we can just find the first element in that sorted list that maps
the address we're looking for, and it has a chain of vma's that we
need to worry about. This should solve the 100x100 case. To solve the
1x10000 case efficiently, we should be able to just turn the subobject
sorted list into an rbtree.
When we map a new VMA, we need to look for overlaps with existing
subobjects. I suspect (with no real proof, save intuition) that most
of the time we'll either map a new space (create a new subobject),
or an existing space completely (just tack yourself onto the vma chain
from the subobject). If we do get a partial overlap, we'll split the
subobject in twain, and add ourselves to the overlapping part. Note that
This now starts to look very like the process's tree of vma's, so there's
lots of potential for code-reuse. If the overlaps don't happen a lot,
(and I suspect they won't) it should be dirt cheap to do.
This is a bit more expensive on the maintainance side than objrmap, but
cheaper than pte_chains, since it's per-vma, not per-page. It should be
much cheaper than objrmap in the corner cases we've been discussing though.
Thoughts / flames?
Part 2
------
Moreover, this can be used for sys_remap_file_pages (and indeed
my though process is partly based on some discussions with Dave last week
about how to solve that). However, if people think this is too heavy,
we can still use pte-chains for this, so don't discard the above if you
have the following bit. We just keep a subobject for each linear region
within the non-linear VMA - it might need a little more info in the
subobject to work. Yes, it's more expense at remap time, but we don't
have to do the per-page stuff (and it's lighter than vmas). I suspect
that's a good tradeoff (unless some crazy person is worried about mapping
lots of windows and never using them). However, it would need to be
benchmarked, and it's independant of the above.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
next prev parent reply other threads:[~2003-04-06 21:34 UTC|newest]
Thread overview: 105+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-04 14:34 objrmap and vmtruncate Hugh Dickins
2003-04-04 16:14 ` William Lee Irwin III
2003-04-04 16:29 ` Hugh Dickins
2003-04-04 18:54 ` Andrew Morton
2003-04-04 21:43 ` Hugh Dickins
2003-04-04 21:45 ` Andrea Arcangeli
2003-04-04 21:58 ` Benjamin LaHaise
2003-04-04 23:07 ` Andrew Morton
2003-04-05 0:03 ` Andrea Arcangeli
2003-04-05 0:31 ` Andrew Morton
2003-04-05 1:31 ` Andrea Arcangeli
2003-04-05 1:52 ` Benjamin LaHaise
2003-04-05 2:22 ` Andrea Arcangeli
2003-04-05 10:01 ` Jamie Lokier
2003-04-05 10:11 ` William Lee Irwin III
2003-04-05 2:06 ` Andrew Morton
2003-04-05 2:24 ` Andrea Arcangeli
2003-04-05 2:13 ` Martin J. Bligh
2003-04-05 2:44 ` Andrea Arcangeli
2003-04-05 3:24 ` Andrew Morton
2003-04-05 12:06 ` Andrew Morton
2003-04-05 15:11 ` Martin J. Bligh
[not found] ` <20030405161758.1ee19bfa.akpm@digeo.com>
2003-04-06 0:17 ` Andrew Morton
2003-04-06 7:07 ` William Lee Irwin III
2003-04-05 16:30 ` Andrea Arcangeli
2003-04-05 19:01 ` Andrea Arcangeli
2003-04-05 20:14 ` Andrew Morton
2003-04-05 21:24 ` Andrew Morton
2003-04-05 22:06 ` Andrea Arcangeli
2003-04-05 22:31 ` Andrew Morton
2003-04-05 23:10 ` Andrea Arcangeli
2003-04-06 1:58 ` Andrew Morton
2003-04-06 14:47 ` Andrea Arcangeli
2003-04-06 21:35 ` William Lee Irwin III
2003-04-06 7:38 ` William Lee Irwin III
2003-04-06 14:51 ` Andrea Arcangeli
2003-04-06 12:37 ` Jamie Lokier
2003-04-06 13:12 ` William Lee Irwin III
2003-04-22 11:00 ` Ingo Molnar
2003-04-22 11:54 ` William Lee Irwin III
2003-04-22 14:31 ` Ingo Molnar
2003-04-22 14:56 ` William Lee Irwin III
2003-04-22 15:26 ` Ingo Molnar
2003-04-22 16:20 ` William Lee Irwin III
2003-04-22 16:57 ` Andrea Arcangeli
2003-04-22 17:21 ` William Lee Irwin III
2003-04-22 18:08 ` Andrea Arcangeli
2003-04-22 17:34 ` Ingo Molnar
2003-04-22 18:04 ` Benjamin LaHaise
2003-04-22 16:58 ` Martin J. Bligh
2003-04-22 12:37 ` Andrea Arcangeli
2003-04-22 13:20 ` William Lee Irwin III
2003-04-22 14:38 ` Martin J. Bligh
2003-04-22 15:10 ` William Lee Irwin III
2003-04-22 15:53 ` Martin J. Bligh
2003-04-22 14:52 ` Andrea Arcangeli
2003-04-22 14:29 ` Martin J. Bligh
2003-04-22 15:07 ` Ingo Molnar
2003-04-22 15:42 ` William Lee Irwin III
2003-04-22 15:55 ` Ingo Molnar
2003-04-22 16:58 ` William Lee Irwin III
2003-04-22 17:07 ` Ingo Molnar
2003-04-22 15:16 ` Andrea Arcangeli
2003-04-22 15:49 ` Ingo Molnar
2003-04-22 16:16 ` Martin J. Bligh
2003-04-22 17:24 ` Ingo Molnar
2003-04-22 17:45 ` John Bradford
2003-04-22 14:32 ` Martin J. Bligh
2003-04-22 15:09 ` Ingo Molnar
2003-04-05 21:34 ` Rik van Riel
2003-04-06 9:29 ` Benjamin LaHaise
2003-04-05 23:25 ` William Lee Irwin III
2003-04-05 23:57 ` Andrew Morton
2003-04-06 0:14 ` Andrea Arcangeli
2003-04-06 1:39 ` Andrew Morton
2003-04-06 2:13 ` William Lee Irwin III
2003-04-06 9:26 ` Benjamin LaHaise
2003-04-06 9:41 ` William Lee Irwin III
2003-04-06 9:54 ` William Lee Irwin III
2003-04-06 2:23 ` Martin J. Bligh
2003-04-06 3:55 ` Andrew Morton
2003-04-06 3:08 ` Martin J. Bligh
2003-04-06 7:42 ` William Lee Irwin III
2003-04-06 14:49 ` Alan Cox
2003-04-06 16:13 ` Martin J. Bligh
2003-04-06 21:34 ` Martin J. Bligh [this message]
2003-04-06 21:42 ` subobj-rmap Rik van Riel
2003-04-06 21:55 ` subobj-rmap Jamie Lokier
2003-04-06 22:39 ` subobj-rmap William Lee Irwin III
2003-04-06 22:03 ` subobj-rmap Martin J. Bligh
2003-04-06 22:06 ` subobj-rmap Martin J. Bligh
2003-04-06 22:15 ` subobj-rmap Andrea Arcangeli
2003-04-06 22:25 ` subobj-rmap Martin J. Bligh
2003-04-07 21:25 ` subobj-rmap Andrea Arcangeli
2003-04-06 23:06 ` subobj-rmap Jamie Lokier
2003-04-06 23:26 ` subobj-rmap Martin J. Bligh
2003-04-05 3:45 ` objrmap and vmtruncate Martin J. Bligh
2003-04-05 3:59 ` Rik van Riel
2003-04-05 4:10 ` William Lee Irwin III
2003-04-05 4:49 ` Martin J. Bligh
2003-04-05 13:31 ` Rik van Riel
2003-04-05 4:52 ` Martin J. Bligh
2003-04-05 3:22 ` Andrew Morton
2003-04-05 3:35 ` Martin J. Bligh
2003-04-05 3:53 ` Rik van Riel
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='1070000.1049664851@[10.10.2.4]' \
--to=mbligh@aracnet.com \
--cc=akpm@digeo.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andrea@suse.de \
--cc=dmccr@us.ibm.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=riel@conectiva.com.br \
--cc=wli@holomorphy.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