Skip to contentSkip to conversation

block: print offending values when cloned rq limits are exceeded

PATCH In review John Pittman 4 participants 8 messages May 23, 2019 – May 31, 2019 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: print offending values when cloned rq limits are exceeded

While troubleshooting issues where cloned request limits have been exceeded, it is often beneficial to know the actual values that have been breached. Print these values, assisting in ease of identification of root cause of the breach.

---
 block/blk-core.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
block/blk-core.c +5 -2
index 419d600e6637..af62150bb1ba 100644
@@ -1199,7 +1199,9 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
 				      struct request *rq)
 {
 	if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, req_op(rq))) {
-		printk(KERN_ERR "%s: over max size limit.\n", __func__);
+		printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",
+			__func__, blk_rq_sectors(rq),
+			blk_queue_get_max_sectors(q, req_op(rq)));
 		return -EIO;
 	}
 
@@ -1211,7 +1213,8 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
 	 */
 	blk_recalc_rq_segments(rq);
 	if (rq->nr_phys_segments > queue_max_segments(q)) {
-		printk(KERN_ERR "%s: over max segments limit.\n", __func__);
+		printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",
+			__func__, rq->nr_phys_segments, queue_max_segments(q));
 		return -EIO;
 	}
 
Signature · 1 line
2.17.2
Reviewed-by on v1 1/1
#1 lore raw

I think it will be useful to print the information along with the error.

Do we want to address the checkpatch warnings ?

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #20: FILE: block/blk-core.c:1202:
+ printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #31: FILE: block/blk-core.c:1216:
+ printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",

In either case,

Quoted 36 lines · John Pittman

While troubleshooting issues where cloned request limits have been exceeded, it is often beneficial to know the actual values that have been breached. Print these values, assisting in ease of identification of root cause of the breach.

---
  block/blk-core.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
block/blk-core.c +5 -2
index 419d600e6637..af62150bb1ba 100644
@@ -1199,7 +1199,9 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
  				      struct request *rq)
  {
  	if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, req_op(rq))) {
-		printk(KERN_ERR "%s: over max size limit.\n", __func__);
+		printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",
+			__func__, blk_rq_sectors(rq),
+			blk_queue_get_max_sectors(q, req_op(rq)));
  		return -EIO;
  	}
 
@@ -1211,7 +1213,8 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
  	 */
  	blk_recalc_rq_segments(rq);
  	if (rq->nr_phys_segments > queue_max_segments(q)) {
-		printk(KERN_ERR "%s: over max segments limit.\n", __func__);
+		printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",
+			__func__, rq->nr_phys_segments, queue_max_segments(q));
  		return -EIO;
  	}
 
#2 lore raw

Thanks Chaitanya for the review. I was not sure what Jens would think about the checkpatch warning, so I left it as it was so he could decide. I tried to model the value output after that old 'bio too big' error. Thanks again.

Quoted 57 lines · Chaitanya Kulkarni

I think it will be useful to print the information along with the error.

Do we want to address the checkpatch warnings ?

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #20: FILE: block/blk-core.c:1202:
+ printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #31: FILE: block/blk-core.c:1216:
+ printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",

In either case,

Quoted 36 lines · John Pittman

While troubleshooting issues where cloned request limits have been exceeded, it is often beneficial to know the actual values that have been breached. Print these values, assisting in ease of identification of root cause of the breach.

---
  block/blk-core.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
block/blk-core.c +5 -2
index 419d600e6637..af62150bb1ba 100644
@@ -1199,7 +1199,9 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
                                    struct request *rq)
  {
      if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, req_op(rq))) {
-             printk(KERN_ERR "%s: over max size limit.\n", __func__);
+             printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",
+                     __func__, blk_rq_sectors(rq),
+                     blk_queue_get_max_sectors(q, req_op(rq)));
              return -EIO;
      }
 
@@ -1211,7 +1213,8 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
       */
      blk_recalc_rq_segments(rq);
      if (rq->nr_phys_segments > queue_max_segments(q)) {
-             printk(KERN_ERR "%s: over max segments limit.\n", __func__);
+             printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",
+                     __func__, rq->nr_phys_segments, queue_max_segments(q));
              return -EIO;
      }
 
#3 lore raw

Let's leave it to Jens.

Quoted 65 lines · John Pittman

Thanks Chaitanya for the review. I was not sure what Jens would think about the checkpatch warning, so I left it as it was so he could decide. I tried to model the value output after that old 'bio too big' error. Thanks again.

Quoted 57 lines · Chaitanya Kulkarni

I think it will be useful to print the information along with the error.

Do we want to address the checkpatch warnings ?

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #20: FILE: block/blk-core.c:1202:
+ printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #31: FILE: block/blk-core.c:1216:
+ printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",

In either case,

Quoted 36 lines · John Pittman

While troubleshooting issues where cloned request limits have been exceeded, it is often beneficial to know the actual values that have been breached. Print these values, assisting in ease of identification of root cause of the breach.

---
   block/blk-core.c | 7 +++++--
   1 file changed, 5 insertions(+), 2 deletions(-)
block/blk-core.c +5 -2
index 419d600e6637..af62150bb1ba 100644
@@ -1199,7 +1199,9 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
                                     struct request *rq)
   {
       if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, req_op(rq))) {
-             printk(KERN_ERR "%s: over max size limit.\n", __func__);
+             printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",
+                     __func__, blk_rq_sectors(rq),
+                     blk_queue_get_max_sectors(q, req_op(rq)));
               return -EIO;
       }
 
@@ -1211,7 +1213,8 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
        */
       blk_recalc_rq_segments(rq);
       if (rq->nr_phys_segments > queue_max_segments(q)) {
-             printk(KERN_ERR "%s: over max segments limit.\n", __func__);
+             printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",
+                     __func__, rq->nr_phys_segments, queue_max_segments(q));
               return -EIO;
       }
 
#4 lore raw

Hi Jens. Does this patch seem reasonable?

Quoted 70 lines · Chaitanya Kulkarni

Let's leave it to Jens.

Quoted 65 lines · John Pittman

Thanks Chaitanya for the review. I was not sure what Jens would think about the checkpatch warning, so I left it as it was so he could decide. I tried to model the value output after that old 'bio too big' error. Thanks again.

Quoted 57 lines · Chaitanya Kulkarni

I think it will be useful to print the information along with the error.

Do we want to address the checkpatch warnings ?

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #20: FILE: block/blk-core.c:1202:
+ printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",

WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #31: FILE: block/blk-core.c:1216:
+ printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",

In either case,

Quoted 36 lines · John Pittman

While troubleshooting issues where cloned request limits have been exceeded, it is often beneficial to know the actual values that have been breached. Print these values, assisting in ease of identification of root cause of the breach.

---
   block/blk-core.c | 7 +++++--
   1 file changed, 5 insertions(+), 2 deletions(-)
block/blk-core.c +5 -2
index 419d600e6637..af62150bb1ba 100644
@@ -1199,7 +1199,9 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
                                     struct request *rq)
   {
       if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, req_op(rq))) {
-             printk(KERN_ERR "%s: over max size limit.\n", __func__);
+             printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",
+                     __func__, blk_rq_sectors(rq),
+                     blk_queue_get_max_sectors(q, req_op(rq)));
               return -EIO;
       }
 
@@ -1211,7 +1213,8 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
        */
       blk_recalc_rq_segments(rq);
       if (rq->nr_phys_segments > queue_max_segments(q)) {
-             printk(KERN_ERR "%s: over max segments limit.\n", __func__);
+             printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",
+                     __func__, rq->nr_phys_segments, queue_max_segments(q));
               return -EIO;
       }
 
maintainer
#5 lore raw
Quoted 1 line · John Pittman

Hi Jens. Does this patch seem reasonable?

Looks good to me, applied.

Signature · 1 line
Jens Axboe
Reviewed-by on v1 1/1
#6 lore raw
In reply to John Pittman
Quoted 27 lines · John Pittman

While troubleshooting issues where cloned request limits have been exceeded, it is often beneficial to know the actual values that have been breached. Print these values, assisting in ease of identification of root cause of the breach.

---
 block/blk-core.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
block/blk-core.c +3 -1
index 419d600e6637..af62150bb1ba 100644
@@ -1199,7 +1199,9 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
                                      struct request *rq)
 {
        if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, req_op(rq))) {
-               printk(KERN_ERR "%s: over max size limit.\n", __func__);
+               printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",
+                       __func__, blk_rq_sectors(rq),
+                       blk_queue_get_max_sectors(q, req_op(rq)));
                return -EIO;
        }
 

block/blk-core.c static int blk_cloned_rq_check_limits(struct request_queue *q, · line 1219

Quoted 8 lines
block/blk-core.c +2 -1
@@ -1211,7 +1213,8 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
         */
        blk_recalc_rq_segments(rq);
        if (rq->nr_phys_segments > queue_max_segments(q)) {
-               printk(KERN_ERR "%s: over max segments limit.\n", __func__);
+               printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",
+                       __func__, rq->nr_phys_segments, queue_max_segments(q));
                return -EIO;
        }

BTW, do you still see such kind of warning since v5.1? If yes, could you share something
more?

Thanks,
Ming Lei

#7 lore raw

Hi Ming; thanks for reviewing. I've not seen anything in 5.x. Currently, we have a RHEL case for kernel 3.x where we've hit this error, but we've yet to identify root cause. As part of debugging, the techs involved are having to grab the values via systemtap (which the end-user is resisting). Please feel free to contact me off-list if you want the details on the case. If the patch is approved here, I was planning to see if you would pull it into the RHEL stream for 4.x so we would not have to mess w/ systemtap next time. Generally, in support, when we see this error it's from an admin or script setting bad stacking values.

Quoted 46 lines · Ming Lei
Quoted 27 lines · John Pittman

While troubleshooting issues where cloned request limits have been exceeded, it is often beneficial to know the actual values that have been breached. Print these values, assisting in ease of identification of root cause of the breach.

---
 block/blk-core.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
block/blk-core.c +3 -1
index 419d600e6637..af62150bb1ba 100644
@@ -1199,7 +1199,9 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
                                      struct request *rq)
 {
        if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, req_op(rq))) {
-               printk(KERN_ERR "%s: over max size limit.\n", __func__);
+               printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",
+                       __func__, blk_rq_sectors(rq),
+                       blk_queue_get_max_sectors(q, req_op(rq)));
                return -EIO;
        }
 

block/blk-core.c static int blk_cloned_rq_check_limits(struct request_queue *q, · line 1219

Quoted 8 lines
block/blk-core.c +2 -1
@@ -1211,7 +1213,8 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
         */
        blk_recalc_rq_segments(rq);
        if (rq->nr_phys_segments > queue_max_segments(q)) {
-               printk(KERN_ERR "%s: over max segments limit.\n", __func__);
+               printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",
+                       __func__, rq->nr_phys_segments, queue_max_segments(q));
                return -EIO;
        }

BTW, do you still see such kind of warning since v5.1? If yes, could you share something
more?

Thanks,
Ming Lei