All of lore.kernel.org
 help / color / mirror / Atom feed
* prio_tree generalization
@ 2004-07-05  1:24 Werner Almesberger
  2004-07-05  2:07 ` Andrea Arcangeli
  2004-07-05  4:46 ` Andrew Morton
  0 siblings, 2 replies; 5+ messages in thread
From: Werner Almesberger @ 2004-07-05  1:24 UTC (permalink / raw)
  To: Rajesh Venkatasubramanian; +Cc: linux-kernel

Hi Rajesh,

I'm currently experimenting with the prio_tree code in an elevator
("IO scheduler"), and I'm thinking about a way to avoid code
duplication.

The most straightforward approach seems to be to put everything
after prio_tree_init and before vma_prio_tree_add into a new file,
and #include that file. (And prio_tree_init should be shared.)

#including a .c file normally isn't exactly considered an epitome
of elegance, but in this case, there doesn't seem to be much of a
choice.

There's another issue: in the elevator, entries overlap only
rarely if at all, and it is sometimes useful to walk the tree in
sort order. As far as I can tell, RPSTs can be walked just like
RB trees if there are no overlaps on the path from the current to
the respective adjacent node.

Unfortunately, "prio_tree_next" is already taken. It would be nice
to follow the same naming scheme as RB trees, so perhaps
prio_tree_next could become prio_tree_more, or such ?

What do you think ?

- Werner

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-07-05 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-05  1:24 prio_tree generalization Werner Almesberger
2004-07-05  2:07 ` Andrea Arcangeli
2004-07-05  2:36   ` Werner Almesberger
2004-07-05  4:46 ` Andrew Morton
2004-07-05 11:05   ` Werner Almesberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.