From patchwork Mon Sep 18 16:55:47 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: 725158 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97FDDCD37B0 for ; Mon, 18 Sep 2023 16:58:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231311AbjIRQ6G (ORCPT ); Mon, 18 Sep 2023 12:58:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbjIRQ5w (ORCPT ); Mon, 18 Sep 2023 12:57:52 -0400 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 002CDC2; Mon, 18 Sep 2023 09:57:45 -0700 (PDT) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-68fc9a4ebe9so4330079b3a.2; Mon, 18 Sep 2023 09:57:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695056265; x=1695661065; 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=KzaYxnCqQNUVR3i3khEB0a4wN2TqC5S5bjyD6Ki8qwY=; b=cLXdwXpsvMG/tDWkLp+LZt1WKLXrUM8G412cFF4clAKuSKmqe6iE1gzhBs2G9DCG9B bnO1V6AGaQmcW0Sj0MkJu+EQ4TFRvlJe4Q+9krgjIYn6HR5frWnI7iiFUMVYDv5XY/Kr gqP8rHpUkUsdsd6ndf+h4cN/WCk6kz5ifOswymAZT9FSo/Zumy4KaxTvMy9zmi7DskB2 aVEnGV3XXHOUCmh+tigB/aTIT0Hg8lrXkVe8FZStLIjPqZIYATU3/d4CWQ/jQdXftc2V iOcNAcJgJKZNR1b8S23ExVdDzEus5k4eUzTdR6miEbaCVCa5KovVEo5cWlDslxWFoZUa XiFg== X-Gm-Message-State: AOJu0YznZR5/7f+t5kq5+XIPmmJRcnE2X1JeBgi0u+WYVIPskJYjWEjV 07cWLqoyINfjbOarSr9HiM8= X-Google-Smtp-Source: AGHT+IFiD4XCHveAz3wEcMHe4gUpwsYLMntVhF4GjSBhjowfm2uMnSW0b6IJT2h+r0nXqUcCJPpVjQ== X-Received: by 2002:a05:6a20:8420:b0:132:2f7d:29ca with SMTP id c32-20020a056a20842000b001322f7d29camr12454743pzd.24.1695056265378; Mon, 18 Sep 2023 09:57:45 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:33e7:1437:5d00:8e3b]) by smtp.gmail.com with ESMTPSA id p17-20020a639511000000b005740aa41237sm5658041pgd.74.2023.09.18.09.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 09:57:45 -0700 (PDT) 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 , Damien Le Moal , Ming Lei , "James E.J. Bottomley" Subject: [PATCH v12 08/16] scsi: sd_zbc: Only require an I/O scheduler if needed Date: Mon, 18 Sep 2023 09:55:47 -0700 Message-ID: <20230918165713.1598705-9-bvanassche@acm.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230918165713.1598705-1-bvanassche@acm.org> References: <20230918165713.1598705-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org An I/O scheduler that serializes zoned writes is only needed if the SCSI LLD does not preserve the write order. Hence only set ELEVATOR_F_ZBD_SEQ_WRITE if the LLD does not preserve the write order. Reviewed-by: Damien Le Moal Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Ming Lei Signed-off-by: Bart Van Assche --- drivers/scsi/sd_zbc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index a25215507668..718b31bed878 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -955,7 +955,9 @@ int sd_zbc_read_zones(struct scsi_disk *sdkp, u8 buf[SD_BUF_SIZE]) /* The drive satisfies the kernel restrictions: set it up */ blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q); - blk_queue_required_elevator_features(q, ELEVATOR_F_ZBD_SEQ_WRITE); + if (!q->limits.driver_preserves_write_order) + blk_queue_required_elevator_features(q, + ELEVATOR_F_ZBD_SEQ_WRITE); if (sdkp->zones_max_open == U32_MAX) disk_set_max_open_zones(disk, 0); else