From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794226695; b=NX+otcGSTxWGiv2UaXkOGoXHO+MkmB05dkgJckr3An7Or0Uu+2sZHqR01IgBrMA8Y/Pp dLcjakZNdOPXOqsxuNqvjSzfwQYZeFSDI7mdsHN41lXyHiChGF/P04dTpWdQGO5cNLLr/ L4ssw0bnQXvII9ilDzpwTYVhvwLSpft0CEXjH74bb8B9+YtNCv7mr928rAfJhoT9JPp74 msAor41NLLIdKncsd+RYy7u9WXMwYo10peozN5qQ1qBLB5tWf1XvfpAkUcoujXTxVy1Ku gd3IYD9foswWIk7POg4eQptaIf9Yh/s0t0WgiRiVrovQTYcspWboyLtJ1kCyTpJBJcg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794226695; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Date:From:To:cc:Subject: In-Reply-To:Message-ID:References:MIME-Version:Content-Type: X-Scanned-By; bh=OBdiK9l8kFT4f0yo7evXfhDN4v7F5oYM4pE8DacBPJ8=; b=jgXXkJrOT/ZgpJ9V1RoVAsrQiA/e4kDv4GRacMMukXZewwD8mVo9tpemLutuCs0gyXqN CGWro2iBMw8gN+l3nGDJ0susj5k15kKBKptakG/B+HFsTIo8d+pUPk+R283ZAzSceh3fz B04RfqoU9I8y7Y2LMoF+V29a9hv7o/sOFXiKenHblhvRYdyhuMtMKN6UpF6hHTEvuWEQJ 8pdF0dCeJ5AmRqUfZbbOJYclIXC3MH76Ez9OvXcFBmxanC3qQ4bzZzJbSxqYdbXmdtVFx 6DJTwG46VlgPox9p4YTTO6gegd8BtAh0jGVF08t3FF2FE/oHF1Hew3oAYz151Gcxc2Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QUqnVNko; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F24DF606A31C for ; Mon, 9 Nov 2026 12:18:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F24DF606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QUqnVNko DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794226693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OBdiK9l8kFT4f0yo7evXfhDN4v7F5oYM4pE8DacBPJ8=; b=QUqnVNkoj/hEsfX/d7XUkrG5grDJAtqJiwpx70vdWbA/rPJrjov7X1HihBSMtOvr3aj9K1 ySwxtpYDSx0cvR2UmTKS0+wLIcEHVoKa1kdBNQxKLu9o7QCeezyJBUyAx2lLmmFg/Kg4Zi cl2znRKxrcu5F/wxBrg/Bncr0f77OQw= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-219-B2yFbfMxM02T4zTZ50vSbA-1; Mon, 09 Nov 2026 07:18:11 -0500 X-MC-Unique: B2yFbfMxM02T4zTZ50vSbA-1 X-Mimecast-MFC-AGG-ID: B2yFbfMxM02T4zTZ50vSbA_1794226690 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 12EC3180055F; Mon, 9 Nov 2026 12:18:10 +0000 (UTC) Received: from mpatocka-thinkpadx1carbongen12.rmtcz.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 23EDA18004F5; Mon, 9 Nov 2026 12:18:06 +0000 (UTC) Date: Mon, 9 Nov 2026 13:18:04 +0100 (CET) From: Mikulas Patocka To: Damien Le Moal cc: Josef Schlehofer , Alasdair Kergon , Mike Snitzer , Benjamin Marzinski , dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Ignat Korchagin , Milan Broz Subject: Re: [PATCH] dm-crypt: defer async write submission to write thread In-Reply-To: <0197be1d-1257-4597-aea2-1a065fe0a1d5@kernel.org> Message-ID: <4093292e-1fa1-dc18-b185-18dff61a32bf@redhat.com> References: <20261105072708.30722-1-pepe.schlehofer@gmail.com> <0197be1d-1257-4597-aea2-1a065fe0a1d5@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 On Mon, 9 Nov 2026, Damien Le Moal wrote: > On 11/5/26 16:27, Josef Schlehofer wrote: > > With no_write_workqueue, kcryptd_crypt_write_io_submit() submits the > > bio directly, even when called from kcryptd_async_done(). An async > > cipher may run this callback in softirq or with BH disabled, where > > submit_bio_noacct() must not be called because it can sleep. > > > > Submit inline only when async is false. Async completions are sent to > > the write thread, as is already done for submit_from_crypt_cpus. Use > > the async flag rather than in_interrupt(), since callback context > > depends on the cipher driver. Sync ciphers still submit inline. > > > > Tested with cryptd in QEMU (x86_64 and arm64) with > > CONFIG_DEBUG_ATOMIC_SLEEP, and on a P2020 running 6.18.55 without it. > > Originally, this was added to avoid write reordering for zoned block devices. > So did you test this change with that (scsi_debug or null-blk) ? You can also > use an emulated NVMe ZNS device in QEMU. So, should we disable asynchronous crypto operations for zoned devices? Would you send a patch for that? Mikulas