From a0b91ecc55eed6ed23b641734abd11091651b435 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 11 Jan 2010 19:27:07 +0000 Subject: [PATCH] Let's experimantally disable SCST_MAX_DEV_COMMANDS and cmd->dev_cmd_count functionality and see if users will complain about it. If not, we will remove it. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1448 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index da40307f4..32ba1b934 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -33,11 +33,16 @@ #include "scst.h" #include "scst_priv.h" -#if 0 /* Temporary, left for future performance investigations */ +#if 0 /* Temporary left for future performance investigations */ /* Deleting it don't forget to delete write_cmd_count */ #define CONFIG_SCST_ORDERED_READS #endif +#if 0 /* Let's disable it for now to see if users will complain about it */ +/* Deleting it don't forget to delete write_cmd_count */ +#define CONFIG_SCST_PER_DEVICE_CMD_COUNT_LIMIT +#endif + static void scst_cmd_set_sn(struct scst_cmd *cmd); static int __scst_init_cmd(struct scst_cmd *cmd); static void scst_finish_cmd_mgmt(struct scst_cmd *cmd); @@ -2869,7 +2874,9 @@ static int scst_pre_xmit_response(struct scst_cmd *cmd) * latency, so we should decrement them after cmd completed. */ atomic_dec(&cmd->tgt_dev->tgt_dev_cmd_count); +#ifdef CONFIG_SCST_PER_DEVICE_CMD_COUNT_LIMIT atomic_dec(&cmd->dev->dev_cmd_count); +#endif #ifdef CONFIG_SCST_ORDERED_READS /* If expected values not set, expected direction is UNKNOWN */ if (cmd->expected_data_direction & SCST_DATA_WRITE) @@ -3322,6 +3329,7 @@ static int __scst_init_cmd(struct scst_cmd *cmd) failure = true; } +#ifdef CONFIG_SCST_PER_DEVICE_CMD_COUNT_LIMIT cnt = atomic_inc_return(&cmd->dev->dev_cmd_count); if (unlikely(cnt > SCST_MAX_DEV_COMMANDS)) { if (!failure) { @@ -3335,6 +3343,7 @@ static int __scst_init_cmd(struct scst_cmd *cmd) failure = true; } } +#endif #ifdef CONFIG_SCST_ORDERED_READS /* If expected values not set, expected direction is UNKNOWN */