linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] [SCSI] Print only 5 messages "rejecting I/O to dead device"
@ 2006-11-03  9:18 Luben Tuikov
  0 siblings, 0 replies; only message in thread
From: Luben Tuikov @ 2006-11-03  9:18 UTC (permalink / raw)
  To: linux-scsi

Also set to 5 printing of "rejecting I/O to device being
removed".  See commit ''Print only a single message
"rejecting I/O to device being removed"''.

When we do hot-unplug, those messages are printed so much
and so often that they overwhelm the CPU and cause soft
lockup.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 drivers/scsi/scsi_lib.c    |   11 +++++++----
 drivers/scsi/scsi_scan.c   |    3 ++-
 include/scsi/scsi_device.h |    5 +++--
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 802132e..8b208b4 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1122,8 +1122,11 @@ static int scsi_prep_fn(struct request_q
 		if (sdev->sdev_state == SDEV_DEL) {
 			/* Device is fully deleted, no commands
 			 * at all allowed down */
-			sdev_printk(KERN_ERR, sdev,
-				    "rejecting I/O to dead device\n");
+			if (sdev->num_dead_messages > 0) {
+				sdev->num_dead_messages--;
+				sdev_printk(KERN_ERR, sdev,
+					    "rejecting I/O to dead device\n");
+			}
 			goto kill;
 		}
 		/* OK, we only allow special commands (i.e. not
@@ -1149,8 +1152,8 @@ static int scsi_prep_fn(struct request_q
 			    specials_only == SDEV_BLOCK)
 				goto defer;
 
-			if (sdev->num_rej_messages > 0) {
-				sdev->num_rej_messages--;
+			if (sdev->num_remv_messages > 0) {
+				sdev->num_remv_messages--;
 				sdev_printk(KERN_ERR, sdev,
 					    "rejecting I/O to device "
 					    "being removed\n");
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index aa374ed..c82ea82 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -169,7 +169,8 @@ static struct scsi_device *scsi_alloc_sd
 	INIT_LIST_HEAD(&sdev->cmd_list);
 	INIT_LIST_HEAD(&sdev->starved_entry);
 	spin_lock_init(&sdev->list_lock);
-	sdev->num_rej_messages = SCSI_DEV_NUM_REJ_MESSAGES;
+	sdev->num_remv_messages = SCSI_DEV_NUM_MESSAGES;
+	sdev->num_dead_messages = SCSI_DEV_NUM_MESSAGES;
 
 	sdev->sdev_gendev.parent = get_device(&starget->dev);
 	sdev->sdev_target = starget;
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 14bc5ec..6e51f56 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -140,8 +140,9 @@ struct scsi_device {
 
 	struct execute_work	ew; /* used to get process context on put */
 
-#define SCSI_DEV_NUM_REJ_MESSAGES 1
-	int	num_rej_messages;
+#define SCSI_DEV_NUM_MESSAGES	5
+	int	num_remv_messages;
+	int	num_dead_messages;
 
 	enum scsi_device_state sdev_state;
 	unsigned long		sdev_data[0];
-- 
1.4.3.3.g6cec



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-03  9:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-03  9:18 [PATCH 2/2] [SCSI] Print only 5 messages "rejecting I/O to dead device" Luben Tuikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).