lkml.org 
[lkml]   [2018]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 答复: Re: 答复: R e: [PATCH v2] scsi : Introduce sdev_printk_ratelimited tothrottlefrequent printk
On Mon 2018-04-09 10:13:43, wen.yang99@zte.com.cn wrote:
> That's a good idea, but it only solves part of the problem.
> loopping printks under spinlock, there's two path:
> one path is:

> scsi_request_fn --> loop -> blk_peek_request-> scsi_prep_fn -> scsi_prep_state_check -> sdev_printk

> another path is:

> scsi_request_fn --> loop -> sdev_printk

Is this message redundant? It seems to be printed in the same
situations as the messages in scsi_prep_state_check().

In fact, there seems to be a mismatch. scsi_request_fn() prints
about offline device also for sdev->sdev_state == SDEV_DEL.
While scsi_prep_state_check() prints about a dead device
in this case.

Would it make sense to remove the redundant dev_printk() from
scsi_request_fn()?


Then we could add a flag into struct scsi_device that
would remember if we already printed the error in
scsi_prep_state_check() for the given device. It could
be used to print the error only once.

The flag might be scsi_device_state value for which
we printed the error last time. We would need to reset
it scsi_prep_state_check() see another state.

It is a bit hairy but it really does not make much sense
to print the same error message thousand times.

Best Regards,
Petr

PS: Your mail was again strangely formatted. Please, send
mails in plain text format (no html).

\
 
 \ /
  Last update: 2018-04-09 11:00    [W:0.042 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site