diff mbox

libnvdimm, blk: quiet i/o error reporting

Message ID 20160325215310.31923.81368.stgit@dwillia2-desk3.jf.intel.com (mailing list archive)
State Accepted
Commit 8378af17a402
Headers show

Commit Message

Dan Williams March 25, 2016, 9:59 p.m. UTC
I/O errors events have the potential to be a high frequency and a log
message for each event can swamp the system.  This message is also
redundant with upper layer error reporting.

Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
Previously this was folded into "[PATCH 08/13] libnvdimm, blk: move i/o
infrastructure to nd_namespace_blk", but it deserves to be its own
change.

 drivers/nvdimm/blk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Elliott, Robert (Servers) March 28, 2016, 2:40 p.m. UTC | #1
> -----Original Message-----
> From: Linux-nvdimm [mailto:linux-nvdimm-bounces@lists.01.org] On Behalf Of
> Dan Williams
> Sent: Friday, March 25, 2016 5:00 PM
> To: linux-nvdimm@lists.01.org
> Subject: [PATCH] libnvdimm, blk: quiet i/o error reporting
> 
> I/O errors events have the potential to be a high frequency and a log
> message for each event can swamp the system.  This message is also
> redundant with upper layer error reporting.
...
> diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c
> index c8635b3d88a8..26d039879ba2 100644
> --- a/drivers/nvdimm/blk.c
> +++ b/drivers/nvdimm/blk.c
> @@ -189,7 +189,7 @@ static blk_qc_t nd_blk_make_request(struct
> request_queue *q, struct bio *bio)
>  		err = nd_blk_do_bvec(blk_dev, bip, bvec.bv_page, len,
>  					bvec.bv_offset, rw, iter.bi_sector);
>  		if (err) {
> -			dev_info(&blk_dev->nsblk->common.dev,
> +			dev_dbg(&blk_dev->nsblk->common.dev,
>  					"io error in %s sector %lld, len %d,\n",
>  					(rw == READ) ? "READ" : "WRITE",
>  					(unsigned long long) iter.bi_sector, len);
> 

The block layer's blk_update_request uses printk_ratelimited to
avoids swamping the output buffers.  Since this driver doesn't
call blk_update_request, it might be appropriate to do the same.

	printk_ratelimited(KERN_ERR "%s: %s error, dev %s, sector %llu\n",
		__func__, error_type, req->rq_disk ?
		req->rq_disk->disk_name : "?",
		(unsigned long long)blk_rq_pos(req));

---
Robert Elliott, HPE Persistent Memory
Dan Williams March 28, 2016, 11:57 p.m. UTC | #2
On Mon, Mar 28, 2016 at 7:40 AM, Elliott, Robert (Persistent Memory)
<elliott@hpe.com> wrote:
>
>
>> -----Original Message-----
>> From: Linux-nvdimm [mailto:linux-nvdimm-bounces@lists.01.org] On Behalf Of
>> Dan Williams
>> Sent: Friday, March 25, 2016 5:00 PM
>> To: linux-nvdimm@lists.01.org
>> Subject: [PATCH] libnvdimm, blk: quiet i/o error reporting
>>
>> I/O errors events have the potential to be a high frequency and a log
>> message for each event can swamp the system.  This message is also
>> redundant with upper layer error reporting.
> ...
>> diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c
>> index c8635b3d88a8..26d039879ba2 100644
>> --- a/drivers/nvdimm/blk.c
>> +++ b/drivers/nvdimm/blk.c
>> @@ -189,7 +189,7 @@ static blk_qc_t nd_blk_make_request(struct
>> request_queue *q, struct bio *bio)
>>               err = nd_blk_do_bvec(blk_dev, bip, bvec.bv_page, len,
>>                                       bvec.bv_offset, rw, iter.bi_sector);
>>               if (err) {
>> -                     dev_info(&blk_dev->nsblk->common.dev,
>> +                     dev_dbg(&blk_dev->nsblk->common.dev,
>>                                       "io error in %s sector %lld, len %d,\n",
>>                                       (rw == READ) ? "READ" : "WRITE",
>>                                       (unsigned long long) iter.bi_sector, len);
>>
>
> The block layer's blk_update_request uses printk_ratelimited to
> avoids swamping the output buffers.  Since this driver doesn't
> call blk_update_request, it might be appropriate to do the same.
>
>         printk_ratelimited(KERN_ERR "%s: %s error, dev %s, sector %llu\n",
>                 __func__, error_type, req->rq_disk ?
>                 req->rq_disk->disk_name : "?",
>                 (unsigned long long)blk_rq_pos(req));

I'm aware of printk_ratelimited, I just don't think bio-based drivers
like ndblk should implement their own error reporting for something
block-layer-generic like this.
Johannes Thumshirn March 29, 2016, 7:56 a.m. UTC | #3
On Freitag, 25. März 2016 14:59:41 CEST Dan Williams wrote:
> I/O errors events have the potential to be a high frequency and a log
> message for each event can swamp the system.  This message is also
> redundant with upper layer error reporting.
> 
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Looks good to me,

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
diff mbox

Patch

diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c
index c8635b3d88a8..26d039879ba2 100644
--- a/drivers/nvdimm/blk.c
+++ b/drivers/nvdimm/blk.c
@@ -189,7 +189,7 @@  static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio)
 		err = nd_blk_do_bvec(blk_dev, bip, bvec.bv_page, len,
 					bvec.bv_offset, rw, iter.bi_sector);
 		if (err) {
-			dev_info(&blk_dev->nsblk->common.dev,
+			dev_dbg(&blk_dev->nsblk->common.dev,
 					"io error in %s sector %lld, len %d,\n",
 					(rw == READ) ? "READ" : "WRITE",
 					(unsigned long long) iter.bi_sector, len);