From patchwork Thu Nov 30 19:31:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 13474935 Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85B6ED4A; Thu, 30 Nov 2023 11:31:46 -0800 (PST) Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3b88f2a37deso840992b6e.0; Thu, 30 Nov 2023 11:31:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701372706; x=1701977506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hx1Xh++ESCAV8y2AlqKHPhWzurlG0Vw7YPn+CtHrVz4=; b=uGXz1Hk6X29xSWNjtw+s5LoAu9jOgsxJViMJFaFuSgsTZTn7U/ptfXUbdz9sz/VLOu GCswkLTSWwm/JDhKLS12ZFAfsTULsfq5u2W2jlN3pOqxZrLDbafJN0tAK/YlEKKODtOI q+JRlXeO4AmOsYnWSFt/tv2GKJJUVRpt0lIQyFx8DQGmZ5X202eKvzFxgmgWyCTedHHb cs09Z+ZkyjFE8XVV4UXPMw1VK4chY/iE2gRjjbCpYTRQSuDqTs5i8z0Nqy5EVd+kaDc5 6F2f3G3idiiaR7NUWD/Qj3RwyAfuqEWYZ8MTryacSlGqe7p9OdpIrQacEkNllGW+v5Vx pjXA== X-Gm-Message-State: AOJu0Yy3E9wqJ/8ZEQxGpkzJExn1MUTeOuv5hxQPLmkMBVY5X3CSJyWH 7Ph6uqTEORYRr5msE8Vnn88= X-Google-Smtp-Source: AGHT+IEk8ZrJloXY7RO6vR/KsPx0JaKJiu+Hoi6EsuUEnlGN5cMJSI77hUY8cJjchwBle3f3soN5EA== X-Received: by 2002:a05:6808:d47:b0:3ae:126b:8c2b with SMTP id w7-20020a0568080d4700b003ae126b8c2bmr672432oik.30.1701372705682; Thu, 30 Nov 2023 11:31:45 -0800 (PST) Received: from bvanassche-linux.mtv.corp.google.com ([2620:0:1000:8411:8572:6fe3:eaf0:3b9d]) by smtp.gmail.com with ESMTPSA id m127-20020a632685000000b005c606b44405sm1635365pgm.67.2023.11.30.11.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:31:45 -0800 (PST) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, "Martin K . Petersen" , Christoph Hellwig , Bart Van Assche , Ming Lei , Keith Busch , Damien Le Moal , Yu Kuai , Ed Tsai , Matthias Brugger , AngeloGioacchino Del Regno Subject: [PATCH v6 1/4] block: Make fair tag sharing configurable Date: Thu, 30 Nov 2023 11:31:28 -0800 Message-ID: <20231130193139.880955-2-bvanassche@acm.org> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231130193139.880955-1-bvanassche@acm.org> References: <20231130193139.880955-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The fair sharing algorithm has a negative performance impact for storage devices for which the full queue depth is required to reach peak performance, e.g. UFS devices. This is because it takes long after a request queue became inactive until tags are reassigned to the active request queue(s). Since making tag sharing fair is not needed if the request processing latency is similar for all request queues, introduce a function for configuring fair tag sharing. Increase BLK_MQ_F_ALLOC_POLICY_START_BIT to prevent that the fair tag sharing flag overlaps with the tag allocation policy. Cc: Christoph Hellwig Cc: Martin K. Petersen Cc: Ming Lei Cc: Keith Busch Cc: Damien Le Moal Cc: Yu Kuai Cc: Ed Tsai Signed-off-by: Bart Van Assche --- block/blk-mq-debugfs.c | 1 + block/blk-mq.c | 28 ++++++++++++++++++++++++++++ block/blk-mq.h | 3 ++- include/linux/blk-mq.h | 6 ++++-- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 5cbeb9344f2f..f41408103106 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -198,6 +198,7 @@ static const char *const hctx_flag_name[] = { HCTX_FLAG_NAME(NO_SCHED), HCTX_FLAG_NAME(STACKING), HCTX_FLAG_NAME(TAG_HCTX_SHARED), + HCTX_FLAG_NAME(DISABLE_FAIR_TAG_SHARING), }; #undef HCTX_FLAG_NAME diff --git a/block/blk-mq.c b/block/blk-mq.c index b8093155df8d..206295606cec 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4569,6 +4569,34 @@ void blk_mq_free_tag_set(struct blk_mq_tag_set *set) } EXPORT_SYMBOL(blk_mq_free_tag_set); +/* + * Enable or disable fair tag sharing for all request queues associated with + * a tag set. + */ +void blk_mq_update_fair_sharing(struct blk_mq_tag_set *set, bool enable) +{ + const unsigned int DFTS_BIT = ilog2(BLK_MQ_F_DISABLE_FAIR_TAG_SHARING); + struct blk_mq_hw_ctx *hctx; + struct request_queue *q; + unsigned long i; + + /* + * Serialize against blk_mq_update_nr_hw_queues() and + * blk_mq_realloc_hw_ctxs(). + */ + mutex_lock(&set->tag_list_lock); + list_for_each_entry(q, &set->tag_list, tag_set_list) + blk_mq_freeze_queue(q); + assign_bit(DFTS_BIT, &set->flags, !enable); + list_for_each_entry(q, &set->tag_list, tag_set_list) + queue_for_each_hw_ctx(q, hctx, i) + assign_bit(DFTS_BIT, &hctx->flags, !enable); + list_for_each_entry(q, &set->tag_list, tag_set_list) + blk_mq_unfreeze_queue(q); + mutex_unlock(&set->tag_list_lock); +} +EXPORT_SYMBOL(blk_mq_update_fair_sharing); + int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr) { struct blk_mq_tag_set *set = q->tag_set; diff --git a/block/blk-mq.h b/block/blk-mq.h index f75a9ecfebde..eda6bd0611ea 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -416,7 +416,8 @@ static inline bool hctx_may_queue(struct blk_mq_hw_ctx *hctx, { unsigned int depth, users; - if (!hctx || !(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED)) + if (!hctx || !(hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED) || + (hctx->flags & BLK_MQ_F_DISABLE_FAIR_TAG_SHARING)) return true; /* diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 1ab3081c82ed..ddda190b5c24 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -503,7 +503,7 @@ struct blk_mq_tag_set { unsigned int cmd_size; int numa_node; unsigned int timeout; - unsigned int flags; + unsigned long flags; void *driver_data; struct blk_mq_tags **tags; @@ -662,7 +662,8 @@ enum { * or shared hwqs instead of 'mq-deadline'. */ BLK_MQ_F_NO_SCHED_BY_DEFAULT = 1 << 7, - BLK_MQ_F_ALLOC_POLICY_START_BIT = 8, + BLK_MQ_F_DISABLE_FAIR_TAG_SHARING = 1 << 8, + BLK_MQ_F_ALLOC_POLICY_START_BIT = 16, BLK_MQ_F_ALLOC_POLICY_BITS = 1, BLK_MQ_S_STOPPED = 0, @@ -705,6 +706,7 @@ int blk_mq_alloc_sq_tag_set(struct blk_mq_tag_set *set, const struct blk_mq_ops *ops, unsigned int queue_depth, unsigned int set_flags); void blk_mq_free_tag_set(struct blk_mq_tag_set *set); +void blk_mq_update_fair_sharing(struct blk_mq_tag_set *set, bool enable); void blk_mq_free_request(struct request *rq); int blk_rq_poll(struct request *rq, struct io_comp_batch *iob, From patchwork Thu Nov 30 19:31:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 13474936 Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F5ADD40; Thu, 30 Nov 2023 11:31:48 -0800 (PST) Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-6d8481094f9so815123a34.3; Thu, 30 Nov 2023 11:31:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701372707; x=1701977507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Knd+D/6CKXR/8iQUqXcUYuGkJf1PZfGEypA0Hhb5DIQ=; b=Rdyv9zZ2cKREV6jXa4nDvJWNNzxzVi141MoxwtYuaQGAt3fEAqmCrZjxDeIQ0YGD8v hGuXMRwjalTeMeQMGOPiA3XrX3zORVAAhGeXVo7k9V8+47ydfdcuJFUVkci7yz9VeJJM /wXVq9hUJ0sqBtfIXEhv6gCP61Ri0ywV/P9ed6G280u/j+Nmr5R9sYvW/qRnWlC1P5gV /PkZtKHldy9xlgU1iDCBKo0mipQ3YmTj6Sn8qVa2MTfo8qHHlcfNq3PeduyAuAvJ83Op JzUA11h7q1B2YUwROL6po/RgsScEYL4iJmvumvXR89uQ1ElOqd8En0qR1QdKLoEXN/DE Udkw== X-Gm-Message-State: AOJu0Yz05TxljHCLj0ifHu+PmdSqofQfbQC8kRjEm7wUYZHbE0SJ3WpE RKyFIWVCqKBH+44A5PIG1LY= X-Google-Smtp-Source: AGHT+IFvYeLxnu/TGvO2d+HR4KaIz1AKQMwZM1qpOwewR85uplugeqmOrHNFgg9Xtl4MJQi3+sBiaA== X-Received: by 2002:a05:6830:2b11:b0:6d8:542a:9c70 with SMTP id l17-20020a0568302b1100b006d8542a9c70mr514779otv.16.1701372707454; Thu, 30 Nov 2023 11:31:47 -0800 (PST) Received: from bvanassche-linux.mtv.corp.google.com ([2620:0:1000:8411:8572:6fe3:eaf0:3b9d]) by smtp.gmail.com with ESMTPSA id m127-20020a632685000000b005c606b44405sm1635365pgm.67.2023.11.30.11.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:31:46 -0800 (PST) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, "Martin K . Petersen" , Christoph Hellwig , Bart Van Assche , Ming Lei , Keith Busch , Damien Le Moal , Yu Kuai , Ed Tsai , "James E.J. Bottomley" , Matthias Brugger , AngeloGioacchino Del Regno Subject: [PATCH v6 2/4] scsi: core: Make fair tag sharing configurable in the host template Date: Thu, 30 Nov 2023 11:31:29 -0800 Message-ID: <20231130193139.880955-3-bvanassche@acm.org> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231130193139.880955-1-bvanassche@acm.org> References: <20231130193139.880955-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Allow SCSI drivers to disable the block layer fair tag sharing algorithm via the SCSI host template. Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Ming Lei Cc: Keith Busch Cc: Damien Le Moal Cc: Yu Kuai Cc: Ed Tsai Signed-off-by: Bart Van Assche --- drivers/scsi/hosts.c | 1 + drivers/scsi/scsi_lib.c | 2 ++ include/scsi/scsi_host.h | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index d7f51b84f3c7..872f87001374 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -442,6 +442,7 @@ struct Scsi_Host *scsi_host_alloc(const struct scsi_host_template *sht, int priv shost->no_write_same = sht->no_write_same; shost->host_tagset = sht->host_tagset; shost->queuecommand_may_block = sht->queuecommand_may_block; + shost->disable_fair_tag_sharing = sht->disable_fair_tag_sharing; if (shost_eh_deadline == -1 || !sht->eh_host_reset_handler) shost->eh_deadline = -1; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index cf3864f72093..291fbfacf542 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1984,6 +1984,8 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost) BLK_ALLOC_POLICY_TO_MQ_FLAG(shost->hostt->tag_alloc_policy); if (shost->queuecommand_may_block) tag_set->flags |= BLK_MQ_F_BLOCKING; + if (shost->disable_fair_tag_sharing) + tag_set->flags |= BLK_MQ_F_DISABLE_FAIR_TAG_SHARING; tag_set->driver_data = shost; if (shost->host_tagset) tag_set->flags |= BLK_MQ_F_TAG_HCTX_SHARED; diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 3b907fc2ef08..04238ae9e22c 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -464,6 +464,9 @@ struct scsi_host_template { /* The queuecommand callback may block. See also BLK_MQ_F_BLOCKING. */ unsigned queuecommand_may_block:1; + /* See also BLK_MQ_F_DISABLE_FAIR_TAG_SHARING. */ + unsigned disable_fair_tag_sharing:1; + /* * Countdown for host blocking with no commands outstanding. */ @@ -662,6 +665,9 @@ struct Scsi_Host { /* The queuecommand callback may block. See also BLK_MQ_F_BLOCKING. */ unsigned queuecommand_may_block:1; + /* See also BLK_MQ_F_DISABLE_FAIR_TAG_SHARING. */ + unsigned disable_fair_tag_sharing:1; + /* Host responded with short (<36 bytes) INQUIRY result */ unsigned short_inquiry:1; From patchwork Thu Nov 30 19:31:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 13474937 Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5B2310E5; Thu, 30 Nov 2023 11:31:49 -0800 (PST) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6cb55001124so1946734b3a.0; Thu, 30 Nov 2023 11:31:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701372709; x=1701977509; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x2fc05+XY37VuqJxsuOR+Mro4zuIHs7obA90Z7kwdNo=; b=QU/MY8tlT/vQNRPy6bKzzoztzlDxZ/AzAhrC6LoOIzX2hF4PngeqtAxd2VVP1kFnJa NCwx3aKKEaLLeCPGWnL1o217ob/BBvTZ/wj5PipsWxpuewE9u5kbh8M+YjaNOW1Ak8eh Ut6b9hkeuB8sQ4/JXOvhoS/bmbZ9lDJBWiuXGhYDDi3VnZP9Oq1Sa+PK9KVqyffWSJ8N QXr2s8MCUAlabS60DIil2DeMs47YjBD2Msrp3W5/a2EbKeShzxoGNXitqkOtD9TxHKyM PkFxbS9F7BrVy2nkl3/w4N4hTpn8xpwYbF8Rg1RvSLDPSnucn1rBhKzwIjQvg7Wljq7c 6VuA== X-Gm-Message-State: AOJu0YxMx3fFf+pSlRn8JI/1Q46IsYwRosAfSqGhxQZ6rqTodi6j7YLf nb7oBOCTRmog2dVzx+XXJ5g= X-Google-Smtp-Source: AGHT+IGVYUDB4OZHnQwPgKveJyEF57PrruZoIL7R1g1UXgRr7jeBWC4/QRtEiTLajrmD/pUy6d98dA== X-Received: by 2002:a05:6a20:7d88:b0:18c:3199:7174 with SMTP id v8-20020a056a207d8800b0018c31997174mr30699516pzj.19.1701372709003; Thu, 30 Nov 2023 11:31:49 -0800 (PST) Received: from bvanassche-linux.mtv.corp.google.com ([2620:0:1000:8411:8572:6fe3:eaf0:3b9d]) by smtp.gmail.com with ESMTPSA id m127-20020a632685000000b005c606b44405sm1635365pgm.67.2023.11.30.11.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:31:48 -0800 (PST) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, "Martin K . Petersen" , Christoph Hellwig , Bart Van Assche , Ming Lei , Keith Busch , Damien Le Moal , Yu Kuai , Ed Tsai , "James E.J. Bottomley" , Matthias Brugger , AngeloGioacchino Del Regno Subject: [PATCH v6 3/4] scsi: core: Make fair tag sharing configurable via sysfs Date: Thu, 30 Nov 2023 11:31:30 -0800 Message-ID: <20231130193139.880955-4-bvanassche@acm.org> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231130193139.880955-1-bvanassche@acm.org> References: <20231130193139.880955-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a sysfs attribute to SCSI hosts for configuring fair tag sharing. Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Ming Lei Cc: Keith Busch Cc: Damien Le Moal Cc: Yu Kuai Cc: Ed Tsai Signed-off-by: Bart Van Assche --- drivers/scsi/scsi_sysfs.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 24f6eefb6803..58f0aba50566 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -403,6 +403,35 @@ show_nr_hw_queues(struct device *dev, struct device_attribute *attr, char *buf) } static DEVICE_ATTR(nr_hw_queues, S_IRUGO, show_nr_hw_queues, NULL); +static ssize_t show_fair_sharing(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct Scsi_Host *shost = class_to_shost(dev); + struct blk_mq_tag_set *tag_set = &shost->tag_set; + + return sysfs_emit(buf, "%d\n", + !(tag_set->flags & BLK_MQ_F_DISABLE_FAIR_TAG_SHARING)); +} + +static ssize_t store_fair_sharing(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct Scsi_Host *shost = class_to_shost(dev); + struct blk_mq_tag_set *tag_set = &shost->tag_set; + bool enable; + int res; + + res = kstrtobool(buf, &enable); + if (res < 0) + return res; + blk_mq_update_fair_sharing(tag_set, enable); + + return count; +} + +static DEVICE_ATTR(fair_sharing, 0644, show_fair_sharing, store_fair_sharing); + static struct attribute *scsi_sysfs_shost_attrs[] = { &dev_attr_use_blk_mq.attr, &dev_attr_unique_id.attr, @@ -421,6 +450,7 @@ static struct attribute *scsi_sysfs_shost_attrs[] = { &dev_attr_host_reset.attr, &dev_attr_eh_deadline.attr, &dev_attr_nr_hw_queues.attr, + &dev_attr_fair_sharing.attr, NULL }; From patchwork Thu Nov 30 19:31:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 13474938 Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8982ED54; Thu, 30 Nov 2023 11:31:58 -0800 (PST) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6cdcd790f42so1338349b3a.3; Thu, 30 Nov 2023 11:31:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701372718; x=1701977518; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=10WDQOMbLhwr6X7mmZ2uFxLynqBDtNMaAveAhuigAVA=; b=KSRLqBTI3UTMg5dFuzVGqf8XG7yD/U1tRkvkqws3aCnIYJ3mSnAVAnWDOZ1hQkTwQi 2tpqjjZDOgz9R0hSw+vgqnDwt5a6jBAUAv1m+oAmcurykC1C/HJ4WDUS8xGGamlEaoEC 3Pmzs7VkB71WcEJ0WHAaMlBN21v9Ly/erGJ+YAGHeIf+SAmbzEFt5SvARcjh7s7kiMr6 Tf5wm/TSGvAMJUZPakp6XYotd/6Szi3doKtanCMQDYMkjmMeYLo6qyoUsU37J4kX81wE NSukJbVk/iKRPwUJNOCUBeb6VyWXVs3lLQ9tcnbIuZfBsccCo4awP36g9nLMf6pSMU0n 9lhQ== X-Gm-Message-State: AOJu0Ywf0irzUJbNSPXy5mGi2jj7SmUiwBqWNp/jf2s1ZB8NNPm5jFqi jKIgImRCQS8nSv6OX1atVHBtpv9EeTY= X-Google-Smtp-Source: AGHT+IGUDVQtLXtXVTHcyYfbMADFBjfcpSbUp4Gwbjn7IWLspKOkJWzQerfbCR4mDOIMmJNdkXJOJg== X-Received: by 2002:a05:6a20:3d85:b0:187:dd5f:93b6 with SMTP id s5-20020a056a203d8500b00187dd5f93b6mr24017855pzi.43.1701372717894; Thu, 30 Nov 2023 11:31:57 -0800 (PST) Received: from bvanassche-linux.mtv.corp.google.com ([2620:0:1000:8411:8572:6fe3:eaf0:3b9d]) by smtp.gmail.com with ESMTPSA id m127-20020a632685000000b005c606b44405sm1635365pgm.67.2023.11.30.11.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:31:57 -0800 (PST) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, "Martin K . Petersen" , Christoph Hellwig , Bart Van Assche , Avri Altman , Ming Lei , Keith Busch , Damien Le Moal , Yu Kuai , Ed Tsai , "James E.J. Bottomley" , Matthias Brugger , AngeloGioacchino Del Regno , Stanley Jhu , Manivannan Sadhasivam , Can Guo , Asutosh Das , "Bao D. Nguyen" , Peter Wang , Bean Huo , Arthur Simchaev Subject: [PATCH v6 4/4] scsi: ufs: Disable fair tag sharing Date: Thu, 30 Nov 2023 11:31:31 -0800 Message-ID: <20231130193139.880955-5-bvanassche@acm.org> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog In-Reply-To: <20231130193139.880955-1-bvanassche@acm.org> References: <20231130193139.880955-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Disable the block layer fair tag sharing algorithm because it significantly reduces performance of UFS devices with a maximum queue depth of 32. Reviewed-by: Avri Altman Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Ming Lei Cc: Keith Busch Cc: Damien Le Moal Cc: Yu Kuai Cc: Ed Tsai Signed-off-by: Bart Van Assche --- drivers/ufs/core/ufshcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 8b1031fb0a44..a2219cbb9720 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -8973,6 +8973,7 @@ static const struct scsi_host_template ufshcd_driver_template = { .max_host_blocked = 1, .track_queue_depth = 1, .skip_settle_delay = 1, + .disable_fair_tag_sharing = 1, .sdev_groups = ufshcd_driver_groups, .rpm_autosuspend_delay = RPM_AUTOSUSPEND_DELAY_MS, };