<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/include/linux/list.h, branch v2.6.16.15</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>[PATCH] list.h: don't evaluate macro args multiple times</title>
<updated>2006-02-03T16:32:02+00:00</updated>
<author>
<name>Zach Brown</name>
<email>zach.brown@oracle.com</email>
</author>
<published>2006-02-03T11:03:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=490d6ab170c94a7a59870f528d765131b8963e79'/>
<id>490d6ab170c94a7a59870f528d765131b8963e79</id>
<content type='text'>
I noticed that list.h init functions were evaluating macro arguments
multiple times and thought it might be nice to protect the unsuspecting
caller.  Converting the macros to inline functions seems to reduce code
size, too.  A i386 defconfig build with gcc 3.3.3 from fc4:

   text    data     bss     dec     hex filename
3573148  565664  188828 4327640  4208d8 vmlinux.before
3572177  565664  188828 4326669  42050d vmlinux

add/remove: 0/0 grow/shrink: 11/144 up/down: 88/-1016 (-928)

There was no difference in checkstack output.

Signed-off-by: Zach Brown &lt;zach.brown@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I noticed that list.h init functions were evaluating macro arguments
multiple times and thought it might be nice to protect the unsuspecting
caller.  Converting the macros to inline functions seems to reduce code
size, too.  A i386 defconfig build with gcc 3.3.3 from fc4:

   text    data     bss     dec     hex filename
3573148  565664  188828 4327640  4208d8 vmlinux.before
3572177  565664  188828 4326669  42050d vmlinux

add/remove: 0/0 grow/shrink: 11/144 up/down: 88/-1016 (-928)

There was no difference in checkstack output.

Signed-off-by: Zach Brown &lt;zach.brown@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Add list_for_each_entry_safe_reverse()</title>
<updated>2006-01-10T16:01:24+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-01-10T04:51:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0ad42352c01788e41a33336577fdd270d8de55bb'/>
<id>0ad42352c01788e41a33336577fdd270d8de55bb</id>
<content type='text'>
Add list_for_each_entry_safe_reverse() to linux/list.h

This is needed by unmerged cachefs and be an as-yet-unreviewed
device_shutdown() fix.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Patrick Mochel &lt;mochel@digitalimplant.org&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add list_for_each_entry_safe_reverse() to linux/list.h

This is needed by unmerged cachefs and be an as-yet-unreviewed
device_shutdown() fix.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Patrick Mochel &lt;mochel@digitalimplant.org&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] add hlist_replace_rcu()</title>
<updated>2005-12-12T16:57:43+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2005-12-12T08:37:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b88cb42428f14fabdaf947150c00d65891820635'/>
<id>b88cb42428f14fabdaf947150c00d65891820635</id>
<content type='text'>
Add list_replace_rcu: replace old entry by new one.

Signed-off-by: Paul E. McKenney &lt;paulmck@us.ibm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add list_replace_rcu: replace old entry by new one.

Signed-off-by: Paul E. McKenney &lt;paulmck@us.ibm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Remove hlist_for_each_rcu() API, convert existing use to hlist_for_each_entry_rcu</title>
<updated>2005-11-07T15:53:35+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@us.ibm.com</email>
</author>
<published>2005-11-07T08:59:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=665a7583f32ab5b3bfe7a4d88da506542f7cdd75'/>
<id>665a7583f32ab5b3bfe7a4d88da506542f7cdd75</id>
<content type='text'>
Remove the hlist_for_each_rcu() API, which is used only in one place, and
is trivially converted to hlist_for_each_entry_rcu(), making the code
shorter and more readable.  Any out-of-tree uses may be similarly
converted.

Signed-off-by: "Paul E. McKenney" &lt;paulmck@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove the hlist_for_each_rcu() API, which is used only in one place, and
is trivially converted to hlist_for_each_entry_rcu(), making the code
shorter and more readable.  Any out-of-tree uses may be similarly
converted.

Signed-off-by: "Paul E. McKenney" &lt;paulmck@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] list: add missing rcu_dereference on first element</title>
<updated>2005-10-17T15:59:10+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2005-10-17T03:29:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b24d18aa743dad0c42918157c5d717686269d3a8'/>
<id>b24d18aa743dad0c42918157c5d717686269d3a8</id>
<content type='text'>
It seems that all the list_*_rcu primitives are missing a memory barrier
on the very first dereference.  For example,

#define list_for_each_rcu(pos, head) \
	for (pos = (head)-&gt;next; prefetch(pos-&gt;next), pos != (head); \
		pos = rcu_dereference(pos-&gt;next))

It will go something like:

	pos = (head)-&gt;next

	prefetch(pos-&gt;next)

	pos != (head)

	do stuff

We're missing a barrier here.

	pos = rcu_dereference(pos-&gt;next)

		fetch pos-&gt;next

		barrier given by rcu_dereference(pos-&gt;next)

		store pos

Without the missing barrier, the pos-&gt;next value may turn out to be stale.
In fact, if "do stuff" were also dereferencing pos and relying on
list_for_each_rcu to provide the barrier then it may also break.

So here is a patch to make sure that we have a barrier for the first
element in the list.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Acked-by: "Paul E. McKenney" &lt;paulmck@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It seems that all the list_*_rcu primitives are missing a memory barrier
on the very first dereference.  For example,

#define list_for_each_rcu(pos, head) \
	for (pos = (head)-&gt;next; prefetch(pos-&gt;next), pos != (head); \
		pos = rcu_dereference(pos-&gt;next))

It will go something like:

	pos = (head)-&gt;next

	prefetch(pos-&gt;next)

	pos != (head)

	do stuff

We're missing a barrier here.

	pos = rcu_dereference(pos-&gt;next)

		fetch pos-&gt;next

		barrier given by rcu_dereference(pos-&gt;next)

		store pos

Without the missing barrier, the pos-&gt;next value may turn out to be stale.
In fact, if "do stuff" were also dereferencing pos and relying on
list_for_each_rcu to provide the barrier then it may also break.

So here is a patch to make sure that we have a barrier for the first
element in the list.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Acked-by: "Paul E. McKenney" &lt;paulmck@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[LIST]: Add docbook header comments for hlist_add_{before,after}_rcu()</title>
<updated>2005-08-29T23:11:00+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@us.ibm.com</email>
</author>
<published>2005-08-25T23:08:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cf4ef01440ca5c6d96f2ea2b793a37a0a863a045'/>
<id>cf4ef01440ca5c6d96f2ea2b793a37a0a863a045</id>
<content type='text'>
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IPV4]: Prepare FIB core for RCU.</title>
<updated>2005-08-29T23:08:31+00:00</updated>
<author>
<name>Robert Olsson</name>
<email>Robert.Olsson@data.slu.se</email>
</author>
<published>2005-08-25T20:01:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e5b4376074e02b783e56a8f7c42d544e18112c4e'/>
<id>e5b4376074e02b783e56a8f7c42d544e18112c4e</id>
<content type='text'>
* RCU versions of hlist_***_rcu
* fib_alias partial rcu port just whats needed now.

Signed-off-by: Robert Olsson &lt;Robert.Olsson@data.slu.se&gt;
Signed-off-by: Stephen Hemminger &lt;shemminger@osdl.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* RCU versions of hlist_***_rcu
* fib_alias partial rcu port just whats needed now.

Signed-off-by: Robert Olsson &lt;Robert.Olsson@data.slu.se&gt;
Signed-off-by: Stephen Hemminger &lt;shemminger@osdl.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[CCID3]: Separate most of the packet history code</title>
<updated>2005-08-29T22:56:28+00:00</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@mandriva.com</email>
</author>
<published>2005-08-10T15:59:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8c60f3fab55712f23f2bd557ceedfbb00c649f37'/>
<id>8c60f3fab55712f23f2bd557ceedfbb00c649f37</id>
<content type='text'>
This also changes the list_for_each_entry_safe_continue behaviour to match its
kerneldoc comment, that is, to start after the pos passed.

Also adds several helper functions from previously open coded fragments, making
the code more clear.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@mandriva.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This also changes the list_for_each_entry_safe_continue behaviour to match its
kerneldoc comment, that is, to start after the pos passed.

Also adds several helper functions from previously open coded fragments, making
the code more clear.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@mandriva.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[LIST]: Introduce list_for_each_entry_safe_continue</title>
<updated>2005-08-29T22:50:04+00:00</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@ghostprotocols.net</email>
</author>
<published>2005-08-10T03:15:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=74459dc7bacda04d14626d239c8f5c4dac22560d'/>
<id>74459dc7bacda04d14626d239c8f5c4dac22560d</id>
<content type='text'>
Used in the dccp CCID3 code, that is going to be submitted RSN.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@ghostprotocols.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Used in the dccp CCID3 code, that is going to be submitted RSN.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@ghostprotocols.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] RCU: clean up a few remaining synchronize_kernel() calls</title>
<updated>2005-06-25T23:24:38+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@us.ibm.com</email>
</author>
<published>2005-06-25T21:55:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b2b18660066997420b716c1881a6be8b82700d97'/>
<id>b2b18660066997420b716c1881a6be8b82700d97</id>
<content type='text'>
2.6.12-rc6-mm1 has a few remaining synchronize_kernel()s, some (but not
all) in comments.  This patch changes these synchronize_kernel() calls (and
comments) to synchronize_rcu() or synchronize_sched() as follows:

- arch/x86_64/kernel/mce.c mce_read(): change to synchronize_sched() to
  handle races with machine-check exceptions (synchronize_rcu() would not cut
  it given RCU implementations intended for hardcore realtime use.

- drivers/input/serio/i8042.c i8042_stop(): change to synchronize_sched() to
  handle races with i8042_interrupt() interrupt handler.  Again,
  synchronize_rcu() would not cut it given RCU implementations intended for
  hardcore realtime use.

- include/*/kdebug.h comments: change to synchronize_sched() to handle races
  with NMIs.  As before, synchronize_rcu() would not cut it...

- include/linux/list.h comment: change to synchronize_rcu(), since this
  comment is for list_del_rcu().

- security/keys/key.c unregister_key_type(): change to synchronize_rcu(),
  since this is interacting with RCU read side.

- security/keys/process_keys.c install_session_keyring(): change to
  synchronize_rcu(), since this is interacting with RCU read side.

Signed-off-by: "Paul E. McKenney" &lt;paulmck@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
2.6.12-rc6-mm1 has a few remaining synchronize_kernel()s, some (but not
all) in comments.  This patch changes these synchronize_kernel() calls (and
comments) to synchronize_rcu() or synchronize_sched() as follows:

- arch/x86_64/kernel/mce.c mce_read(): change to synchronize_sched() to
  handle races with machine-check exceptions (synchronize_rcu() would not cut
  it given RCU implementations intended for hardcore realtime use.

- drivers/input/serio/i8042.c i8042_stop(): change to synchronize_sched() to
  handle races with i8042_interrupt() interrupt handler.  Again,
  synchronize_rcu() would not cut it given RCU implementations intended for
  hardcore realtime use.

- include/*/kdebug.h comments: change to synchronize_sched() to handle races
  with NMIs.  As before, synchronize_rcu() would not cut it...

- include/linux/list.h comment: change to synchronize_rcu(), since this
  comment is for list_del_rcu().

- security/keys/key.c unregister_key_type(): change to synchronize_rcu(),
  since this is interacting with RCU read side.

- security/keys/process_keys.c install_session_keyring(): change to
  synchronize_rcu(), since this is interacting with RCU read side.

Signed-off-by: "Paul E. McKenney" &lt;paulmck@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
