Received: from 004.mia.mailroute.net (004.mia.mailroute.net [199.89.3.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46AF1207A22; Fri, 7 Nov 2025 23:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.3.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762559680; cv=none; b=Tri0ARCQJFhYdLPE2n37fWtI8/wxguer2JDlZh0LdyrtwFXolCwm9+KIkOP21NCvimV7+3zn+PBsCF254FQZKHAI70zVu0hF6rBRtrlG583uG20YvKPu7Paelnz/Q1JOREXMItEaS0HSkZq5YYxZ7GV2ZbGbXghwYhMxrpMcoT8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762559680; c=relaxed/simple; bh=j911julNyNJ4HBrVumXet+jNZqdsIZ5yt+gKluHUqz0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Hi63ewNdUpBXGIcVhFvfsg72PPYbjzTZfBTF+2xH8rso4EANQLJPe6MdeD2eB6rr/iyMQ6KjeewxtjmzS9TzLR8/rpYXPaY8S3mYUBqCtI2ybjkH5yi3vrLU7aB7fAroHziEl/UqZG0VWQADDgmKozlgtKyeU86k/egv8RReRhk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=s5pU0pGd; arc=none smtp.client-ip=199.89.3.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="s5pU0pGd" Received: from localhost (localhost [127.0.0.1]) by 004.mia.mailroute.net (Postfix) with ESMTP id 4d3GBQ2hs8zm17wx; Fri, 7 Nov 2025 23:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1762559676; x=1765151677; bh=tJAXp PY/HtpCGG8Lr86BmNDq7ubFRk1NHm1quJVKWqA=; b=s5pU0pGdefTwwIHu4aFpa f7StPW2IZaSZlNbsX4GxSeY5y72jlBnZ45aw8Z/XABijpNe1WTcnHoZ7lGLPhPSL ZPASH1nE4JEAidOkV2KBK2L9wU0wRpETmFXQa+6lzx8X81mFfleAWv5bMc8fkC7h h9PfcckyLo7zHcFqB9LMWpBFHiVUuzSHtd11mqPlQ1NaUCwyyishUi8SKid5+ZGE a4gtDmfSVf3r4Ov4+/S7fa4Yld+vXbGWj4S9zEv3lJsJe7Rhq+NoTuDW6dN/VmOh LN+7JXt+1Bn7yW7iINthvnjTYPOXZ7fguGmqxOPyXYT5iXSTIJ9e9085klkJhrGD g== X-Virus-Scanned: by MailRoute Received: from 004.mia.mailroute.net ([127.0.0.1]) by localhost (004.mia [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 9AGO-SxKGxZF; Fri, 7 Nov 2025 23:54:36 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.180.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 004.mia.mailroute.net (Postfix) with ESMTPSA id 4d3GBH3Gc1zm17wV; Fri, 7 Nov 2025 23:54:30 +0000 (UTC) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, Christoph Hellwig , Damien Le Moal , Bart Van Assche , "Martin K. Petersen" , Ming Lei Subject: [PATCH v26 14/17] scsi: sd: Increase retry count for zoned writes Date: Fri, 7 Nov 2025 15:53:07 -0800 Message-ID: <20251107235310.2098676-15-bvanassche@acm.org> X-Mailer: git-send-email 2.51.2.1041.gc1ab5b90ca-goog In-Reply-To: <20251107235310.2098676-1-bvanassche@acm.org> References: <20251107235310.2098676-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable If the write order is preserved, increase the number of retries for write commands sent to a sequential zone to the maximum number of outstanding commands because in the worst case the number of times reordered zoned writes have to be retried is (number of outstanding writes per sequential zone) - 1. Cc: Damien Le Moal Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Ming Lei Signed-off-by: Bart Van Assche --- drivers/scsi/sd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 0252d3f6bed1..f94ce38131e5 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1409,6 +1409,12 @@ static blk_status_t sd_setup_read_write_cmnd(struc= t scsi_cmnd *cmd) cmd->transfersize =3D sdp->sector_size; cmd->underflow =3D nr_blocks << 9; cmd->allowed =3D sdkp->max_retries; + /* + * Increase the number of allowed retries for zoned writes if zoned + * write pipelining is enabled. + */ + if (blk_pipeline_zwr(rq->q) && blk_rq_is_seq_zoned_write(rq)) + cmd->allowed +=3D rq->q->nr_requests; cmd->sdb.length =3D nr_blocks * sdp->sector_size; =20 SCSI_LOG_HLQUEUE(1,