From dc4637be2882ce9cb03065ce89b859717cc25fb3 Mon Sep 17 00:00:00 2001
From: johann <johann>
Date: Mon, 21 Jul 2008 16:09:16 +0000
Subject: [PATCH] Branch HEAD b=9945 i=bzzz i=adilger

add warning when underlying device is not tuned for larger I/O requests.
---
 lustre/obdfilter/filter.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c
index 8f9ac20580..ae88bd632e 100644
--- a/lustre/obdfilter/filter.c
+++ b/lustre/obdfilter/filter.c
@@ -1911,6 +1911,7 @@ int filter_common_setup(struct obd_device *obd, struct lustre_cfg* lcfg,
         __u8 *uuid_ptr;
         char *str, *label;
         char ns_name[48];
+        request_queue_t *q;
         int rc, i;
         ENTRY;
 
@@ -2028,6 +2029,15 @@ int filter_common_setup(struct obd_device *obd, struct lustre_cfg* lcfg,
         if (rc)
                 GOTO(err_post, rc);
 
+        q = bdev_get_queue(mnt->mnt_sb->s_bdev);
+        if (q->max_sectors < q->max_hw_sectors &&
+            q->max_sectors < PTLRPC_MAX_BRW_SIZE >> 9)
+                LCONSOLE_INFO("%s: underlying device %s should be tuned "
+                              "for larger I/O requests: max_sectors = %u "
+                              "could be up to max_hw_sectors=%u\n",
+                              obd->obd_name, mnt->mnt_sb->s_id,
+                              q->max_sectors, q->max_hw_sectors);
+
         uuid_ptr = fsfilt_uuid(obd, obd->u.obt.obt_sb);
         if (uuid_ptr != NULL) {
                 class_uuid_unparse(uuid_ptr, &uuid);
-- 
GitLab