<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/lib/percpu_counter.c, branch T20_LinuxImageV2.0Beta1_20121218</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>percpucounter: Optimize __percpu_counter_add a bit through the use of this_cpu() options.</title>
<updated>2010-12-17T14:07:18+00:00</updated>
<author>
<name>Christoph Lameter</name>
<email>cl@linux.com</email>
</author>
<published>2010-12-06T17:16:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=819a72af8d6653daa48334f24ce0a935ccdd33c7'/>
<id>819a72af8d6653daa48334f24ce0a935ccdd33c7</id>
<content type='text'>
The this_cpu_* options can be used to optimize __percpu_counter_add a bit. Avoids
some address arithmetic and saves 12 bytes.

Before:


00000000000001d3 &lt;__percpu_counter_add&gt;:
 1d3:	55                   	push   %rbp
 1d4:	48 89 e5             	mov    %rsp,%rbp
 1d7:	41 55                	push   %r13
 1d9:	41 54                	push   %r12
 1db:	53                   	push   %rbx
 1dc:	48 89 fb             	mov    %rdi,%rbx
 1df:	48 83 ec 08          	sub    $0x8,%rsp
 1e3:	4c 8b 67 30          	mov    0x30(%rdi),%r12
 1e7:	65 4c 03 24 25 00 00 	add    %gs:0x0,%r12
 1ee:	00 00
 1f0:	4d 63 2c 24          	movslq (%r12),%r13
 1f4:	48 63 c2             	movslq %edx,%rax
 1f7:	49 01 f5             	add    %rsi,%r13
 1fa:	49 39 c5             	cmp    %rax,%r13
 1fd:	7d 0a                	jge    209 &lt;__percpu_counter_add+0x36&gt;
 1ff:	f7 da                	neg    %edx
 201:	48 63 d2             	movslq %edx,%rdx
 204:	49 39 d5             	cmp    %rdx,%r13
 207:	7f 1e                	jg     227 &lt;__percpu_counter_add+0x54&gt;
 209:	48 89 df             	mov    %rbx,%rdi
 20c:	e8 00 00 00 00       	callq  211 &lt;__percpu_counter_add+0x3e&gt;
 211:	4c 01 6b 18          	add    %r13,0x18(%rbx)
 215:	48 89 df             	mov    %rbx,%rdi
 218:	41 c7 04 24 00 00 00 	movl   $0x0,(%r12)
 21f:	00
 220:	e8 00 00 00 00       	callq  225 &lt;__percpu_counter_add+0x52&gt;
 225:	eb 04                	jmp    22b &lt;__percpu_counter_add+0x58&gt;
 227:	45 89 2c 24          	mov    %r13d,(%r12)
 22b:	5b                   	pop    %rbx
 22c:	5b                   	pop    %rbx
 22d:	41 5c                	pop    %r12
 22f:	41 5d                	pop    %r13
 231:	c9                   	leaveq
 232:	c3                   	retq


After:

00000000000001d3 &lt;__percpu_counter_add&gt;:
 1d3:	55                   	push   %rbp
 1d4:	48 63 ca             	movslq %edx,%rcx
 1d7:	48 89 e5             	mov    %rsp,%rbp
 1da:	41 54                	push   %r12
 1dc:	53                   	push   %rbx
 1dd:	48 89 fb             	mov    %rdi,%rbx
 1e0:	48 8b 47 30          	mov    0x30(%rdi),%rax
 1e4:	65 44 8b 20          	mov    %gs:(%rax),%r12d
 1e8:	4d 63 e4             	movslq %r12d,%r12
 1eb:	49 01 f4             	add    %rsi,%r12
 1ee:	49 39 cc             	cmp    %rcx,%r12
 1f1:	7d 0a                	jge    1fd &lt;__percpu_counter_add+0x2a&gt;
 1f3:	f7 da                	neg    %edx
 1f5:	48 63 d2             	movslq %edx,%rdx
 1f8:	49 39 d4             	cmp    %rdx,%r12
 1fb:	7f 21                	jg     21e &lt;__percpu_counter_add+0x4b&gt;
 1fd:	48 89 df             	mov    %rbx,%rdi
 200:	e8 00 00 00 00       	callq  205 &lt;__percpu_counter_add+0x32&gt;
 205:	4c 01 63 18          	add    %r12,0x18(%rbx)
 209:	48 8b 43 30          	mov    0x30(%rbx),%rax
 20d:	48 89 df             	mov    %rbx,%rdi
 210:	65 c7 00 00 00 00 00 	movl   $0x0,%gs:(%rax)
 217:	e8 00 00 00 00       	callq  21c &lt;__percpu_counter_add+0x49&gt;
 21c:	eb 04                	jmp    222 &lt;__percpu_counter_add+0x4f&gt;
 21e:	65 44 89 20          	mov    %r12d,%gs:(%rax)
 222:	5b                   	pop    %rbx
 223:	41 5c                	pop    %r12
 225:	c9                   	leaveq
 226:	c3                   	retq

Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Reviewed-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Acked-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The this_cpu_* options can be used to optimize __percpu_counter_add a bit. Avoids
some address arithmetic and saves 12 bytes.

Before:


00000000000001d3 &lt;__percpu_counter_add&gt;:
 1d3:	55                   	push   %rbp
 1d4:	48 89 e5             	mov    %rsp,%rbp
 1d7:	41 55                	push   %r13
 1d9:	41 54                	push   %r12
 1db:	53                   	push   %rbx
 1dc:	48 89 fb             	mov    %rdi,%rbx
 1df:	48 83 ec 08          	sub    $0x8,%rsp
 1e3:	4c 8b 67 30          	mov    0x30(%rdi),%r12
 1e7:	65 4c 03 24 25 00 00 	add    %gs:0x0,%r12
 1ee:	00 00
 1f0:	4d 63 2c 24          	movslq (%r12),%r13
 1f4:	48 63 c2             	movslq %edx,%rax
 1f7:	49 01 f5             	add    %rsi,%r13
 1fa:	49 39 c5             	cmp    %rax,%r13
 1fd:	7d 0a                	jge    209 &lt;__percpu_counter_add+0x36&gt;
 1ff:	f7 da                	neg    %edx
 201:	48 63 d2             	movslq %edx,%rdx
 204:	49 39 d5             	cmp    %rdx,%r13
 207:	7f 1e                	jg     227 &lt;__percpu_counter_add+0x54&gt;
 209:	48 89 df             	mov    %rbx,%rdi
 20c:	e8 00 00 00 00       	callq  211 &lt;__percpu_counter_add+0x3e&gt;
 211:	4c 01 6b 18          	add    %r13,0x18(%rbx)
 215:	48 89 df             	mov    %rbx,%rdi
 218:	41 c7 04 24 00 00 00 	movl   $0x0,(%r12)
 21f:	00
 220:	e8 00 00 00 00       	callq  225 &lt;__percpu_counter_add+0x52&gt;
 225:	eb 04                	jmp    22b &lt;__percpu_counter_add+0x58&gt;
 227:	45 89 2c 24          	mov    %r13d,(%r12)
 22b:	5b                   	pop    %rbx
 22c:	5b                   	pop    %rbx
 22d:	41 5c                	pop    %r12
 22f:	41 5d                	pop    %r13
 231:	c9                   	leaveq
 232:	c3                   	retq


After:

00000000000001d3 &lt;__percpu_counter_add&gt;:
 1d3:	55                   	push   %rbp
 1d4:	48 63 ca             	movslq %edx,%rcx
 1d7:	48 89 e5             	mov    %rsp,%rbp
 1da:	41 54                	push   %r12
 1dc:	53                   	push   %rbx
 1dd:	48 89 fb             	mov    %rdi,%rbx
 1e0:	48 8b 47 30          	mov    0x30(%rdi),%rax
 1e4:	65 44 8b 20          	mov    %gs:(%rax),%r12d
 1e8:	4d 63 e4             	movslq %r12d,%r12
 1eb:	49 01 f4             	add    %rsi,%r12
 1ee:	49 39 cc             	cmp    %rcx,%r12
 1f1:	7d 0a                	jge    1fd &lt;__percpu_counter_add+0x2a&gt;
 1f3:	f7 da                	neg    %edx
 1f5:	48 63 d2             	movslq %edx,%rdx
 1f8:	49 39 d4             	cmp    %rdx,%r12
 1fb:	7f 21                	jg     21e &lt;__percpu_counter_add+0x4b&gt;
 1fd:	48 89 df             	mov    %rbx,%rdi
 200:	e8 00 00 00 00       	callq  205 &lt;__percpu_counter_add+0x32&gt;
 205:	4c 01 63 18          	add    %r12,0x18(%rbx)
 209:	48 8b 43 30          	mov    0x30(%rbx),%rax
 20d:	48 89 df             	mov    %rbx,%rdi
 210:	65 c7 00 00 00 00 00 	movl   $0x0,%gs:(%rax)
 217:	e8 00 00 00 00       	callq  21c &lt;__percpu_counter_add+0x49&gt;
 21c:	eb 04                	jmp    222 &lt;__percpu_counter_add+0x4f&gt;
 21e:	65 44 89 20          	mov    %r12d,%gs:(%rax)
 222:	5b                   	pop    %rbx
 223:	41 5c                	pop    %r12
 225:	c9                   	leaveq
 226:	c3                   	retq

Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Reviewed-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Acked-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu_counter: use this_cpu_ptr() instead of per_cpu_ptr()</title>
<updated>2010-10-26T23:52:19+00:00</updated>
<author>
<name>Christoph Lameter</name>
<email>cl@linux.com</email>
</author>
<published>2010-10-26T21:23:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ea00c30b5b31baa91be29bee966204eccc15e9d3'/>
<id>ea00c30b5b31baa91be29bee966204eccc15e9d3</id>
<content type='text'>
this_cpu_ptr() avoids an array lookup and can use the percpu offset of the
local cpu directly.

Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&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>
this_cpu_ptr() avoids an array lookup and can use the percpu offset of the
local cpu directly.

Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu_counter: add debugobj support</title>
<updated>2010-10-26T23:52:18+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-10-26T21:23:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e2852ae825dba5ebc159788720baec1a28a57125'/>
<id>e2852ae825dba5ebc159788720baec1a28a57125</id>
<content type='text'>
All percpu counters are linked to a global list on initialization and
removed from it on destruction.  The list is walked during CPU up/down.
If a percpu counter is freed without being properly destroyed, the system
will oops only on the next CPU up/down making it pretty nasty to track
down.  This patch adds debugobj support for percpu counters so that such
problems can be found easily.

As percpu counters don't make sense on stack and can't be statically
initialized, debugobj support is pretty simple.  It's initialized and
activated on counter initialization, and deactivatd and destroyed on
counter destruction.  With this patch applied, the bug fixed by commit
602586a83b719df0fbd94196a1359ed35aeb2df3 (shmem: put_super must
percpu_counter_destroy) triggers the following warning on tmpfs unmount
and the system won't oops on the next cpu up/down operation.

 ------------[ cut here ]------------
 WARNING: at lib/debugobjects.c:259 debug_print_object+0x5c/0x70()
 Hardware name: Bochs
 ODEBUG: free active (active state 0) object type: percpu_counter
 Modules linked in:
 Pid: 3999, comm: umount Not tainted 2.6.36-rc2-work+ #5
 Call Trace:
  [&lt;ffffffff81083f7f&gt;] warn_slowpath_common+0x7f/0xc0
  [&lt;ffffffff81084076&gt;] warn_slowpath_fmt+0x46/0x50
  [&lt;ffffffff813b45cc&gt;] debug_print_object+0x5c/0x70
  [&lt;ffffffff813b50e5&gt;] debug_check_no_obj_freed+0x125/0x210
  [&lt;ffffffff811577d3&gt;] kfree+0xb3/0x2f0
  [&lt;ffffffff81132edd&gt;] shmem_put_super+0x1d/0x30
  [&lt;ffffffff81162e96&gt;] generic_shutdown_super+0x56/0xe0
  [&lt;ffffffff81162f86&gt;] kill_anon_super+0x16/0x60
  [&lt;ffffffff81162ff7&gt;] kill_litter_super+0x27/0x30
  [&lt;ffffffff81163295&gt;] deactivate_locked_super+0x45/0x60
  [&lt;ffffffff81163cfa&gt;] deactivate_super+0x4a/0x70
  [&lt;ffffffff8117d446&gt;] mntput_no_expire+0x86/0xe0
  [&lt;ffffffff8117df7f&gt;] sys_umount+0x6f/0x360
  [&lt;ffffffff8103f01b&gt;] system_call_fastpath+0x16/0x1b
 ---[ end trace cce2a341ba3611a7 ]---

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Thomas Gleixner &lt;tglxlinutronix.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All percpu counters are linked to a global list on initialization and
removed from it on destruction.  The list is walked during CPU up/down.
If a percpu counter is freed without being properly destroyed, the system
will oops only on the next CPU up/down making it pretty nasty to track
down.  This patch adds debugobj support for percpu counters so that such
problems can be found easily.

As percpu counters don't make sense on stack and can't be statically
initialized, debugobj support is pretty simple.  It's initialized and
activated on counter initialization, and deactivatd and destroyed on
counter destruction.  With this patch applied, the bug fixed by commit
602586a83b719df0fbd94196a1359ed35aeb2df3 (shmem: put_super must
percpu_counter_destroy) triggers the following warning on tmpfs unmount
and the system won't oops on the next cpu up/down operation.

 ------------[ cut here ]------------
 WARNING: at lib/debugobjects.c:259 debug_print_object+0x5c/0x70()
 Hardware name: Bochs
 ODEBUG: free active (active state 0) object type: percpu_counter
 Modules linked in:
 Pid: 3999, comm: umount Not tainted 2.6.36-rc2-work+ #5
 Call Trace:
  [&lt;ffffffff81083f7f&gt;] warn_slowpath_common+0x7f/0xc0
  [&lt;ffffffff81084076&gt;] warn_slowpath_fmt+0x46/0x50
  [&lt;ffffffff813b45cc&gt;] debug_print_object+0x5c/0x70
  [&lt;ffffffff813b50e5&gt;] debug_check_no_obj_freed+0x125/0x210
  [&lt;ffffffff811577d3&gt;] kfree+0xb3/0x2f0
  [&lt;ffffffff81132edd&gt;] shmem_put_super+0x1d/0x30
  [&lt;ffffffff81162e96&gt;] generic_shutdown_super+0x56/0xe0
  [&lt;ffffffff81162f86&gt;] kill_anon_super+0x16/0x60
  [&lt;ffffffff81162ff7&gt;] kill_litter_super+0x27/0x30
  [&lt;ffffffff81163295&gt;] deactivate_locked_super+0x45/0x60
  [&lt;ffffffff81163cfa&gt;] deactivate_super+0x4a/0x70
  [&lt;ffffffff8117d446&gt;] mntput_no_expire+0x86/0xe0
  [&lt;ffffffff8117df7f&gt;] sys_umount+0x6f/0x360
  [&lt;ffffffff8103f01b&gt;] system_call_fastpath+0x16/0x1b
 ---[ end trace cce2a341ba3611a7 ]---

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Thomas Gleixner &lt;tglxlinutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu: fix list_head init bug in __percpu_counter_init()</title>
<updated>2010-10-26T23:52:04+00:00</updated>
<author>
<name>Masanori ITOH</name>
<email>itoumsn@nttdata.co.jp</email>
</author>
<published>2010-10-26T21:21:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8474b591faf3bb0a1e08a60d21d6baac498f15e4'/>
<id>8474b591faf3bb0a1e08a60d21d6baac498f15e4</id>
<content type='text'>
WARNING: at lib/list_debug.c:26 __list_add+0x3f/0x81()
Hardware name: Express5800/B120a [N8400-085]
list_add corruption. next-&gt;prev should be prev (ffffffff81a7ea00), but was dead000000200200. (next=ffff88080b872d58).
Modules linked in: aoe ipt_MASQUERADE iptable_nat nf_nat autofs4 sunrpc bridge 8021q garp stp llc ipv6 cpufreq_ondemand acpi_cpufreq freq_table dm_round_robin dm_multipath kvm_intel kvm uinput lpfc scsi_transport_fc igb ioatdma scsi_tgt i2c_i801 i2c_core dca iTCO_wdt iTCO_vendor_support pcspkr shpchp megaraid_sas [last unloaded: aoe]
Pid: 54, comm: events/3 Tainted: G        W  2.6.34-vanilla1 #1
Call Trace:
[&lt;ffffffff8104bd77&gt;] warn_slowpath_common+0x7c/0x94
[&lt;ffffffff8104bde6&gt;] warn_slowpath_fmt+0x41/0x43
[&lt;ffffffff8120fd2e&gt;] __list_add+0x3f/0x81
[&lt;ffffffff81212a12&gt;] __percpu_counter_init+0x59/0x6b
[&lt;ffffffff810d8499&gt;] bdi_init+0x118/0x17e
[&lt;ffffffff811f2c50&gt;] blk_alloc_queue_node+0x79/0x143
[&lt;ffffffff811f2d2b&gt;] blk_alloc_queue+0x11/0x13
[&lt;ffffffffa02a931d&gt;] aoeblk_gdalloc+0x8e/0x1c9 [aoe]
[&lt;ffffffffa02aa655&gt;] aoecmd_sleepwork+0x25/0xa8 [aoe]
[&lt;ffffffff8106186c&gt;] worker_thread+0x1a9/0x237
[&lt;ffffffffa02aa630&gt;] ? aoecmd_sleepwork+0x0/0xa8 [aoe]
[&lt;ffffffff81065827&gt;] ? autoremove_wake_function+0x0/0x39
[&lt;ffffffff810616c3&gt;] ? worker_thread+0x0/0x237
[&lt;ffffffff810653ad&gt;] kthread+0x7f/0x87
[&lt;ffffffff8100aa24&gt;] kernel_thread_helper+0x4/0x10
[&lt;ffffffff8106532e&gt;] ? kthread+0x0/0x87
[&lt;ffffffff8100aa20&gt;] ? kernel_thread_helper+0x0/0x10

It's because there is no initialization code for a list_head contained in
the struct backing_dev_info under CONFIG_HOTPLUG_CPU, and the bug comes up
when block device drivers calling blk_alloc_queue() are used.  In case of
me, I got them by using aoe.

Signed-off-by: Masanori Itoh &lt;itoumsn@nttdata.co.jp&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&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>
WARNING: at lib/list_debug.c:26 __list_add+0x3f/0x81()
Hardware name: Express5800/B120a [N8400-085]
list_add corruption. next-&gt;prev should be prev (ffffffff81a7ea00), but was dead000000200200. (next=ffff88080b872d58).
Modules linked in: aoe ipt_MASQUERADE iptable_nat nf_nat autofs4 sunrpc bridge 8021q garp stp llc ipv6 cpufreq_ondemand acpi_cpufreq freq_table dm_round_robin dm_multipath kvm_intel kvm uinput lpfc scsi_transport_fc igb ioatdma scsi_tgt i2c_i801 i2c_core dca iTCO_wdt iTCO_vendor_support pcspkr shpchp megaraid_sas [last unloaded: aoe]
Pid: 54, comm: events/3 Tainted: G        W  2.6.34-vanilla1 #1
Call Trace:
[&lt;ffffffff8104bd77&gt;] warn_slowpath_common+0x7c/0x94
[&lt;ffffffff8104bde6&gt;] warn_slowpath_fmt+0x41/0x43
[&lt;ffffffff8120fd2e&gt;] __list_add+0x3f/0x81
[&lt;ffffffff81212a12&gt;] __percpu_counter_init+0x59/0x6b
[&lt;ffffffff810d8499&gt;] bdi_init+0x118/0x17e
[&lt;ffffffff811f2c50&gt;] blk_alloc_queue_node+0x79/0x143
[&lt;ffffffff811f2d2b&gt;] blk_alloc_queue+0x11/0x13
[&lt;ffffffffa02a931d&gt;] aoeblk_gdalloc+0x8e/0x1c9 [aoe]
[&lt;ffffffffa02aa655&gt;] aoecmd_sleepwork+0x25/0xa8 [aoe]
[&lt;ffffffff8106186c&gt;] worker_thread+0x1a9/0x237
[&lt;ffffffffa02aa630&gt;] ? aoecmd_sleepwork+0x0/0xa8 [aoe]
[&lt;ffffffff81065827&gt;] ? autoremove_wake_function+0x0/0x39
[&lt;ffffffff810616c3&gt;] ? worker_thread+0x0/0x237
[&lt;ffffffff810653ad&gt;] kthread+0x7f/0x87
[&lt;ffffffff8100aa24&gt;] kernel_thread_helper+0x4/0x10
[&lt;ffffffff8106532e&gt;] ? kthread+0x0/0x87
[&lt;ffffffff8100aa20&gt;] ? kernel_thread_helper+0x0/0x10

It's because there is no initialization code for a list_head contained in
the struct backing_dev_info under CONFIG_HOTPLUG_CPU, and the bug comes up
when block device drivers calling blk_alloc_queue() are used.  In case of
me, I got them by using aoe.

Signed-off-by: Masanori Itoh &lt;itoumsn@nttdata.co.jp&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tmpfs: add accurate compare function to percpu_counter library</title>
<updated>2010-08-10T03:44:58+00:00</updated>
<author>
<name>Tim Chen</name>
<email>tim.c.chen@linux.intel.com</email>
</author>
<published>2010-08-10T00:19:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=27f5e0f694fd0600274a76854636c0749e3bb1f6'/>
<id>27f5e0f694fd0600274a76854636c0749e3bb1f6</id>
<content type='text'>
Add percpu_counter_compare that allows for a quick but accurate comparison
of percpu_counter with a given value.

A rough count is provided by the count field in percpu_counter structure,
without accounting for the other values stored in individual cpu counters.

The actual count is a sum of count and the cpu counters.  However, count
field is never different from the actual value by a factor of
batch*num_online_cpu.  We do not need to get actual count for comparison
if count is different from the given value by this factor and allows for
quick comparison without summing up all the per cpu counters.

Signed-off-by: Tim Chen &lt;tim.c.chen@linux.intel.com&gt;
Cc: Hugh Dickins &lt;hughd@google.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add percpu_counter_compare that allows for a quick but accurate comparison
of percpu_counter with a given value.

A rough count is provided by the count field in percpu_counter structure,
without accounting for the other values stored in individual cpu counters.

The actual count is a sum of count and the cpu counters.  However, count
field is never different from the actual value by a factor of
batch*num_online_cpu.  We do not need to get actual count for comparison
if count is different from the given value by this factor and allows for
quick comparison without summing up all the per cpu counters.

Signed-off-by: Tim Chen &lt;tim.c.chen@linux.intel.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2009-01-07T01:10:04+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-01-07T01:10:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f94181da7192f4ed8ccb1b633ea4ce56954df130'/>
<id>f94181da7192f4ed8ccb1b633ea4ce56954df130</id>
<content type='text'>
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  rcu: fix rcutorture bug
  rcu: eliminate synchronize_rcu_xxx macro
  rcu: make treercu safe for suspend and resume
  rcu: fix rcutree grace-period-latency bug on small systems
  futex: catch certain assymetric (get|put)_futex_key calls
  futex: make futex_(get|put)_key() calls symmetric
  locking, percpu counters: introduce separate lock classes
  swiotlb: clean up EXPORT_SYMBOL usage
  swiotlb: remove unnecessary declaration
  swiotlb: replace architecture-specific swiotlb.h with linux/swiotlb.h
  swiotlb: add support for systems with highmem
  swiotlb: store phys address in io_tlb_orig_addr array
  swiotlb: add hwdev to swiotlb_phys_to_bus() / swiotlb_sg_to_bus()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  rcu: fix rcutorture bug
  rcu: eliminate synchronize_rcu_xxx macro
  rcu: make treercu safe for suspend and resume
  rcu: fix rcutree grace-period-latency bug on small systems
  futex: catch certain assymetric (get|put)_futex_key calls
  futex: make futex_(get|put)_key() calls symmetric
  locking, percpu counters: introduce separate lock classes
  swiotlb: clean up EXPORT_SYMBOL usage
  swiotlb: remove unnecessary declaration
  swiotlb: replace architecture-specific swiotlb.h with linux/swiotlb.h
  swiotlb: add support for systems with highmem
  swiotlb: store phys address in io_tlb_orig_addr array
  swiotlb: add hwdev to swiotlb_phys_to_bus() / swiotlb_sg_to_bus()
</pre>
</div>
</content>
</entry>
<entry>
<title>percpu_counter: FBC_BATCH should be a variable</title>
<updated>2009-01-06T23:59:13+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>dada1@cosmosbay.com</email>
</author>
<published>2009-01-06T22:41:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=179f7ebff6be45738c6e2fa68c8d2cc5c2c6308e'/>
<id>179f7ebff6be45738c6e2fa68c8d2cc5c2c6308e</id>
<content type='text'>
For NR_CPUS &gt;= 16 values, FBC_BATCH is 2*NR_CPUS

Considering more and more distros are using high NR_CPUS values, it makes
sense to use a more sensible value for FBC_BATCH, and get rid of NR_CPUS.

A sensible value is 2*num_online_cpus(), with a minimum value of 32 (This
minimum value helps branch prediction in __percpu_counter_add())

We already have a hotcpu notifier, so we can adjust FBC_BATCH dynamically.

We rename FBC_BATCH to percpu_counter_batch since its not a constant
anymore.

Signed-off-by: Eric Dumazet &lt;dada1@cosmosbay.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For NR_CPUS &gt;= 16 values, FBC_BATCH is 2*NR_CPUS

Considering more and more distros are using high NR_CPUS values, it makes
sense to use a more sensible value for FBC_BATCH, and get rid of NR_CPUS.

A sensible value is 2*num_online_cpus(), with a minimum value of 32 (This
minimum value helps branch prediction in __percpu_counter_add())

We already have a hotcpu notifier, so we can adjust FBC_BATCH dynamically.

We rename FBC_BATCH to percpu_counter_batch since its not a constant
anymore.

Signed-off-by: Eric Dumazet &lt;dada1@cosmosbay.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branches 'core/futexes', 'core/locking', 'core/rcu' and 'linus' into core/urgent</title>
<updated>2009-01-06T08:32:11+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-01-06T08:32:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fdbc0450df12cc9cb397f3497db4b0cad7c1a8ff'/>
<id>fdbc0450df12cc9cb397f3497db4b0cad7c1a8ff</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>locking, percpu counters: introduce separate lock classes</title>
<updated>2008-12-29T12:43:00+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-12-26T14:08:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ea319518ba3de282c13ae1cf4bf2215c5e03e67e'/>
<id>ea319518ba3de282c13ae1cf4bf2215c5e03e67e</id>
<content type='text'>
Impact: fix lockdep false positives

Classify percpu_counter instances similar to regular lock objects --
that is, per instantiation site.

The networking code has increased its use of percpu_counters, which
leads to false positives if they are treated as a single class.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: fix lockdep false positives

Classify percpu_counter instances similar to regular lock objects --
that is, per instantiation site.

The networking code has increased its use of percpu_counters, which
leads to false positives if they are treated as a single class.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>revert "percpu_counter: new function percpu_counter_sum_and_set"</title>
<updated>2008-12-10T16:01:52+00:00</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2008-12-09T21:14:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=02d211688727ad02bb4555b1aa8ae2de16b21b39'/>
<id>02d211688727ad02bb4555b1aa8ae2de16b21b39</id>
<content type='text'>
Revert

    commit e8ced39d5e8911c662d4d69a342b9d053eaaac4e
    Author: Mingming Cao &lt;cmm@us.ibm.com&gt;
    Date:   Fri Jul 11 19:27:31 2008 -0400

        percpu_counter: new function percpu_counter_sum_and_set

As described in

	revert "percpu counter: clean up percpu_counter_sum_and_set()"

the new percpu_counter_sum_and_set() is racy against updates to the
cpu-local accumulators on other CPUs.  Revert that change.

This means that ext4 will be slow again.  But correct.

Reported-by: Eric Dumazet &lt;dada1@cosmosbay.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Mingming Cao &lt;cmm@us.ibm.com&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Cc: &lt;stable@kernel.org&gt;		[2.6.27.x]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&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>
Revert

    commit e8ced39d5e8911c662d4d69a342b9d053eaaac4e
    Author: Mingming Cao &lt;cmm@us.ibm.com&gt;
    Date:   Fri Jul 11 19:27:31 2008 -0400

        percpu_counter: new function percpu_counter_sum_and_set

As described in

	revert "percpu counter: clean up percpu_counter_sum_and_set()"

the new percpu_counter_sum_and_set() is racy against updates to the
cpu-local accumulators on other CPUs.  Revert that change.

This means that ext4 will be slow again.  But correct.

Reported-by: Eric Dumazet &lt;dada1@cosmosbay.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Mingming Cao &lt;cmm@us.ibm.com&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Cc: &lt;stable@kernel.org&gt;		[2.6.27.x]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
