From patchwork Wed Jul 26 00:57:25 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: 13327348 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 CCCD0EB64DD for ; Wed, 26 Jul 2023 00:57:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbjGZA5v (ORCPT ); Tue, 25 Jul 2023 20:57:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjGZA5u (ORCPT ); Tue, 25 Jul 2023 20:57:50 -0400 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3AF9BC for ; Tue, 25 Jul 2023 17:57:49 -0700 (PDT) Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6bc481fe23eso998683a34.0 for ; Tue, 25 Jul 2023 17:57:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690333069; x=1690937869; 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=eGeYdvHkIe+/g6ccJ3EraC4iHJ4sXYdBakvs/IB1EFw=; b=HLk0UH0//8wK5ITtfjGCxmRKT5UJM1KAtLSbgeBGgJDBOT3gMQUBhxCMxfBUbmfjoJ VrpuSX5yCf+iX4XG021NTN0qRZSvF2/AiopGIumbrI66vBiWgI6YznCEpWC2hP+83zKe 1qPavThyW6T0h1kLYO+0eyrMtnN7OOKP4O2dQjU1a27WpsAI48vgfTxvczYYHXZXEJ9k gB5/Wro+VIN+pmd2zolfpJyHmrHhR78pUjQvdz0U/f1nZpejcEyt55tfrjwx1fPehjOH Rx+qs7cmvpFgh3FpKbMdwGbQA4P/55q96frHCizyvT2zfMoE3kRRm0evyeFgd3y7I7WX xp9Q== X-Gm-Message-State: ABy/qLYOy6iGQA9Ro+stPqtwxCPR1eHc/DFCvPj/uJmW7FPh6BeoNwJq qh7QNWRa4Bku9WB/nTbR4/I= X-Google-Smtp-Source: APBJJlGR3CAcA8VpElr35t1iMcTkPeQOnRSHlP0QtX8e9pyEypaUrJK5JHOiBj5whMhet5KN4MMRZA== X-Received: by 2002:a05:6358:e48f:b0:139:4de9:2a68 with SMTP id by15-20020a056358e48f00b001394de92a68mr441992rwb.27.1690333068842; Tue, 25 Jul 2023 17:57:48 -0700 (PDT) Received: from bvanassche-glaptop2.roam.corp.google.com ([2601:642:4c05:4a8d:dbda:6b13:2798:9795]) by smtp.gmail.com with ESMTPSA id t10-20020a63954a000000b005634bd81331sm11090138pgn.72.2023.07.25.17.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 17:57:48 -0700 (PDT) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Jaegeuk Kim , Bart Van Assche , Damien Le Moal , Ming Lei Subject: [PATCH v3 1/6] block: Introduce the flag REQ_NO_WRITE_LOCK Date: Tue, 25 Jul 2023 17:57:25 -0700 Message-ID: <20230726005742.303865-2-bvanassche@acm.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230726005742.303865-1-bvanassche@acm.org> References: <20230726005742.303865-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Not all software that supports zoned storage allocates and submits zoned writes in LBA order per zone. Introduce the REQ_NO_WRITE_LOCK flag such that submitters of zoned writes can indicate that zoned writes are allocated and submitted in LBA order per zone. Cc: Christoph Hellwig Cc: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche --- block/blk-flush.c | 3 ++- include/linux/blk_types.h | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/block/blk-flush.c b/block/blk-flush.c index e73dc22d05c1..038350ed7cce 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -336,7 +336,8 @@ static void blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq, flush_rq->internal_tag = first_rq->internal_tag; flush_rq->cmd_flags = REQ_OP_FLUSH | REQ_PREFLUSH; - flush_rq->cmd_flags |= (flags & REQ_DRV) | (flags & REQ_FAILFAST_MASK); + flush_rq->cmd_flags |= flags & + (REQ_FAILFAST_MASK | REQ_NO_ZONE_WRITE_LOCK | REQ_DRV); flush_rq->rq_flags |= RQF_FLUSH_SEQ; flush_rq->end_io = flush_end_io; /* diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 0bad62cca3d0..68f7934d8fa6 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -416,6 +416,12 @@ enum req_flag_bits { __REQ_PREFLUSH, /* request for cache flush */ __REQ_RAHEAD, /* read ahead, can fail anytime */ __REQ_BACKGROUND, /* background IO */ + /* + * Do not use zone write locking. Setting this flag is only safe if + * the request submitter allocates and submit requests in LBA order per + * zone. + */ + __REQ_NO_ZONE_WRITE_LOCK, __REQ_NOWAIT, /* Don't wait if request will block */ __REQ_POLLED, /* caller polls for completion using bio_poll */ __REQ_ALLOC_CACHE, /* allocate IO from cache if available */ @@ -448,6 +454,8 @@ enum req_flag_bits { #define REQ_PREFLUSH (__force blk_opf_t)(1ULL << __REQ_PREFLUSH) #define REQ_RAHEAD (__force blk_opf_t)(1ULL << __REQ_RAHEAD) #define REQ_BACKGROUND (__force blk_opf_t)(1ULL << __REQ_BACKGROUND) +#define REQ_NO_ZONE_WRITE_LOCK \ + (__force blk_opf_t)(1ULL << __REQ_NO_ZONE_WRITE_LOCK) #define REQ_NOWAIT (__force blk_opf_t)(1ULL << __REQ_NOWAIT) #define REQ_POLLED (__force blk_opf_t)(1ULL << __REQ_POLLED) #define REQ_ALLOC_CACHE (__force blk_opf_t)(1ULL << __REQ_ALLOC_CACHE) From patchwork Wed Jul 26 00:57:26 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: 13327349 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 4D4C5C001DE for ; Wed, 26 Jul 2023 00:57:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229694AbjGZA54 (ORCPT ); Tue, 25 Jul 2023 20:57:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230102AbjGZA5w (ORCPT ); Tue, 25 Jul 2023 20:57:52 -0400 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55FCBBC for ; Tue, 25 Jul 2023 17:57:51 -0700 (PDT) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-666edfc50deso308585b3a.0 for ; Tue, 25 Jul 2023 17:57:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690333071; x=1690937871; 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=dlhirHeZ9D5mH766yvDJm3Juv19BdZSWGgzb/O9c98I=; b=DHcP9zfZbZxtTiR6TiVIDQB9XgdT/8e+TaqgTBqtO4ZMZlx3/VHn6P+s6fYU5YzlVV uDhTea2mMma0JLE7IirPxtaUkV6QiKhxslIkSYuFbDbEc0vTG7U33Jkq3MUmIY2huxgD fJBR7fD65SGNoU86S6QYtKm4iPt5DqpPnWI3///jbg8svhl3FH6bJpZX0RMeXDo01kWr WpPunY2CnhiO5musYMVEJXjZwhkcBGyj+VWo8+/sVZK2vs4cdS6oyWhA1lx2aqz4Cz4b XzwGcq1NUMJcMLeapyZnqgz2zxZwfdkcZZydI5nEA4Yz+zpQimm1XmNftYEofxbP1b5Z JdFQ== X-Gm-Message-State: ABy/qLZYO7ybQwH4A4fYL4n8OeJAI6OXM2/NPzmHQOEv2uo+j9KdB1QB toICPbOaIGrpFLrfGZABi4g= X-Google-Smtp-Source: APBJJlGumd8ACDhfRV0s5Y3leJiOK1an3JGr+J3DKWZRdVFpRub7FnZkNs1KpyboSSwW5ml88Kc/uw== X-Received: by 2002:a05:6a21:6d8f:b0:12e:4174:6a4d with SMTP id wl15-20020a056a216d8f00b0012e41746a4dmr988779pzb.10.1690333070618; Tue, 25 Jul 2023 17:57:50 -0700 (PDT) Received: from bvanassche-glaptop2.roam.corp.google.com ([2601:642:4c05:4a8d:dbda:6b13:2798:9795]) by smtp.gmail.com with ESMTPSA id t10-20020a63954a000000b005634bd81331sm11090138pgn.72.2023.07.25.17.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 17:57:49 -0700 (PDT) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Jaegeuk Kim , Bart Van Assche , Damien Le Moal , Ming Lei Subject: [PATCH v3 2/6] block/mq-deadline: Only use zone locking if necessary Date: Tue, 25 Jul 2023 17:57:26 -0700 Message-ID: <20230726005742.303865-3-bvanassche@acm.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230726005742.303865-1-bvanassche@acm.org> References: <20230726005742.303865-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Measurements have shown that limiting the queue depth to one for zoned writes has a significant negative performance impact on zoned UFS devices. Hence this patch that disables zone locking by the mq-deadline scheduler if zoned writes are submitted in order and if the storage controller preserves the command order. This patch is based on the following assumptions: - It happens infrequently that zoned write requests are reordered by the block layer. - The I/O priority of all write requests is the same per zone. - Either no I/O scheduler is used or an I/O scheduler is used that submits write requests per zone in LBA order. Cc: Christoph Hellwig Cc: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche --- block/mq-deadline.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/block/mq-deadline.c b/block/mq-deadline.c index 02a916ba62ee..ce5b5048935e 100644 --- a/block/mq-deadline.c +++ b/block/mq-deadline.c @@ -338,6 +338,18 @@ static struct request *deadline_skip_seq_writes(struct deadline_data *dd, return rq; } +/* + * Use write locking if either QUEUE_FLAG_NO_ZONE_WRITE_LOCK or + * REQ_NO_ZONE_WRITE_LOCK has not been set. Not using zone write locking is + * only safe if the submitter allocates and submit requests in LBA order per + * zone and if the block driver preserves the request order. + */ +static bool dd_use_write_locking(struct request *rq) +{ + return !blk_queue_no_zone_write_lock(rq->q) || + !(rq->cmd_flags & REQ_NO_ZONE_WRITE_LOCK); +} + /* * For the specified data direction, return the next request to * dispatch using arrival ordered lists. @@ -353,7 +365,8 @@ deadline_fifo_request(struct deadline_data *dd, struct dd_per_prio *per_prio, return NULL; rq = rq_entry_fifo(per_prio->fifo_list[data_dir].next); - if (data_dir == DD_READ || !blk_queue_is_zoned(rq->q)) + if (data_dir == DD_READ || !blk_queue_is_zoned(rq->q) || + !dd_use_write_locking(rq)) return rq; /* @@ -398,7 +411,8 @@ deadline_next_request(struct deadline_data *dd, struct dd_per_prio *per_prio, if (!rq) return NULL; - if (data_dir == DD_READ || !blk_queue_is_zoned(rq->q)) + if (data_dir == DD_READ || !blk_queue_is_zoned(rq->q) || + !dd_use_write_locking(rq)) return rq; /* @@ -526,8 +540,9 @@ static struct request *__dd_dispatch_request(struct deadline_data *dd, } /* - * For a zoned block device, if we only have writes queued and none of - * them can be dispatched, rq will be NULL. + * For a zoned block device that requires write serialization, if we + * only have writes queued and none of them can be dispatched, rq will + * be NULL. */ if (!rq) return NULL; @@ -552,7 +567,8 @@ static struct request *__dd_dispatch_request(struct deadline_data *dd, /* * If the request needs its target zone locked, do it. */ - blk_req_zone_write_lock(rq); + if (dd_use_write_locking(rq)) + blk_req_zone_write_lock(rq); rq->rq_flags |= RQF_STARTED; return rq; } @@ -933,7 +949,7 @@ static void dd_finish_request(struct request *rq) atomic_inc(&per_prio->stats.completed); - if (blk_queue_is_zoned(q)) { + if (blk_queue_is_zoned(rq->q) && dd_use_write_locking(rq)) { unsigned long flags; spin_lock_irqsave(&dd->zone_lock, flags); From patchwork Wed Jul 26 00:57:27 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: 13327350 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 E87F7EB64DD for ; Wed, 26 Jul 2023 00:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229959AbjGZA6E (ORCPT ); Tue, 25 Jul 2023 20:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjGZA6D (ORCPT ); Tue, 25 Jul 2023 20:58:03 -0400 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F36C612E for ; Tue, 25 Jul 2023 17:58:01 -0700 (PDT) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-666ecb21f86so5753262b3a.3 for ; Tue, 25 Jul 2023 17:58:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690333081; x=1690937881; 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=uuKws2rBoncGscGCPbcpPhXe4qyr3T65eDTeSQZyG68=; b=LZgK5FZu2ySzQ/gv0HmQZDsvTsZntZRXgztUG9e05ZCNP7buhMnSAypVfUAwRZDkjc JHBqh0fhZPs/c/MbEPkIoKIHfFlFhpOO5WNzYJiRGGk77a+n1GGMb3DRg0iAiALc4q+Q WxgspM6ihVAdUJAZruKAPCz6sqdEEAUZ+Pcsh78btem8h7SQdl+6x/yMn7Wl5Rtf1KKe EdPy51CZ8HgavAigoUTpzUk1lY1u6xdEhf+MhZYTlKihdsHjKxgeM4Nm5XFtdG6R9YHZ +rnLMtCJ2aGIos0/LJ0CwQQfzxNOOpBnAb8OmDp383MtN8Ew5Wtbet9HQcMaV7jUKJ+x q3iQ== X-Gm-Message-State: ABy/qLbJtIOQqshyL9tro99pCjkiWWxLE/50/0ENk2LmmhGnW5HvWEPa wal5dF64B48yNBb3wdiZzD0= X-Google-Smtp-Source: APBJJlG34VH3g6xF1HXezotWfbdYQa9II/4DmCAZ+w6xZjq5GBhLcetlMboWFzv0Wmk1klJ/pPV/pA== X-Received: by 2002:a05:6a00:a06:b0:64c:4f2f:a235 with SMTP id p6-20020a056a000a0600b0064c4f2fa235mr1103214pfh.30.1690333081316; Tue, 25 Jul 2023 17:58:01 -0700 (PDT) Received: from bvanassche-glaptop2.roam.corp.google.com ([2601:642:4c05:4a8d:dbda:6b13:2798:9795]) by smtp.gmail.com with ESMTPSA id t10-20020a63954a000000b005634bd81331sm11090138pgn.72.2023.07.25.17.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 17:58:00 -0700 (PDT) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Jaegeuk Kim , Bart Van Assche , Damien Le Moal , Ming Lei , Chaitanya Kulkarni , Damien Le Moal , Nitesh Shetty , Vincent Fu , Dan Carpenter , Akinobu Mita , "Shin'ichiro Kawasaki" , "Martin K. Petersen" , Johannes Thumshirn Subject: [PATCH v3 3/6] block/null_blk: Support disabling zone write locking Date: Tue, 25 Jul 2023 17:57:27 -0700 Message-ID: <20230726005742.303865-4-bvanassche@acm.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230726005742.303865-1-bvanassche@acm.org> References: <20230726005742.303865-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Add a new configfs attribute for disabling zone write locking. The test script below reports 250 K IOPS with no I/O scheduler, 6 K IOPS with mq-deadline and write locking enabled and 123 K IOPS with mq-deadline and write locking disabled. This shows that disabling write locking results in about 20 times more IOPS for this particular test case. #!/bin/bash for mode in "none 0" "mq-deadline 0" "mq-deadline 1"; do set +e for d in /sys/kernel/config/nullb/*; do [ -d "$d" ] && rmdir "$d" done modprobe -r null_blk set -e read -r iosched no_write_locking <<<"$mode" modprobe null_blk nr_devices=0 ( cd /sys/kernel/config/nullb mkdir nullb0 cd nullb0 params=( completion_nsec=100000 hw_queue_depth=64 irqmode=2 # NULL_IRQ_TIMER max_sectors=$((4096/512)) memory_backed=1 no_zone_write_lock="${no_write_locking}" size=1 submit_queues=1 zone_size=1 zoned=1 power=1 ) for p in "${params[@]}"; do echo "${p//*=}" > "${p//=*}" done ) udevadm settle dev=/dev/nullb0 [ -b "${dev}" ] params=( --direct=1 --filename="${dev}" --iodepth=64 --iodepth_batch=16 --ioengine=io_uring --ioscheduler="${iosched}" --gtod_reduce=1 --hipri=0 --name=nullb0 --runtime=30 --rw=write --time_based=1 --zonemode=zbd ) fio "${params[@]}" done Cc: Christoph Hellwig Cc: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche --- drivers/block/null_blk/main.c | 2 ++ drivers/block/null_blk/null_blk.h | 1 + drivers/block/null_blk/zoned.c | 3 +++ 3 files changed, 6 insertions(+) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 864013019d6b..5c0578137f51 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -424,6 +424,7 @@ NULLB_DEVICE_ATTR(zone_capacity, ulong, NULL); NULLB_DEVICE_ATTR(zone_nr_conv, uint, NULL); NULLB_DEVICE_ATTR(zone_max_open, uint, NULL); NULLB_DEVICE_ATTR(zone_max_active, uint, NULL); +NULLB_DEVICE_ATTR(no_zone_write_lock, bool, NULL); NULLB_DEVICE_ATTR(virt_boundary, bool, NULL); NULLB_DEVICE_ATTR(no_sched, bool, NULL); NULLB_DEVICE_ATTR(shared_tag_bitmap, bool, NULL); @@ -569,6 +570,7 @@ static struct configfs_attribute *nullb_device_attrs[] = { &nullb_device_attr_zone_max_active, &nullb_device_attr_zone_readonly, &nullb_device_attr_zone_offline, + &nullb_device_attr_no_zone_write_lock, &nullb_device_attr_virt_boundary, &nullb_device_attr_no_sched, &nullb_device_attr_shared_tag_bitmap, diff --git a/drivers/block/null_blk/null_blk.h b/drivers/block/null_blk/null_blk.h index 929f659dd255..b521096bcc3f 100644 --- a/drivers/block/null_blk/null_blk.h +++ b/drivers/block/null_blk/null_blk.h @@ -117,6 +117,7 @@ struct nullb_device { bool memory_backed; /* if data is stored in memory */ bool discard; /* if support discard */ bool zoned; /* if device is zoned */ + bool no_zone_write_lock; bool virt_boundary; /* virtual boundary on/off for the device */ bool no_sched; /* no IO scheduler for the device */ bool shared_tag_bitmap; /* use hostwide shared tags */ diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c index 55c5b48bc276..31c8364a63e9 100644 --- a/drivers/block/null_blk/zoned.c +++ b/drivers/block/null_blk/zoned.c @@ -96,6 +96,9 @@ int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q) spin_lock_init(&dev->zone_res_lock); + if (dev->no_zone_write_lock) + blk_queue_flag_set(QUEUE_FLAG_NO_ZONE_WRITE_LOCK, q); + if (dev->zone_nr_conv >= dev->nr_zones) { dev->zone_nr_conv = dev->nr_zones - 1; pr_info("changed the number of conventional zones to %u", From patchwork Wed Jul 26 00:57: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: 13327351 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 EA5BEC001DF for ; Wed, 26 Jul 2023 00:58:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbjGZA6F (ORCPT ); Tue, 25 Jul 2023 20:58:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjGZA6F (ORCPT ); Tue, 25 Jul 2023 20:58:05 -0400 Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D37D19BD for ; Tue, 25 Jul 2023 17:58:04 -0700 (PDT) Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-5636425bf98so2895179eaf.1 for ; Tue, 25 Jul 2023 17:58:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690333083; x=1690937883; 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=U9CpW92TOYCG8FstgGSEwmGuSAGeDeWCDg7oNyAimTY=; b=BGApggMnm8s/Kn7Zdl03ce8/3D/rjgdRAFIow1UlO4hraFqi6H6DQ03IS1N90NN03C WVoeQHSS+md9EWBV9TWJzxTaZ8Tus0BhZIvx9raXEmIt3Pi5+vxngWWLmf3vE1xXqR0w qRpgCUDkebEEOF7TbZjWkqMr5N5YHdct3jSkrmYzTJUgjUGQ4EnnaSCe772oB3etgY9l epEyZpT30i0zyrjou/1R9a9+2o/9nxGjXotld2NRpD3Nces3DDszD3QKN+PZLc94oeLl thjWmr43vnHnc2n2S+5fSjiLq+4o3w3QbFnEPBJyfWrwiFd8zzC+0cFSFwbdqVfEYxGf Ecrg== X-Gm-Message-State: ABy/qLZnb0204rt/9snLktTRSwz/G9AgDX9SS79KwKM/Wb1XK1osfeTe 0PGnOqJ8TnryUWu3ABn1DKA= X-Google-Smtp-Source: APBJJlFdWL1WRCpP2Ucy3rwo+xD4/5Scbp59zRTTMjx6Q8mECfuK6LB73ldDAeV0Mulqn22UGLDV9g== X-Received: by 2002:a05:6358:6383:b0:133:ac7:c84b with SMTP id k3-20020a056358638300b001330ac7c84bmr216105rwh.12.1690333083147; Tue, 25 Jul 2023 17:58:03 -0700 (PDT) Received: from bvanassche-glaptop2.roam.corp.google.com ([2601:642:4c05:4a8d:dbda:6b13:2798:9795]) by smtp.gmail.com with ESMTPSA id t10-20020a63954a000000b005634bd81331sm11090138pgn.72.2023.07.25.17.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 17:58:02 -0700 (PDT) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Jaegeuk Kim , Bart Van Assche , "Martin K . Petersen" , Damien Le Moal , Ming Lei , "James E.J. Bottomley" Subject: [PATCH v3 4/6] scsi: Retry unaligned zoned writes Date: Tue, 25 Jul 2023 17:57:28 -0700 Message-ID: <20230726005742.303865-5-bvanassche@acm.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230726005742.303865-1-bvanassche@acm.org> References: <20230726005742.303865-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From ZBC-2: "The device server terminates with CHECK CONDITION status, with the sense key set to ILLEGAL REQUEST, and the additional sense code set to UNALIGNED WRITE COMMAND a write command, other than an entire medium write same command, that specifies: a) the starting LBA in a sequential write required zone set to a value that is not equal to the write pointer for that sequential write required zone; or b) an ending LBA that is not equal to the last logical block within a physical block (see SBC-5)." Send commands that failed with an unaligned write error to the SCSI error handler. Let the SCSI error handler sort SCSI commands per LBA before resubmitting these. Increase the number of retries for write commands sent to a sequential zone to the maximum number of outstanding commands. Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche --- drivers/scsi/scsi_error.c | 37 +++++++++++++++++++++++++++++++++++++ drivers/scsi/scsi_lib.c | 1 + drivers/scsi/sd.c | 3 +++ include/scsi/scsi.h | 1 + 4 files changed, 42 insertions(+) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index c67cdcdc3ba8..2b9aec05dc36 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -698,6 +699,17 @@ enum scsi_disposition scsi_check_sense(struct scsi_cmnd *scmd) fallthrough; case ILLEGAL_REQUEST: + /* + * Unaligned write command. This indicates that zoned writes + * have been received by the device in the wrong order. If zone + * write locking is disabled, retry after all pending commands + * have completed. + */ + if (sshdr.asc == 0x21 && sshdr.ascq == 0x04 && + blk_queue_no_zone_write_lock(sdev->request_queue) && + !scsi_noretry_cmd(scmd) && scsi_cmd_retry_allowed(scmd)) + return NEEDS_DELAYED_RETRY; + if (sshdr.asc == 0x20 || /* Invalid command operation code */ sshdr.asc == 0x21 || /* Logical block address out of range */ sshdr.asc == 0x22 || /* Invalid function */ @@ -2223,6 +2235,25 @@ void scsi_eh_flush_done_q(struct list_head *done_q) } EXPORT_SYMBOL(scsi_eh_flush_done_q); +/* + * Returns a negative value if @_a has a lower LBA than @_b, zero if + * both have the same LBA and a positive value otherwise. + */ +static int scsi_cmp_lba(void *priv, const struct list_head *_a, + const struct list_head *_b) +{ + struct scsi_cmnd *a = list_entry(_a, typeof(*a), eh_entry); + struct scsi_cmnd *b = list_entry(_b, typeof(*b), eh_entry); + const sector_t pos_a = blk_rq_pos(scsi_cmd_to_rq(a)); + const sector_t pos_b = blk_rq_pos(scsi_cmd_to_rq(b)); + + if (pos_a < pos_b) + return -1; + if (pos_a > pos_b) + return 1; + return 0; +} + /** * scsi_unjam_host - Attempt to fix a host which has a cmd that failed. * @shost: Host to unjam. @@ -2258,6 +2289,12 @@ static void scsi_unjam_host(struct Scsi_Host *shost) SCSI_LOG_ERROR_RECOVERY(1, scsi_eh_prt_fail_stats(shost, &eh_work_q)); + /* + * Sort pending SCSI commands in LBA order. This is important if zone + * write locking is disabled for a zoned SCSI device. + */ + list_sort(NULL, &eh_work_q, scsi_cmp_lba); + if (!scsi_eh_get_sense(&eh_work_q, &eh_done_q)) scsi_eh_ready_devs(shost, &eh_work_q, &eh_done_q); diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 59176946ab56..69da8aee13df 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1443,6 +1443,7 @@ static void scsi_complete(struct request *rq) case ADD_TO_MLQUEUE: scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY); break; + case NEEDS_DELAYED_RETRY: default: scsi_eh_scmd_add(cmd); break; diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 68b12afa0721..27b9ebe05b90 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1235,6 +1235,9 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd) cmd->transfersize = sdp->sector_size; cmd->underflow = nr_blocks << 9; cmd->allowed = sdkp->max_retries; + if (blk_queue_no_zone_write_lock(rq->q) && + blk_rq_is_seq_zoned_write(rq)) + cmd->allowed += rq->q->nr_requests; cmd->sdb.length = nr_blocks * sdp->sector_size; SCSI_LOG_HLQUEUE(1, diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index ec093594ba53..6600db046227 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -93,6 +93,7 @@ static inline int scsi_status_is_check_condition(int status) * Internal return values. */ enum scsi_disposition { + NEEDS_DELAYED_RETRY = 0x2000, NEEDS_RETRY = 0x2001, SUCCESS = 0x2002, FAILED = 0x2003, From patchwork Wed Jul 26 00:57: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: 13327353 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 C4088C001DE for ; Wed, 26 Jul 2023 00:58:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbjGZA6O (ORCPT ); Tue, 25 Jul 2023 20:58:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbjGZA6N (ORCPT ); Tue, 25 Jul 2023 20:58:13 -0400 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06008F7 for ; Tue, 25 Jul 2023 17:58:09 -0700 (PDT) Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6b9cf7e6ab2so5019806a34.1 for ; Tue, 25 Jul 2023 17:58:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690333088; x=1690937888; 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=vg27AP3dmRQc/Q6tg7fhXLXYbPyXneQBPb55lq0Fmaw=; b=kz9hC2GbzSBSv36y6x/XxuCFAP5N+oFX9wprk4qYpQAv4by0GNzzfmddNKrlvE+4KF cbRY5RYuJ1CQY3UINp8HEzVFwybbvJCLvIUKr7jkE6mGr7raZMnoODUZ+MIPxZHklFa9 SUCAbB8p5Xtzt8CTGYmc/NFclIymc1baf2uwdynaFkS2eoh+f7oFIJwGppeJyHjFuwu7 LHFT+s03VVrNlRUBI2AuQ2UWA6DFZgtA5jFq6gSqC8r6uXrmIfJBwfkM9BC3dsiIJRWb 7EwzJG2ZxL1H/fI/PbvpcUXw6uPGqusMsVksOfcv7AO3kXUAE4jdKkML7Vi+LVrdi1sA Uj6A== X-Gm-Message-State: ABy/qLZzj0EGhgPUgjrIUPxF64g7hdvwo6Zw1RNlx3mi+GJKa6vGlphM Sehor1UsoXh4veiqdCensP8= X-Google-Smtp-Source: APBJJlHAqhy1tdNuM/DRyWnpw1vE2LTUnUAe3X7YGyYRSQs0jI3zYtW0Z2e0jCK0fVecABlmq0pHOg== X-Received: by 2002:a05:6830:14c:b0:6ba:169f:f419 with SMTP id j12-20020a056830014c00b006ba169ff419mr720995otp.4.1690333088104; Tue, 25 Jul 2023 17:58:08 -0700 (PDT) Received: from bvanassche-glaptop2.roam.corp.google.com ([2601:642:4c05:4a8d:dbda:6b13:2798:9795]) by smtp.gmail.com with ESMTPSA id t10-20020a63954a000000b005634bd81331sm11090138pgn.72.2023.07.25.17.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 17:58:07 -0700 (PDT) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Jaegeuk Kim , Bart Van Assche , "Martin K . Petersen" , Avri Altman , Damien Le Moal , Ming Lei , "James E.J. Bottomley" , Stanley Chu , Can Guo , Asutosh Das , "Bao D. Nguyen" , Bean Huo , Arthur Simchaev Subject: [PATCH v3 5/6] scsi: ufs: Disable zone write locking Date: Tue, 25 Jul 2023 17:57:29 -0700 Message-ID: <20230726005742.303865-6-bvanassche@acm.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230726005742.303865-1-bvanassche@acm.org> References: <20230726005742.303865-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From the UFSHCI 4.0 specification, about the legacy (single queue) mode: "The host controller always process transfer requests in-order according to the order submitted to the list. In case of multiple commands with single doorbell register ringing (batch mode), The dispatch order for these transfer requests by host controller will base on their index in the List. A transfer request with lower index value will be executed before a transfer request with higher index value." From the UFSHCI 4.0 specification, about the MCQ mode: "Command Submission 1. Host SW writes an Entry to SQ 2. Host SW updates SQ doorbell tail pointer Command Processing 3. After fetching the Entry, Host Controller updates SQ doorbell head pointer 4. Host controller sends COMMAND UPIU to UFS device" In other words, for both legacy and MCQ mode, UFS controllers are required to forward commands to the UFS device in the order these commands have been received from the host. Notes: - For legacy mode this is only correct if the host submits one command at a time. The UFS driver does this. - Also in legacy mode, the command order is not preserved if auto-hibernation is enabled in the UFS controller. This patch improves small write IOPS with a factor four on my test setup. Cc: Martin K. Petersen Cc: Avri Altman Cc: Christoph Hellwig Cc: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche --- drivers/ufs/core/ufshcd.c | 45 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 129446775796..0f7f91e2cda9 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -4337,29 +4337,67 @@ int ufshcd_uic_hibern8_exit(struct ufs_hba *hba) } EXPORT_SYMBOL_GPL(ufshcd_uic_hibern8_exit); +void ufshcd_update_no_zone_write_lock(struct ufs_hba *hba, + bool set_no_zone_write_lock) +{ + struct scsi_device *sdev; + + shost_for_each_device(sdev, hba->host) + blk_freeze_queue_start(sdev->request_queue); + shost_for_each_device(sdev, hba->host) { + struct request_queue *q = sdev->request_queue; + + blk_mq_freeze_queue_wait(q); + if (set_no_zone_write_lock) + blk_queue_flag_set(QUEUE_FLAG_NO_ZONE_WRITE_LOCK, q); + else + blk_queue_flag_clear(QUEUE_FLAG_NO_ZONE_WRITE_LOCK, q); + blk_mq_unfreeze_queue(q); + } +} + void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit) { unsigned long flags; - bool update = false; + bool prev_state, new_state, update = false; if (!ufshcd_is_auto_hibern8_supported(hba)) return; spin_lock_irqsave(hba->host->host_lock, flags); + prev_state = ufshcd_is_auto_hibern8_enabled(hba); if (hba->ahit != ahit) { hba->ahit = ahit; update = true; } + new_state = ufshcd_is_auto_hibern8_enabled(hba); spin_unlock_irqrestore(hba->host->host_lock, flags); - if (update && - !pm_runtime_suspended(&hba->ufs_device_wlun->sdev_gendev)) { + if (!update) + return; + if (!is_mcq_enabled(hba) && !prev_state && new_state) { + /* + * Auto-hibernation will be enabled. Enable write locking for + * zoned writes since auto-hibernation may cause reordering of + * zoned writes when using the legacy mode of the UFS host + * controller. + */ + ufshcd_update_no_zone_write_lock(hba, false); + } + if (!pm_runtime_suspended(&hba->ufs_device_wlun->sdev_gendev)) { ufshcd_rpm_get_sync(hba); ufshcd_hold(hba); ufshcd_auto_hibern8_enable(hba); ufshcd_release(hba); ufshcd_rpm_put_sync(hba); } + if (!is_mcq_enabled(hba) && prev_state && !new_state) { + /* + * Auto-hibernation has been disabled. Disable write locking + * for zoned writes. + */ + ufshcd_update_no_zone_write_lock(hba, true); + } } EXPORT_SYMBOL_GPL(ufshcd_auto_hibern8_update); @@ -5139,6 +5177,7 @@ static int ufshcd_slave_configure(struct scsi_device *sdev) ufshcd_hpb_configure(hba, sdev); + blk_queue_flag_set(QUEUE_FLAG_NO_ZONE_WRITE_LOCK, q); blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1); if (hba->quirks & UFSHCD_QUIRK_4KB_DMA_ALIGNMENT) blk_queue_update_dma_alignment(q, SZ_4K - 1); From patchwork Wed Jul 26 00:57: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: 13327352 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 23A32C41513 for ; Wed, 26 Jul 2023 00:58:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbjGZA6P (ORCPT ); Tue, 25 Jul 2023 20:58:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230102AbjGZA6O (ORCPT ); Tue, 25 Jul 2023 20:58:14 -0400 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C586DBC for ; Tue, 25 Jul 2023 17:58:10 -0700 (PDT) Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6b9d562f776so4808250a34.2 for ; Tue, 25 Jul 2023 17:58:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690333090; x=1690937890; 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=KfP3G2FLUFJYJUQB/WuAG4l/dYwNhxCDQudwlLXJrQI=; b=VsrVGVgf39kgg7g9fyFnsf9v+dgtIWaqYGn8/IiVChWUO6dsNykL/KwruTtgQVxTbT qKyPntpzBcD9+s+2jhz0Xk0+Ghz/p8r6ewx16y9nQ9FAvBYVP6Bi5ppvHhxgMXw1kK85 JYdSvM6K0go3Pj2XpE19ZjxK83D8Vzgqhucs7eqD/vgHPO8of4vyKfTBfK1y2XOz8lg/ EbjBwMq02EvDajB5AwMwTXOPOjL1eDbHAzHT501251/VLXK0+MZecurzO3i9Kee3C9fE r22QjXbtM4A7OQGvML5AoYu9GBpfjvZih9+bWYa+W3JOg+qx4/1fXSN7WTtuHxSLy+fA LFWQ== X-Gm-Message-State: ABy/qLb0C71OWZkCe1XTbO+wT7nTTtTxkXUDZCMpWaGYqStWuEGvJeCf tk4IOwp5TZTLZvzJZo5kDhY= X-Google-Smtp-Source: APBJJlE21D+lqUdbF1XyQw61O1QCMKCqlVfeo2Pa6AKQFnu4xBYGIfV6EZXRskomeAYGqg/ppamR2w== X-Received: by 2002:a05:6358:2817:b0:135:89d6:22e9 with SMTP id k23-20020a056358281700b0013589d622e9mr357992rwb.13.1690333089854; Tue, 25 Jul 2023 17:58:09 -0700 (PDT) Received: from bvanassche-glaptop2.roam.corp.google.com ([2601:642:4c05:4a8d:dbda:6b13:2798:9795]) by smtp.gmail.com with ESMTPSA id t10-20020a63954a000000b005634bd81331sm11090138pgn.72.2023.07.25.17.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 17:58:09 -0700 (PDT) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Jaegeuk Kim , Bart Van Assche , Damien Le Moal , Ming Lei , Chao Yu Subject: [PATCH v3 6/6] fs/f2fs: Disable zone write locking Date: Tue, 25 Jul 2023 17:57:30 -0700 Message-ID: <20230726005742.303865-7-bvanassche@acm.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230726005742.303865-1-bvanassche@acm.org> References: <20230726005742.303865-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Set the REQ_NO_ZONE_WRITE_LOCK flag to inform the block layer that F2FS allocates and submits zoned writes in LBA order per zone. Cc: Jaegeuk Kim Cc: Christoph Hellwig Cc: Damien Le Moal Cc: Ming Lei Signed-off-by: Bart Van Assche --- fs/f2fs/data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 5882afe71d82..6361553f4ab1 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -569,6 +569,7 @@ static void f2fs_submit_write_bio(struct f2fs_sb_info *sbi, struct bio *bio, } } + bio->bi_opf |= REQ_NO_ZONE_WRITE_LOCK; trace_f2fs_submit_write_bio(sbi->sb, type, bio); iostat_update_submit_ctx(bio, type); submit_bio(bio);