From: Werner Almesberger <werner@almesberger.net>
To: Rajesh Venkatasubramanian <vrajesh@umich.edu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] Generalize prio_tree (1/3)
Date: Mon, 15 Nov 2004 19:59:46 -0300 [thread overview]
Message-ID: <20041115195946.Z28802@almesberger.net> (raw)
In-Reply-To: <Pine.GSO.4.58.0411151705260.6691@lazuli.engin.umich.edu>; from vrajesh@umich.edu on Mon, Nov 15, 2004 at 05:27:42PM -0500
Rajesh Venkatasubramanian wrote:
> No, that's not possible. Whenever we change vm_pgoff, vm_start, or
> vm_end, we reshuffle the prio_tree. Check mm/mmap.c:vma_adjust().
Excellent, that makes it a lot easier.
> If you are thinking vm_set.head or vm_set.parent is free to use
> for h_index, then it is incorrect. No field is free. If a vma
> is a tree node (and in this discussion we care only about tree
> nodes), then every field in vma->shared is used. We cannot reuse
> them for storing h_index.
Oh, I see. I thought it was that either vm_set or prio_tree_node
was used. (Which I found somewhat confusing, but attributed my
confusion to simply not understanding all the strange ways of MM.)
Sorry about the confusion.
So yes, one more word then :-(
> If we impose that there can be only 2 types of prio_tree, then
> we can simply add an if-else condition in the GET_INDEX macro.
> IMHO, that will not lead to any noticeable performance drop.
Yes, that sounds better. It would also allow for a later transition
of VMA_PRIO_TREE to GENERIC_PRIO_TREE.
Now, if we want to prepare things already now for a later migration,
it would be nice to call the generic one "struct prio_tree_node",
since it would eventually become the only node type anyway.
Perhaps something along these lines:
struct prio_tree_node {
struct vma_prio_tree_node prio_tree_node;
unsigned long r_index, h_index;
};
Or would you consider this as premature optimization ?
> But, I agree with you that changing the layout of vm_area_struct
> is a better (but intrusive) approach.
I also wonder how expensive the calculations in HEAP_INDEX are.
Probably not very.
To make the intrusive change a bit more palatable, vm_pgoff could
become #define vm_pgoff(vma) ((vma)->shared.prio_tree_node.r_index)
Okay, so now we only need someone who has meaningful MM tests to
tell us how badly this would hurt performance :-)
Thanks,
- Werner
--
_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina werner@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
next prev parent reply other threads:[~2004-11-15 23:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-15 2:56 [RFC] Generalize prio_tree (1/3) Werner Almesberger
2004-11-15 2:59 ` [RFC] Make MM use generalized prio_tree (2/3) Werner Almesberger
2004-11-15 3:05 ` [RFC] prio_tree debugging functions (3/3) Werner Almesberger
2004-11-15 4:30 ` [RFC] Generalize prio_tree (1/3) Nick Piggin
2004-11-15 6:07 ` Werner Almesberger
2004-11-15 11:01 ` Nick Piggin
2004-11-15 14:32 ` Werner Almesberger
2004-11-15 18:13 ` Rajesh Venkatasubramanian
2004-11-15 20:54 ` Werner Almesberger
2004-11-15 21:14 ` Rajesh Venkatasubramanian
2004-11-15 21:42 ` Werner Almesberger
2004-11-15 22:27 ` Rajesh Venkatasubramanian
2004-11-15 22:59 ` Werner Almesberger [this message]
2004-11-16 0:07 ` Rajesh Venkatasubramanian
2004-11-16 0:35 ` Werner Almesberger
2004-11-16 1:48 ` Rajesh Venkatasubramanian
2004-11-16 23:51 ` Generalize prio_tree, 2nd try Werner Almesberger
2004-11-17 1:28 ` Werner Almesberger
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=20041115195946.Z28802@almesberger.net \
--to=werner@almesberger.net \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=vrajesh@umich.edu \
/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