public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 17:54:15 -0300	[thread overview]
Message-ID: <20041115175415.X28802@almesberger.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0411151226010.20003@red.engin.umich.edu>; from vrajesh@umich.edu on Mon, Nov 15, 2004 at 01:13:48PM -0500

Rajesh Venkatasubramanian wrote:
> Again I don't like the following approach fully. I couldn't come
> out with a clean generalization something like rb_tree code.

Hmm, GET_INDEX/get_index grows and grows, and also generates a
hotspot for patch collisions ...

And what if we took the hit and moved the key into struct
prio_tree_node ? struct vm_area_struct.shared.vm_set already is
one word longer than vm_area_struct.shared.prio_tree_node, so
half of the key is free (in terms of storage - the key updates
when vm_pgoff, vm_end, or vm_start changes aren't free). The
other half could also be made free (in terms of storage and
processing) with a little tweaking, e.g.  by adding

	...
	union {
		unsigned long vm_pgoff;
		struct vm_set {
			unsigned long vm_pgoff;
			...
		} vm_set;
		struct prio_tree_node prio_tree_node;
	}
	...

#define vm_pgoff shared.vm_pgoff

(Untested. This kind of #define is of course risky, so it may be
better to just rewrite all the accesses.)

Then, we could have

	struct prio_tree_node {
		unsigned long r_index, h_index;
		...
	};

For the elevators, the keys (the "footprint" of a set of overlapping
requests) are already stored as separate variables, so that could be
migrated very easily, at no additional cost.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina     werner@almesberger.net /
/_http://www.almesberger.net/____________________________________________/

  reply	other threads:[~2004-11-15 20:59 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 [this message]
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
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=20041115175415.X28802@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