<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/net/rxrpc, branch v2.6.36</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Add a dummy printk function for the maintenance of unused printks</title>
<updated>2010-08-12T16:51:35+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-08-12T15:54:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=12fdff3fc2483f906ae6404a6e8dcf2550310b6f'/>
<id>12fdff3fc2483f906ae6404a6e8dcf2550310b6f</id>
<content type='text'>
Add a dummy printk function for the maintenance of unused printks through gcc
format checking, and also so that side-effect checking is maintained too.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a dummy printk function for the maintenance of unused printks through gcc
format checking, and also so that side-effect checking is maintained too.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>RxRPC: Fix a potential deadlock between the call resend_timer and state_lock</title>
<updated>2010-08-05T04:53:16+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-08-04T02:34:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3b5bac2bdea1de832bdd8e2c904ab7c9479ff9ed'/>
<id>3b5bac2bdea1de832bdd8e2c904ab7c9479ff9ed</id>
<content type='text'>
RxRPC can potentially deadlock as rxrpc_resend_time_expired() wants to get
call-&gt;state_lock so that it can alter the state of an RxRPC call.  However, its
caller (call_timer_fn()) has an apparent lock on the timer struct.

The problem is that rxrpc_resend_time_expired() isn't permitted to lock
call-&gt;state_lock as this could cause a deadlock against rxrpc_send_abort() as
that takes state_lock and then attempts to delete the resend timer by calling
del_timer_sync().

The deadlock can occur because del_timer_sync() will sit there forever waiting
for rxrpc_resend_time_expired() to return, but the latter may then wait for
call-&gt;state_lock, which rxrpc_send_abort() holds around del_timer_sync()...

This leads to a warning appearing in the kernel log that looks something like
the attached.

It should be sufficient to simply dispense with the locks.  It doesn't matter
if we set the resend timer expired event bit and queue the event processor
whilst we're changing state to one where the resend timer is irrelevant as the
event can just be ignored by the processor thereafter.

=======================================================
[ INFO: possible circular locking dependency detected ]
2.6.35-rc3-cachefs+ #115
-------------------------------------------------------
swapper/0 is trying to acquire lock:
 (&amp;call-&gt;state_lock){++--..}, at: [&lt;ffffffffa00200d4&gt;] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]

but task is already holding lock:
 (&amp;call-&gt;resend_timer){+.-...}, at: [&lt;ffffffff8103b675&gt;] run_timer_softirq+0x182/0x2a5

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #1 (&amp;call-&gt;resend_timer){+.-...}:
       [&lt;ffffffff810560bc&gt;] __lock_acquire+0x889/0x8fa
       [&lt;ffffffff81056184&gt;] lock_acquire+0x57/0x6d
       [&lt;ffffffff8103bb9c&gt;] del_timer_sync+0x3c/0x86
       [&lt;ffffffffa002bb7a&gt;] rxrpc_send_abort+0x50/0x97 [af_rxrpc]
       [&lt;ffffffffa002bdd9&gt;] rxrpc_kernel_abort_call+0xa1/0xdd [af_rxrpc]
       [&lt;ffffffffa0061588&gt;] afs_deliver_to_call+0x129/0x368 [kafs]
       [&lt;ffffffffa006181b&gt;] afs_process_async_call+0x54/0xff [kafs]
       [&lt;ffffffff8104261d&gt;] worker_thread+0x1ef/0x2e2
       [&lt;ffffffff81045f47&gt;] kthread+0x7a/0x82
       [&lt;ffffffff81002cd4&gt;] kernel_thread_helper+0x4/0x10

-&gt; #0 (&amp;call-&gt;state_lock){++--..}:
       [&lt;ffffffff81055237&gt;] validate_chain+0x727/0xd23
       [&lt;ffffffff810560bc&gt;] __lock_acquire+0x889/0x8fa
       [&lt;ffffffff81056184&gt;] lock_acquire+0x57/0x6d
       [&lt;ffffffff813e6b69&gt;] _raw_read_lock_bh+0x34/0x43
       [&lt;ffffffffa00200d4&gt;] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
       [&lt;ffffffff8103b6e6&gt;] run_timer_softirq+0x1f3/0x2a5
       [&lt;ffffffff81036828&gt;] __do_softirq+0xa2/0x13e
       [&lt;ffffffff81002dcc&gt;] call_softirq+0x1c/0x28
       [&lt;ffffffff810049f0&gt;] do_softirq+0x38/0x80
       [&lt;ffffffff810361a2&gt;] irq_exit+0x45/0x47
       [&lt;ffffffff81018fb3&gt;] smp_apic_timer_interrupt+0x88/0x96
       [&lt;ffffffff81002893&gt;] apic_timer_interrupt+0x13/0x20
       [&lt;ffffffff810011ac&gt;] cpu_idle+0x4d/0x83
       [&lt;ffffffff813e06f3&gt;] start_secondary+0x1bd/0x1c1

other info that might help us debug this:

1 lock held by swapper/0:
 #0:  (&amp;call-&gt;resend_timer){+.-...}, at: [&lt;ffffffff8103b675&gt;] run_timer_softirq+0x182/0x2a5

stack backtrace:
Pid: 0, comm: swapper Not tainted 2.6.35-rc3-cachefs+ #115
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff81054414&gt;] print_circular_bug+0xae/0xbd
 [&lt;ffffffff81055237&gt;] validate_chain+0x727/0xd23
 [&lt;ffffffff810560bc&gt;] __lock_acquire+0x889/0x8fa
 [&lt;ffffffff810539a7&gt;] ? mark_lock+0x42f/0x51f
 [&lt;ffffffff81056184&gt;] lock_acquire+0x57/0x6d
 [&lt;ffffffffa00200d4&gt;] ? rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
 [&lt;ffffffff813e6b69&gt;] _raw_read_lock_bh+0x34/0x43
 [&lt;ffffffffa00200d4&gt;] ? rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
 [&lt;ffffffffa00200d4&gt;] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
 [&lt;ffffffff8103b6e6&gt;] run_timer_softirq+0x1f3/0x2a5
 [&lt;ffffffff8103b675&gt;] ? run_timer_softirq+0x182/0x2a5
 [&lt;ffffffffa002007e&gt;] ? rxrpc_resend_time_expired+0x0/0x96 [af_rxrpc]
 [&lt;ffffffff810367ef&gt;] ? __do_softirq+0x69/0x13e
 [&lt;ffffffff81036828&gt;] __do_softirq+0xa2/0x13e
 [&lt;ffffffff81002dcc&gt;] call_softirq+0x1c/0x28
 [&lt;ffffffff810049f0&gt;] do_softirq+0x38/0x80
 [&lt;ffffffff810361a2&gt;] irq_exit+0x45/0x47
 [&lt;ffffffff81018fb3&gt;] smp_apic_timer_interrupt+0x88/0x96
 [&lt;ffffffff81002893&gt;] apic_timer_interrupt+0x13/0x20
 &lt;EOI&gt;  [&lt;ffffffff81049de1&gt;] ? __atomic_notifier_call_chain+0x0/0x86
 [&lt;ffffffff8100955b&gt;] ? mwait_idle+0x6e/0x78
 [&lt;ffffffff81009552&gt;] ? mwait_idle+0x65/0x78
 [&lt;ffffffff810011ac&gt;] cpu_idle+0x4d/0x83
 [&lt;ffffffff813e06f3&gt;] start_secondary+0x1bd/0x1c1

Signed-off-by: David Howells &lt;dhowells@redhat.com&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>
RxRPC can potentially deadlock as rxrpc_resend_time_expired() wants to get
call-&gt;state_lock so that it can alter the state of an RxRPC call.  However, its
caller (call_timer_fn()) has an apparent lock on the timer struct.

The problem is that rxrpc_resend_time_expired() isn't permitted to lock
call-&gt;state_lock as this could cause a deadlock against rxrpc_send_abort() as
that takes state_lock and then attempts to delete the resend timer by calling
del_timer_sync().

The deadlock can occur because del_timer_sync() will sit there forever waiting
for rxrpc_resend_time_expired() to return, but the latter may then wait for
call-&gt;state_lock, which rxrpc_send_abort() holds around del_timer_sync()...

This leads to a warning appearing in the kernel log that looks something like
the attached.

It should be sufficient to simply dispense with the locks.  It doesn't matter
if we set the resend timer expired event bit and queue the event processor
whilst we're changing state to one where the resend timer is irrelevant as the
event can just be ignored by the processor thereafter.

=======================================================
[ INFO: possible circular locking dependency detected ]
2.6.35-rc3-cachefs+ #115
-------------------------------------------------------
swapper/0 is trying to acquire lock:
 (&amp;call-&gt;state_lock){++--..}, at: [&lt;ffffffffa00200d4&gt;] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]

but task is already holding lock:
 (&amp;call-&gt;resend_timer){+.-...}, at: [&lt;ffffffff8103b675&gt;] run_timer_softirq+0x182/0x2a5

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #1 (&amp;call-&gt;resend_timer){+.-...}:
       [&lt;ffffffff810560bc&gt;] __lock_acquire+0x889/0x8fa
       [&lt;ffffffff81056184&gt;] lock_acquire+0x57/0x6d
       [&lt;ffffffff8103bb9c&gt;] del_timer_sync+0x3c/0x86
       [&lt;ffffffffa002bb7a&gt;] rxrpc_send_abort+0x50/0x97 [af_rxrpc]
       [&lt;ffffffffa002bdd9&gt;] rxrpc_kernel_abort_call+0xa1/0xdd [af_rxrpc]
       [&lt;ffffffffa0061588&gt;] afs_deliver_to_call+0x129/0x368 [kafs]
       [&lt;ffffffffa006181b&gt;] afs_process_async_call+0x54/0xff [kafs]
       [&lt;ffffffff8104261d&gt;] worker_thread+0x1ef/0x2e2
       [&lt;ffffffff81045f47&gt;] kthread+0x7a/0x82
       [&lt;ffffffff81002cd4&gt;] kernel_thread_helper+0x4/0x10

-&gt; #0 (&amp;call-&gt;state_lock){++--..}:
       [&lt;ffffffff81055237&gt;] validate_chain+0x727/0xd23
       [&lt;ffffffff810560bc&gt;] __lock_acquire+0x889/0x8fa
       [&lt;ffffffff81056184&gt;] lock_acquire+0x57/0x6d
       [&lt;ffffffff813e6b69&gt;] _raw_read_lock_bh+0x34/0x43
       [&lt;ffffffffa00200d4&gt;] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
       [&lt;ffffffff8103b6e6&gt;] run_timer_softirq+0x1f3/0x2a5
       [&lt;ffffffff81036828&gt;] __do_softirq+0xa2/0x13e
       [&lt;ffffffff81002dcc&gt;] call_softirq+0x1c/0x28
       [&lt;ffffffff810049f0&gt;] do_softirq+0x38/0x80
       [&lt;ffffffff810361a2&gt;] irq_exit+0x45/0x47
       [&lt;ffffffff81018fb3&gt;] smp_apic_timer_interrupt+0x88/0x96
       [&lt;ffffffff81002893&gt;] apic_timer_interrupt+0x13/0x20
       [&lt;ffffffff810011ac&gt;] cpu_idle+0x4d/0x83
       [&lt;ffffffff813e06f3&gt;] start_secondary+0x1bd/0x1c1

other info that might help us debug this:

1 lock held by swapper/0:
 #0:  (&amp;call-&gt;resend_timer){+.-...}, at: [&lt;ffffffff8103b675&gt;] run_timer_softirq+0x182/0x2a5

stack backtrace:
Pid: 0, comm: swapper Not tainted 2.6.35-rc3-cachefs+ #115
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff81054414&gt;] print_circular_bug+0xae/0xbd
 [&lt;ffffffff81055237&gt;] validate_chain+0x727/0xd23
 [&lt;ffffffff810560bc&gt;] __lock_acquire+0x889/0x8fa
 [&lt;ffffffff810539a7&gt;] ? mark_lock+0x42f/0x51f
 [&lt;ffffffff81056184&gt;] lock_acquire+0x57/0x6d
 [&lt;ffffffffa00200d4&gt;] ? rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
 [&lt;ffffffff813e6b69&gt;] _raw_read_lock_bh+0x34/0x43
 [&lt;ffffffffa00200d4&gt;] ? rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
 [&lt;ffffffffa00200d4&gt;] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]
 [&lt;ffffffff8103b6e6&gt;] run_timer_softirq+0x1f3/0x2a5
 [&lt;ffffffff8103b675&gt;] ? run_timer_softirq+0x182/0x2a5
 [&lt;ffffffffa002007e&gt;] ? rxrpc_resend_time_expired+0x0/0x96 [af_rxrpc]
 [&lt;ffffffff810367ef&gt;] ? __do_softirq+0x69/0x13e
 [&lt;ffffffff81036828&gt;] __do_softirq+0xa2/0x13e
 [&lt;ffffffff81002dcc&gt;] call_softirq+0x1c/0x28
 [&lt;ffffffff810049f0&gt;] do_softirq+0x38/0x80
 [&lt;ffffffff810361a2&gt;] irq_exit+0x45/0x47
 [&lt;ffffffff81018fb3&gt;] smp_apic_timer_interrupt+0x88/0x96
 [&lt;ffffffff81002893&gt;] apic_timer_interrupt+0x13/0x20
 &lt;EOI&gt;  [&lt;ffffffff81049de1&gt;] ? __atomic_notifier_call_chain+0x0/0x86
 [&lt;ffffffff8100955b&gt;] ? mwait_idle+0x6e/0x78
 [&lt;ffffffff81009552&gt;] ? mwait_idle+0x65/0x78
 [&lt;ffffffff810011ac&gt;] cpu_idle+0x4d/0x83
 [&lt;ffffffff813e06f3&gt;] start_secondary+0x1bd/0x1c1

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net-next: remove useless union keyword</title>
<updated>2010-06-11T06:31:35+00:00</updated>
<author>
<name>Changli Gao</name>
<email>xiaosuo@gmail.com</email>
</author>
<published>2010-06-11T06:31:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d8d1f30b95a635dbd610dcc5eb641aca8f4768cf'/>
<id>d8d1f30b95a635dbd610dcc5eb641aca8f4768cf</id>
<content type='text'>
remove useless union keyword in rtable, rt6_info and dn_route.

Since there is only one member in a union, the union keyword isn't useful.

Signed-off-by: Changli Gao &lt;xiaosuo@gmail.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&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>
remove useless union keyword in rtable, rt6_info and dn_route.

Since there is only one member in a union, the union keyword isn't useful.

Signed-off-by: Changli Gao &lt;xiaosuo@gmail.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: sock_def_readable() and friends RCU conversion</title>
<updated>2010-05-01T22:00:15+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2010-04-29T11:01:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=43815482370c510c569fd18edb57afcb0fa8cab6'/>
<id>43815482370c510c569fd18edb57afcb0fa8cab6</id>
<content type='text'>
sk_callback_lock rwlock actually protects sk-&gt;sk_sleep pointer, so we
need two atomic operations (and associated dirtying) per incoming
packet.

RCU conversion is pretty much needed :

1) Add a new structure, called "struct socket_wq" to hold all fields
that will need rcu_read_lock() protection (currently: a
wait_queue_head_t and a struct fasync_struct pointer).

[Future patch will add a list anchor for wakeup coalescing]

2) Attach one of such structure to each "struct socket" created in
sock_alloc_inode().

3) Respect RCU grace period when freeing a "struct socket_wq"

4) Change sk_sleep pointer in "struct sock" by sk_wq, pointer to "struct
socket_wq"

5) Change sk_sleep() function to use new sk-&gt;sk_wq instead of
sk-&gt;sk_sleep

6) Change sk_has_sleeper() to wq_has_sleeper() that must be used inside
a rcu_read_lock() section.

7) Change all sk_has_sleeper() callers to :
  - Use rcu_read_lock() instead of read_lock(&amp;sk-&gt;sk_callback_lock)
  - Use wq_has_sleeper() to eventually wakeup tasks.
  - Use rcu_read_unlock() instead of read_unlock(&amp;sk-&gt;sk_callback_lock)

8) sock_wake_async() is modified to use rcu protection as well.

9) Exceptions :
  macvtap, drivers/net/tun.c, af_unix use integrated "struct socket_wq"
instead of dynamically allocated ones. They dont need rcu freeing.

Some cleanups or followups are probably needed, (possible
sk_callback_lock conversion to a spinlock for example...).

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&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>
sk_callback_lock rwlock actually protects sk-&gt;sk_sleep pointer, so we
need two atomic operations (and associated dirtying) per incoming
packet.

RCU conversion is pretty much needed :

1) Add a new structure, called "struct socket_wq" to hold all fields
that will need rcu_read_lock() protection (currently: a
wait_queue_head_t and a struct fasync_struct pointer).

[Future patch will add a list anchor for wakeup coalescing]

2) Attach one of such structure to each "struct socket" created in
sock_alloc_inode().

3) Respect RCU grace period when freeing a "struct socket_wq"

4) Change sk_sleep pointer in "struct sock" by sk_wq, pointer to "struct
socket_wq"

5) Change sk_sleep() function to use new sk-&gt;sk_wq instead of
sk-&gt;sk_sleep

6) Change sk_has_sleeper() to wq_has_sleeper() that must be used inside
a rcu_read_lock() section.

7) Change all sk_has_sleeper() callers to :
  - Use rcu_read_lock() instead of read_lock(&amp;sk-&gt;sk_callback_lock)
  - Use wq_has_sleeper() to eventually wakeup tasks.
  - Use rcu_read_unlock() instead of read_unlock(&amp;sk-&gt;sk_callback_lock)

8) sock_wake_async() is modified to use rcu protection as well.

9) Exceptions :
  macvtap, drivers/net/tun.c, af_unix use integrated "struct socket_wq"
instead of dynamically allocated ones. They dont need rcu freeing.

Some cleanups or followups are probably needed, (possible
sk_callback_lock conversion to a spinlock for example...).

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: use sk_sleep()</title>
<updated>2010-04-26T18:18:45+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2010-04-25T22:20:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4a4771a58e13b46bfdc999fe481e550f8c6937ff'/>
<id>4a4771a58e13b46bfdc999fe481e550f8c6937ff</id>
<content type='text'>
Commit aa395145 (net: sk_sleep() helper) missed three files in the
conversion.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&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>
Commit aa395145 (net: sk_sleep() helper) missed three files in the
conversion.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: sk_sleep() helper</title>
<updated>2010-04-20T23:37:13+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2010-04-20T13:03:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=aa395145165cb06a0d0885221bbe0ce4a564391d'/>
<id>aa395145165cb06a0d0885221bbe0ce4a564391d</id>
<content type='text'>
Define a new function to return the waitqueue of a "struct sock".

static inline wait_queue_head_t *sk_sleep(struct sock *sk)
{
	return sk-&gt;sk_sleep;
}

Change all read occurrences of sk_sleep by a call to this function.

Needed for a future RCU conversion. sk_sleep wont be a field directly
available.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&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>
Define a new function to return the waitqueue of a "struct sock".

static inline wait_queue_head_t *sk_sleep(struct sock *sk)
{
	return sk-&gt;sk_sleep;
}

Change all read occurrences of sk_sleep by a call to this function.

Needed for a future RCU conversion. sk_sleep wont be a field directly
available.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h</title>
<updated>2010-03-30T13:02:32+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-03-24T08:04:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5a0e3ad6af8660be21ca98a971cd00f331318c05'/>
<id>5a0e3ad6af8660be21ca98a971cd00f331318c05</id>
<content type='text'>
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -&gt; slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Guess-its-ok-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Lee Schermerhorn &lt;Lee.Schermerhorn@hp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -&gt; slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Guess-its-ok-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Lee Schermerhorn &lt;Lee.Schermerhorn@hp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rxrpc: Check allocation failure.</title>
<updated>2010-03-22T16:57:19+00:00</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2010-03-22T13:50:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c3824d21eb653fe7017476724257ccaa8bf3d9e1'/>
<id>c3824d21eb653fe7017476724257ccaa8bf3d9e1</id>
<content type='text'>
alloc_skb() can return NULL.

Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
alloc_skb() can return NULL.

Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: use net_eq to compare nets</title>
<updated>2009-11-25T23:14:13+00:00</updated>
<author>
<name>Octavian Purdila</name>
<email>opurdila@ixiacom.com</email>
</author>
<published>2009-11-25T23:14:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=09ad9bc752519cc167d0a573e1acf69b5c707c67'/>
<id>09ad9bc752519cc167d0a573e1acf69b5c707c67</id>
<content type='text'>
Generated with the following semantic patch

@@
struct net *n1;
struct net *n2;
@@
- n1 == n2
+ net_eq(n1, n2)

@@
struct net *n1;
struct net *n2;
@@
- n1 != n2
+ !net_eq(n1, n2)

applied over {include,net,drivers/net}.

Signed-off-by: Octavian Purdila &lt;opurdila@ixiacom.com&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>
Generated with the following semantic patch

@@
struct net *n1;
struct net *n2;
@@
- n1 == n2
+ net_eq(n1, n2)

@@
struct net *n1;
struct net *n2;
@@
- n1 != n2
+ !net_eq(n1, n2)

applied over {include,net,drivers/net}.

Signed-off-by: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: pass kern to net_proto_family create function</title>
<updated>2009-11-06T06:18:14+00:00</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2009-11-06T06:18:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3f378b684453f2a028eda463ce383370545d9cc9'/>
<id>3f378b684453f2a028eda463ce383370545d9cc9</id>
<content type='text'>
The generic __sock_create function has a kern argument which allows the
security system to make decisions based on if a socket is being created by
the kernel or by userspace.  This patch passes that flag to the
net_proto_family specific create function, so it can do the same thing.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Acked-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&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>
The generic __sock_create function has a kern argument which allows the
security system to make decisions based on if a socket is being created by
the kernel or by userspace.  This patch passes that flag to the
net_proto_family specific create function, so it can do the same thing.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Acked-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
