<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/rbtree.c, branch v3.2.11</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.11</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.11'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2011-01-28T02:16:59Z</updated>
<entry>
<title>Export the augmented rbtree helper functions</title>
<updated>2011-01-28T02:16:59Z</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruen@linbit.com</email>
</author>
<published>2011-01-26T14:55:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0b6bb66d1247601e4a2560bb048d64c606bd7b73'/>
<id>urn:sha1:0b6bb66d1247601e4a2560bb048d64c606bd7b73</id>
<content type='text'>
The augmented rbtree helper functions are not exported to modules right
now.

(We have started using augmented rbtrees in the upcoming version of
drbd.)

Signed-off-by: Andreas Gruenbacher &lt;agruen@linbit.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rbtree: Undo augmented trees performance damage and regression</title>
<updated>2010-07-05T12:43:50Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2010-05-29T13:31:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b945d6b2554d550fe95caadc61e521c0ad71fb9c'/>
<id>urn:sha1:b945d6b2554d550fe95caadc61e521c0ad71fb9c</id>
<content type='text'>
Reimplement augmented RB-trees without sprinkling extra branches
all over the RB-tree code (which lives in the scheduler hot path).

This approach is 'borrowed' from Fabio's BFQ implementation and
relies on traversing the rebalance path after the RB-tree-op to
correct the heap property for insertion/removal and make up for
the damage done by the tree rotations.

For insertion the rebalance path is trivially that from the new
node upwards to the root, for removal it is that from the deepest
node in the path from the to be removed node that will still
be around after the removal.

[ This patch also fixes a video driver regression reported by
  Ali Gholami Rudi - the memtype-&gt;subtree_max_end was updated
  incorrectly. ]

Acked-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Acked-by: Venkatesh Pallipadi &lt;venki@google.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Tested-by: Ali Gholami Rudi &lt;ali@rudi.ir&gt;
Cc: Fabio Checconi &lt;fabio@gandalf.sssup.it&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
LKML-Reference: &lt;1275414172.27810.27961.camel@twins&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>rbtree: Add support for augmented rbtrees</title>
<updated>2010-02-18T23:40:56Z</updated>
<author>
<name>Pallipadi, Venkatesh</name>
<email>venkatesh.pallipadi@intel.com</email>
</author>
<published>2010-02-10T23:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=17d9ddc72fb8bba0d4f67868c9c612e472a594a9'/>
<id>urn:sha1:17d9ddc72fb8bba0d4f67868c9c612e472a594a9</id>
<content type='text'>
Add support for augmented rbtrees in core rbtree code.

This will be used in subsequent patches, in x86 PAT code, which needs
interval trees to efficiently keep track of PAT ranges.

Signed-off-by: Venkatesh Pallipadi &lt;venkatesh.pallipadi@intel.com&gt;
LKML-Reference: &lt;20100210232343.GA11465@linux-os.sc.intel.com&gt;
Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
<entry>
<title>rb_tree: remove redundant if()-condition in rb_erase()</title>
<updated>2009-06-17T02:47:56Z</updated>
<author>
<name>Wolfram Strepp</name>
<email>wstrepp@gmx.de</email>
</author>
<published>2009-06-16T22:34:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4b324126e0c6c3a5080ca3ec0981e8766ed6f1ee'/>
<id>urn:sha1:4b324126e0c6c3a5080ca3ec0981e8766ed6f1ee</id>
<content type='text'>
Furthermore, notice that the initial checks:

	if (!node-&gt;rb_left)
		child = node-&gt;rb_right;
	else if (!node-&gt;rb_right)
		child = node-&gt;rb_left;
	else
	{
		...
	}
guarantee that old-&gt;rb_right is set in the final else branch, therefore
we can omit checking that again.

Signed-off-by: Wolfram Strepp &lt;wstrepp@gmx.de&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rb_tree: make clear distinction between two different cases in rb_erase()</title>
<updated>2009-06-17T02:47:56Z</updated>
<author>
<name>Wolfram Strepp</name>
<email>wstrepp@gmx.de</email>
</author>
<published>2009-06-16T22:34:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4c60117811171d867d4f27f17ea07d7419d45dae'/>
<id>urn:sha1:4c60117811171d867d4f27f17ea07d7419d45dae</id>
<content type='text'>
There are two cases when a node, having 2 childs, is erased:
'normal case': the successor is not the right-hand-child of the node to be erased
'special case': the successor is the right-hand child of the node to be erased

Here some ascii-art, with following symbols (referring to the code):
O: node to be deleted
N: the successor of O
P: parent of N
C: child of N
L: some other node

normal case:

               O                         N
              / \                       / \
             /   \                     /   \
            L     \                   L     \
           / \     P      ----&gt;      / \     P
                  / \                       / \
                 /                         /
                N                         C
                 \                       / \
                  \
                   C
                  / \

special case:
              O|P                        N
              / \                       / \
             /   \                     /   \
            L     \                   L     \
           / \     N      ----&gt;      /       C
                    \                       / \
                     \
                      C
                     / \

Notice that for the special case we don't have to reconnect C to N.

Signed-off-by: Wolfram Strepp &lt;wstrepp@gmx.de&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rb_tree: reorganize code in rb_erase() for additional changes</title>
<updated>2009-06-17T02:47:56Z</updated>
<author>
<name>Wolfram Strepp</name>
<email>wstrepp@gmx.de</email>
</author>
<published>2009-06-16T22:34:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=16c047add3ceaf0ab882e3e094d1ec904d02312d'/>
<id>urn:sha1:16c047add3ceaf0ab882e3e094d1ec904d02312d</id>
<content type='text'>
First, move some code around in order to make the next change more obvious.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Wolfram Strepp &lt;wstrepp@gmx.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/rbtree.c: optimize rb_erase()</title>
<updated>2009-04-01T15:59:17Z</updated>
<author>
<name>Wolfram Strepp</name>
<email>wstrepp@gmx.de</email>
</author>
<published>2009-03-31T22:23:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=55a63998b8967615a15e2211ba0ff3a84a565824'/>
<id>urn:sha1:55a63998b8967615a15e2211ba0ff3a84a565824</id>
<content type='text'>
Tfour 4 redundant if-conditions in function __rb_erase_color() in
lib/rbtree.c are removed.

In pseudo-source-code, the structure of the code is as follows:

if ((!A || B) &amp;&amp; (!C || D)) {
	.
	.
	.
} else {
	if (!C || D) {//if this is true, it implies: (A == true) &amp;&amp; (B == false)
		if (A) {//hence this always evaluates to 'true'...
			.
		}
		.
		//at this point, C always becomes true, because of:
		__rb_rotate_right/left();
		//and:
		other = parent-&gt;rb_right/left;
	}
	.
	.
	if (C) {//...and this too !
		.
	}
}

Signed-off-by: Wolfram Strepp &lt;wstrepp@gmx.de&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Andrea Arcangeli &lt;andrea@qumranet.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rbtree: add const qualifier to some functions</title>
<updated>2009-01-10T14:04:33Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2009-01-10T11:12:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f4b477c47332367d35686bd2b808c2156b96d7c7'/>
<id>urn:sha1:f4b477c47332367d35686bd2b808c2156b96d7c7</id>
<content type='text'>
The 'rb_first()', 'rb_last()', 'rb_next()' and 'rb_prev()' calls
take a pointer to an RB node or RB root. They do not change the
pointed objects, so add a 'const' qualifier in order to make life
of the users of these functions easier.

Indeed, if I have my own constant pointer &amp;const struct my_type *p,
and I call 'rb_next(&amp;p-&gt;rb)', I get a GCC warning:

warning: passing argument 1 of ‘rb_next’ discards qualifiers from pointer target type

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] rbtree: fixed reversed RB_EMPTY_NODE and rb_next/prev</title>
<updated>2006-09-30T18:26:56Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@suse.de</email>
</author>
<published>2006-07-11T19:15:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=10fd48f2376db52f08bf0420d2c4f580e39269e1'/>
<id>urn:sha1:10fd48f2376db52f08bf0420d2c4f580e39269e1</id>
<content type='text'>
The conditions got reserved. Also make rb_next() and rb_prev() check
for the empty condition.

Signed-off-by: Jens Axboe &lt;axboe@suse.de&gt;
</content>
</entry>
<entry>
<title>[RBTREE] Switch rb_colour() et al to en_US spelling of 'color' for consistency</title>
<updated>2006-06-05T19:19:05Z</updated>
<author>
<name>David Woodhouse</name>
<email>dwmw2@infradead.org</email>
</author>
<published>2006-06-05T19:19:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2f3243aebd8df4d9eecaeca04bbff6c7dbfb2142'/>
<id>urn:sha1:2f3243aebd8df4d9eecaeca04bbff6c7dbfb2142</id>
<content type='text'>
Since rb_insert_color() is part of the _public_ API, while the others are
purely internal, switch to be consistent with that.

Signed-off-by: David Woodhouse &lt;dwmw2@infradead.org&gt;
</content>
</entry>
</feed>
