<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/linux/rculist.h, branch linux-3.6.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-3.6.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-3.6.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2012-04-25T03:54:49Z</updated>
<entry>
<title>rcu: Replace list_first_entry_rcu() with list_first_or_null_rcu()</title>
<updated>2012-04-25T03:54:49Z</updated>
<author>
<name>Michel Machado</name>
<email>michel@digirati.com.br</email>
</author>
<published>2012-04-10T18:07:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f88022a4f650ac1778cafcc17d2e522283bdf590'/>
<id>urn:sha1:f88022a4f650ac1778cafcc17d2e522283bdf590</id>
<content type='text'>
The list_first_entry_rcu() macro is inherently unsafe because it cannot
be applied to an empty list.  But because RCU readers do not exclude
updaters, a list might become empty between the time that list_empty()
claimed it was non-empty and the time that list_first_entry_rcu() is
invoked.  Therefore, the list_empty() test cannot be separated from the
list_first_entry_rcu() call.  This commit therefore combines these to
macros to create a new list_first_or_null_rcu() macro that replaces
the old (and unsafe) list_first_entry_rcu() macro.

This patch incorporates Paul's review comments on the previous version of
this patch available here:

https://lkml.org/lkml/2012/4/2/536

This patch cannot break any upstream code because list_first_entry_rcu()
is not being used anywhere in the kernel (tested with grep(1)), and any
external code using it is probably broken as a result of using it.

Signed-off-by: Michel Machado &lt;michel@digirati.com.br&gt;
CC: "Paul E. McKenney" &lt;paulmck@linux.vnet.ibm.com&gt;
CC: Dipankar Sarma &lt;dipankar@in.ibm.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: List-debug variants of rcu list routines.</title>
<updated>2012-04-25T03:54:49Z</updated>
<author>
<name>Dave Jones</name>
<email>davej@redhat.com</email>
</author>
<published>2012-03-15T02:17:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=559f9badd11ddf399f88b18b4c0f110fd511ae53'/>
<id>urn:sha1:559f9badd11ddf399f88b18b4c0f110fd511ae53</id>
<content type='text'>
* Make __list_add_rcu check the next-&gt;prev and prev-&gt;next pointers
  just like __list_add does.
* Make list_del_rcu use __list_del_entry, which does the same checking
  at deletion time.

Has been running for a week here without anything being tripped up,
but it seems worth adding for completeness just in case something
ever does corrupt those lists.

Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: Fix wrong check in list_splice_init_rcu()</title>
<updated>2011-07-20T21:10:20Z</updated>
<author>
<name>Jan H. Schönherr</name>
<email>schnhrr@cs.tu-berlin.de</email>
</author>
<published>2011-07-19T19:10:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7f70893173b056df691b2ee7546bb44fd9abae6a'/>
<id>urn:sha1:7f70893173b056df691b2ee7546bb44fd9abae6a</id>
<content type='text'>
If the list to be spliced is empty, then list_splice_init_rcu() has
nothing to do.  Unfortunately, list_splice_init_rcu() does not check
the list to be spliced; it instead checks the list to be spliced into.
This results in memory leaks given current usage.  This commit
therefore fixes the empty-list check.

Signed-off-by: Jan H. Schönherr &lt;schnhrr@cs.tu-berlin.de&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>list: remove prefetching from regular list iterators</title>
<updated>2011-05-19T21:15:29Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-05-19T21:15:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e66eed651fd18a961f11cda62f3b5286c8cc4f9f'/>
<id>urn:sha1:e66eed651fd18a961f11cda62f3b5286c8cc4f9f</id>
<content type='text'>
This is removes the use of software prefetching from the regular list
iterators.  We don't want it.  If you do want to prefetch in some
iterator of yours, go right ahead.  Just don't expect the iterator to do
it, since normally the downsides are bigger than the upsides.

It also replaces &lt;linux/prefetch.h&gt; with &lt;linux/const.h&gt;, because the
use of LIST_POISON ends up needing it.  &lt;linux/poison.h&gt; is sadly not
self-contained, and including prefetch.h just happened to hide that.

Suggested by David Miller (networking has a lot of regular lists that
are often empty or a single entry, and prefetching is not going to do
anything but add useless instructions).

Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: linux-arch@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>hlist: remove software prefetching in hlist iterators</title>
<updated>2011-05-19T20:50:07Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-05-19T20:50:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=75d65a425c0163d3ec476ddc12b51087217a070c'/>
<id>urn:sha1:75d65a425c0163d3ec476ddc12b51087217a070c</id>
<content type='text'>
They not only increase the code footprint, they actually make things
slower rather than faster.  On internationally acclaimed benchmarks
("make -j16" on an already fully built kernel source tree) the hlist
prefetching slows down the build by up to 1%.

(Almost all of it comes from hlist_for_each_entry_rcu() as used by
avc_has_perm_noaudit(), which is very hot due to all the pathname
lookups to see if there is anything to do).

The cause seems to be two-fold:

 - on at least some Intel cores, prefetch(NULL) ends up with some
   microarchitectural stall due to the TLB miss that it incurs.  The
   hlist case triggers this very commonly, since the NULL pointer is the
   last entry in the list.

 - the prefetch appears to cause more D$ activity, probably because it
   prefetches hash list entries that are never actually used (because we
   ended the search early due to a hit).

Regardless, the numbers clearly say that the implicit prefetching is
simply a bad idea.  If some _particular_ user of the hlist iterators
wants to prefetch the next list entry, they can do so themselves
explicitly, rather than depend on all list iterators doing so
implicitly.

Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: linux-arch@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rcu: remove unused __list_for_each_rcu() macro</title>
<updated>2010-12-17T20:34:59Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2010-12-16T05:12:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3c2dcf2aed5ea22ecf65a9a871c4963faec421b3'/>
<id>urn:sha1:3c2dcf2aed5ea22ecf65a9a871c4963faec421b3</id>
<content type='text'>
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rculist: fix borked __list_for_each_rcu() macro</title>
<updated>2010-12-17T20:34:58Z</updated>
<author>
<name>Mariusz Kozlowski</name>
<email>mk@lab.zgora.pl</email>
</author>
<published>2010-12-15T22:11:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8a9c1cee26c0ece23b38c45b92b724438878f842'/>
<id>urn:sha1:8a9c1cee26c0ece23b38c45b92b724438878f842</id>
<content type='text'>
This restores parentheses blance.

Signed-off-by: Mariusz Kozlowski &lt;mk@lab.zgora.pl&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: add comment stating that list_empty() applies to RCU-protected lists</title>
<updated>2010-08-20T16:00:18Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2010-08-20T04:43:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=65e6bf484c497f02d47a0faae69ee398cd59cfda'/>
<id>urn:sha1:65e6bf484c497f02d47a0faae69ee398cd59cfda</id>
<content type='text'>
Because list_empty() does not dereference any RCU-protected pointers, and
further does not pass such pointers to the caller (so that the caller
does not dereference them either), it is safe to use list_empty() on
RCU-protected lists.  There is no need for a list_empty_rcu().  This
commit adds a comment stating this explicitly.

Requested-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rculist: avoid __rcu annotations</title>
<updated>2010-08-20T00:18:00Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2010-02-25T15:55:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=67bdbffd696f29a0b68aa8daa285783a06651583'/>
<id>urn:sha1:67bdbffd696f29a0b68aa8daa285783a06651583</id>
<content type='text'>
This avoids warnings from missing __rcu annotations
in the rculist implementation, making it possible to
use the same lists in both RCU and non-RCU cases.

We can add rculist annotations later, together with
lockdep support for rculist, which is missing as well,
but that may involve changing all the users.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Cc: Sukadev Bhattiprolu &lt;sukadev@us.ibm.com&gt;
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
</content>
</entry>
<entry>
<title>net: rcu fixes</title>
<updated>2010-05-03T22:53:54Z</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2010-05-03T10:50:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4f70ecca9c57731b4acbe5043eb22e4416bd2368'/>
<id>urn:sha1:4f70ecca9c57731b4acbe5043eb22e4416bd2368</id>
<content type='text'>
Add hlist_for_each_entry_rcu_bh() and
hlist_for_each_entry_continue_rcu_bh() macros, and use them in
ipv6_get_ifaddr(), if6_get_first() and if6_get_next() to fix lockdeps
warnings.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Reviewed-by: "Paul E. McKenney" &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
