[blkg_stat] inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.

2014-08-21 Thread Fengguang Wu
Hi Hong and Jens,

FYI, this patch still has the error that impacts the latest linux-next.

git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
commit 2c575026fae6e63771bd2a4c1d407214a8096a89
Author: Hong Zhiguo 
AuthorDate: Wed Nov 20 10:35:05 2013 -0700
Commit: Jens Axboe 
CommitDate: Wed Nov 20 15:33:04 2013 -0700

Update of blkg_stat and blkg_rwstat may happen in bh context.
While u64_stats_fetch_retry is only preempt_disable on 32bit
UP system. This is not enough to avoid preemption by bh and
may read strange 64 bit value.

Signed-off-by: Hong Zhiguo 
Acked-by: Tejun Heo 
Cc: sta...@kernel.org
Signed-off-by: Jens Axboe 

+---+++
|   | 
82023bb7f7 | 2c575026fa |
+---+++
| boot_successes| 496   
 | 0  |
| boot_failures | 494   
 | 330|
| WARNING:CPU:PID:at_arch/x86/mm/ioremap.c:__early_ioremap()| 493   
 | 177|
| WARNING:CPU:PID:at_kernel/trace/ring_buffer.c:rb_reserve_next_event() | 493   
 | 177|
| backtrace:acpi_initialize_tables  | 493   
 | 177|
| backtrace:acpi_table_init | 493   
 | 177|
| backtrace:acpi_boot_table_init| 493   
 | 177|
| backtrace:ring_buffer_producer_thread | 493   
 | 177|
| BUG:unable_to_handle_kernel_NULL_pointer_dereference  | 3 
 | 2  |
| Oops  | 3 
 | 2  |
| EIP_is_at_strlen  | 3 
 | 2  |
| Kernel_panic-not_syncing:Fatal_exception_in_interrupt | 2 
 ||
| Kernel_panic-not_syncing:Fatal_exception  | 1 
 | 2  |
| backtrace:vfs_write   | 1 
 | 2  |
| backtrace:SyS_write   | 1 
 | 2  |
| WARNING:CPU:PID:at_kernel/softirq.c:local_bh_enable() | 0 
 | 330|
| inconsistent_IN-SOFTIRQ-W-SOFTIRQ-ON-W_usage  | 0 
 | 330|
| backtrace:do_mount| 0 
 | 330|
| backtrace:SyS_mount   | 0 
 | 330|
| backtrace:smpboot_thread_fn   | 0 
 | 182|
+---+++

[7.266963] scsi_id (235) used greatest stack depth: 6008 bytes left
[7.403676] [ cut here ]
[7.404033] WARNING: CPU: 0 PID: 264 at kernel/softirq.c:156 
local_bh_enable+0x9c/0x1e0()
[7.404033] CPU: 0 PID: 264 Comm: mount Tainted: GW
3.12.0-02795-g2c57502 #16
[7.404033]  0001 511d1a58 420d4200 511d1a88 4109f3dd 426e5c40  
0108
[7.404033]  426e5fb0 009c 410a68dc 410a68dc 0001 4183189d 0001 
511d1a98
[7.404033]  4109f4c2 0009  511d1aac 410a68dc 51c9f008 51c9f23c 
511d1ad8
[7.404033] Call Trace:
[7.404033]  [<420d4200>] dump_stack+0x16/0x18
[7.404033]  [<4109f3dd>] warn_slowpath_common+0x8d/0xb0
[7.404033]  [<410a68dc>] ? local_bh_enable+0x9c/0x1e0
[7.404033]  [<410a68dc>] ? local_bh_enable+0x9c/0x1e0
[7.404033]  [<4183189d>] ? cfqg_stats_update_avg_queue_size+0x2d/0x100
[7.404033]  [<4109f4c2>] warn_slowpath_null+0x22/0x30
[7.404033]  [<410a68dc>] local_bh_enable+0x9c/0x1e0
[7.404033]  [<4183189d>] cfqg_stats_update_avg_queue_size+0x2d/0x100
[7.404033]  [<41833f4a>] __cfq_set_active_queue+0x15a/0x210
[7.404033]  [<418300d9>] ? cfq_group_service_tree_add+0x199/0x260
[7.404033]  [<41831f84>] ? cfq_service_tree_add+0x404/0x4f0
[7.404033]  [<418320a9>] ? cfq_resort_rr_list+0x39/0x40
[7.404033]  [<41832fff>] ? cfq_add_cfqq_rr+0x16f/0x1c0
[7.404033]  [<4183a014>] ? cfq_update_idle_window.isra.78+0x84/0x3a0
[7.404033]  [<41836b4c>] cfq_select_queue+0x7ec/0xa90
[7.404033]  [<4183988f>] cfq_dispatch_requests+0x2bf/0x9c0
[7.404033]  [<410833ec>] ? pvclock_clocksource_read+0xfc/0x240
[7.404033]  [<410822f3>] ? kvm_clock_read+0x13/0x20
[7.404033]  [<4183a702>] ? cfq_insert_request+0x3d2/0x8b0
[7.404033]  [<410e0fc3>] ? sched_clock_local.constprop.2+0x43/0x190
[7.404033]  

[blkg_stat] inconsistent {IN-SOFTIRQ-W} - {SOFTIRQ-ON-W} usage.

2014-08-21 Thread Fengguang Wu
Hi Hong and Jens,

FYI, this patch still has the error that impacts the latest linux-next.

git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
commit 2c575026fae6e63771bd2a4c1d407214a8096a89
Author: Hong Zhiguo zhiguoh...@tencent.com
AuthorDate: Wed Nov 20 10:35:05 2013 -0700
Commit: Jens Axboe ax...@kernel.dk
CommitDate: Wed Nov 20 15:33:04 2013 -0700

Update of blkg_stat and blkg_rwstat may happen in bh context.
While u64_stats_fetch_retry is only preempt_disable on 32bit
UP system. This is not enough to avoid preemption by bh and
may read strange 64 bit value.

Signed-off-by: Hong Zhiguo zhiguoh...@tencent.com
Acked-by: Tejun Heo t...@kernel.org
Cc: sta...@kernel.org
Signed-off-by: Jens Axboe ax...@kernel.dk

+---+++
|   | 
82023bb7f7 | 2c575026fa |
+---+++
| boot_successes| 496   
 | 0  |
| boot_failures | 494   
 | 330|
| WARNING:CPU:PID:at_arch/x86/mm/ioremap.c:__early_ioremap()| 493   
 | 177|
| WARNING:CPU:PID:at_kernel/trace/ring_buffer.c:rb_reserve_next_event() | 493   
 | 177|
| backtrace:acpi_initialize_tables  | 493   
 | 177|
| backtrace:acpi_table_init | 493   
 | 177|
| backtrace:acpi_boot_table_init| 493   
 | 177|
| backtrace:ring_buffer_producer_thread | 493   
 | 177|
| BUG:unable_to_handle_kernel_NULL_pointer_dereference  | 3 
 | 2  |
| Oops  | 3 
 | 2  |
| EIP_is_at_strlen  | 3 
 | 2  |
| Kernel_panic-not_syncing:Fatal_exception_in_interrupt | 2 
 ||
| Kernel_panic-not_syncing:Fatal_exception  | 1 
 | 2  |
| backtrace:vfs_write   | 1 
 | 2  |
| backtrace:SyS_write   | 1 
 | 2  |
| WARNING:CPU:PID:at_kernel/softirq.c:local_bh_enable() | 0 
 | 330|
| inconsistent_IN-SOFTIRQ-W-SOFTIRQ-ON-W_usage  | 0 
 | 330|
| backtrace:do_mount| 0 
 | 330|
| backtrace:SyS_mount   | 0 
 | 330|
| backtrace:smpboot_thread_fn   | 0 
 | 182|
+---+++

[7.266963] scsi_id (235) used greatest stack depth: 6008 bytes left
[7.403676] [ cut here ]
[7.404033] WARNING: CPU: 0 PID: 264 at kernel/softirq.c:156 
local_bh_enable+0x9c/0x1e0()
[7.404033] CPU: 0 PID: 264 Comm: mount Tainted: GW
3.12.0-02795-g2c57502 #16
[7.404033]  0001 511d1a58 420d4200 511d1a88 4109f3dd 426e5c40  
0108
[7.404033]  426e5fb0 009c 410a68dc 410a68dc 0001 4183189d 0001 
511d1a98
[7.404033]  4109f4c2 0009  511d1aac 410a68dc 51c9f008 51c9f23c 
511d1ad8
[7.404033] Call Trace:
[7.404033]  [420d4200] dump_stack+0x16/0x18
[7.404033]  [4109f3dd] warn_slowpath_common+0x8d/0xb0
[7.404033]  [410a68dc] ? local_bh_enable+0x9c/0x1e0
[7.404033]  [410a68dc] ? local_bh_enable+0x9c/0x1e0
[7.404033]  [4183189d] ? cfqg_stats_update_avg_queue_size+0x2d/0x100
[7.404033]  [4109f4c2] warn_slowpath_null+0x22/0x30
[7.404033]  [410a68dc] local_bh_enable+0x9c/0x1e0
[7.404033]  [4183189d] cfqg_stats_update_avg_queue_size+0x2d/0x100
[7.404033]  [41833f4a] __cfq_set_active_queue+0x15a/0x210
[7.404033]  [418300d9] ? cfq_group_service_tree_add+0x199/0x260
[7.404033]  [41831f84] ? cfq_service_tree_add+0x404/0x4f0
[7.404033]  [418320a9] ? cfq_resort_rr_list+0x39/0x40
[7.404033]  [41832fff] ? cfq_add_cfqq_rr+0x16f/0x1c0
[7.404033]  [4183a014] ? cfq_update_idle_window.isra.78+0x84/0x3a0
[7.404033]  [41836b4c] cfq_select_queue+0x7ec/0xa90
[7.404033]  [4183988f] cfq_dispatch_requests+0x2bf/0x9c0
[7.404033]  [410833ec] ? pvclock_clocksource_read+0xfc/0x240
[7.404033]  [410822f3] ? kvm_clock_read+0x13/0x20
[7.404033]  [4183a702] ? cfq_insert_request+0x3d2/0x8b0
[7.404033]  [410e0fc3] ?