lkml.org 
[lkml]   [2018]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 答复: Re: [PATCH ] scsi: Replace sdev_printk with printk_deferred to avoid
On (03/28/18 10:29), wen.yang99@zte.com.cn wrote:
> Hello Bart,
>
> We have a detailed discussion of the problem.
> Sergey Senozhatsky, Petr and many people have made a lot of efforts about
> it.
> Please see this link:
> https://bugzilla.kernel.org/show_bug.cgi?id=199003
>
> 1, Petr suggests that it should be modified in this way:
> IMHO, printing the same message so many times is useless. Therefore
> some throttling would make sense. If we want to keep sdev_printk(),

The thing with retelimiting is that - yes, we do less printks but we still
do them under queue spin_lock.

So I was thinking about something like below [a quick-n-dirty workaround]

---

drivers/scsi/scsi_lib.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 0dfec0dedd5e..6c930fbdd24c 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1825,9 +1825,13 @@ static void scsi_request_fn(struct request_queue *q)
break;

if (unlikely(!scsi_device_online(sdev))) {
+ scsi_kill_request(req, q);
+ spin_unlock_irq(q->queue_lock);
+
sdev_printk(KERN_ERR, sdev,
"rejecting I/O to offline device\n");
- scsi_kill_request(req, q);
+
+ spin_lock_irq(q->queue_lock);
continue;
}

\
 
 \ /
  Last update: 2018-03-28 04:45    [W:0.131 / U:1.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site