[RFC] [PATCH] Do not start queue from interrupt context

2018-04-30 Thread Vikram Auradkar
Lockdep warning is seen when driver is handling a topology change
event after drive removal.
Starting queue eventually enables irq, which throws lockdep warning in
scsi_request_fn. This change makes starting queues async.

[ cut here ]
WARNING: CPU: 0 PID: 0 at kernel/lockdep.c:2593 
trace_hardirqs_on_caller+0x1bc/0x1d0()
DEBUG_LOCKS_WARN_ON(current->hardirq_context)
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G   O  3.11.10-dbg-DEV #1
Hardware name: Intel Grantley,Wellsburg/Ixion_QC_15, BIOS 2.50.0 01/21/2016
  881fff803b28 a4ea1bd5 881fff803b78
 a491bdcc 881fff803b68 a48ae464 cc6405a0
  a4805a50 881f9b3ae000 
Call Trace:
   [] dump_stack+0x68/0x91
 [] ? trace_hardirqs_on_caller+0x1bc/0x1d0
 [] warn_slowpath_common+0x94/0xc0
 [] ? _raw_spin_unlock_irq+0x30/0x50
 [] warn_slowpath_fmt+0x46/0x50
 [] trace_hardirqs_on_caller+0x1bc/0x1d0
 [] trace_hardirqs_on+0xd/0x10
 [] _raw_spin_unlock_irq+0x30/0x50
 [] scsi_request_fn+0xaf/0x720
 [] __blk_run_queue+0x37/0x50
 [] blk_start_queue+0x3e/0x80
 [] scsi_internal_device_unblock+0x3f/0x90
 [] _scsih_ublock_io_device+0x87/0xd0 [mpt2sas]
 [] _scsih_tm_tr_send+0x185/0x340 [mpt2sas]
 [] mpt2sas_scsih_event_callback+0x3e0/0x840 [mpt2sas]
 [] _base_interrupt+0x2fa/0x950 [mpt2sas]
 [] ? trace_hardirqs_on_caller+0xab/0x1d0
 [] ? trace_hardirqs_on+0xd/0x10
 [] handle_irq_event_percpu+0x74/0x230
 [] handle_irq_event+0x48/0x70
 [] ? handle_edge_irq+0x1e/0x110
 [] handle_edge_irq+0x77/0x110
 [] handle_irq+0x22/0x40
 [] do_IRQ+0x7f/0x110
 [] common_interrupt+0x6f/0x6f
   [] ? __cpuidle_enter_state+0x7c/0x120
 [] ? __cpuidle_enter_state+0x77/0x120
 [] cpuidle_enter_state+0xd5/0x250
 [] cpu_startup_entry+0xb8/0x1e0
 [] rest_init+0xd6/0xe0
 [] ? rest_init+0x5/0xe0
 [] start_kernel+0x3ed/0x3fa
 [] ? repair_env_string+0x5e/0x5e
 [] x86_64_start_reservations+0x2a/0x2c
 [] x86_64_start_kernel+0x109/0x10d
---[ end trace 46d48ef4760a5d9c ]--

Signed-off-by: Vikram Auradkar 
---
 drivers/scsi/scsi_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index e9b4f279d29c..72c90233f261 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -3178,7 +3178,7 @@ void scsi_start_queue(struct scsi_device *sdev)
blk_mq_unquiesce_queue(q);
} else {
spin_lock_irqsave(q->queue_lock, flags);
-   blk_start_queue(q);
+   blk_start_queue_async(q);
spin_unlock_irqrestore(q->queue_lock, flags);
}
 }
-- 
2.17.0.441.gb46fe60e1d-goog



Re: simplify procfs code for seq_file instances V2

2018-04-30 Thread David Howells
Note that your kernel hits the:

inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
swapper/0/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
(ptrval) (fs_reclaim){?.+.}, at: fs_reclaim_acquire+0x12/0x35
{HARDIRQ-ON-W} state was registered at:
  fs_reclaim_acquire+0x32/0x35
  kmem_cache_alloc_node_trace+0x49/0x2cf
  alloc_worker+0x1d/0x49
  init_rescuer.part.7+0x19/0x8f
  workqueue_init+0xc0/0x1fe
  kernel_init_freeable+0xdc/0x433
  kernel_init+0xa/0xf5
  ret_from_fork+0x24/0x30

bug, as described here:


https://groups.google.com/forum/#!msg/syzkaller-bugs/sJC3Y3hOM08/aO3z9JXoAgAJ

David


Re: [PATCH 04/40] proc: introduce proc_create_seq{,_data}

2018-04-30 Thread David Howells
Christoph Hellwig  wrote:

> +
> +struct proc_dir_entry *proc_create_seq_data(const char *name, umode_t mode,
> + struct proc_dir_entry *parent, const struct seq_operations *ops,
> + void *data)
> +{
> ...
> +EXPORT_SYMBOL(proc_create_seq_data);

Please add documentation comments to exported functions when you add them.

David


Re: [PATCH] scsi_transport_sas: don't bounce highmem pages for the smp handler

2018-04-30 Thread Johannes Thumshirn
On Sun, Apr 15, 2018 at 04:52:37PM +0200, Christoph Hellwig wrote:
> All three instance of ->smp_handler deal with highmem backed requests
> just fine.

That's my conclusion as well.

Looks good,
Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850