From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 54F70244685 for ; Fri, 20 Feb 2026 16:31:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771605089; cv=none; b=I3YL5ErKnFASmK74nS1cO4aRhxD8s7F67bjUJohzJriq0mzTpDU/N3Fo/LTHSXR4tm/v24ue8s4qvEUkFUDgHGmz6ExdHQHzqtvtpJfNUqxvO+eXRQ1sgF9gZl4xShUsLWiiyo1nqXMDB/d1THLpaNqXY3tOqHGbGRlmHqsnHRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771605089; c=relaxed/simple; bh=YxDRaeeSLSdu7+sAUz7C/LuukrlES9g+G1P1UGQiAbA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VJrL3rs8/ZEv66o700E3khdzj9nQkwOJxyNGi3GeeMLbn9+egdLMQOsK2jJD0prxvn7LD2AKX4n+Y+0/AVyXFSM4XH5CCnqs3CzWEg74kQtG1p36Zgz+mTbuHvZ4y5pQZZDPKGOKkgb1bxK+/D3Y0R2swcxz+yWAQATOZkeVG9E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=eRZu8a+Q; arc=none smtp.client-ip=170.10.129.124 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.b="eRZu8a+Q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771605087; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M8/OVHwRsfHW8M5wsM6NVhU4lqLzcoc5jo8xC3NZ8ZA=; b=eRZu8a+QlgIkyAboCUvUPBuoZctxCd6MOguQQ52NjgFJbAcCA+osr0UXOqosmeSrnQK3FB DsdXXZCvFvhog7Ml5LSOlC+jatKxDPRbIwIvbvk0+GroaP2fVlBlXohApjA78KJz09ruXB 2nh5zXLqf1hWITp1O+6BzbDbJa+cvQo= 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-235-_cunhcL-P5ujd4hiEGDiRQ-1; Fri, 20 Feb 2026 11:31:22 -0500 X-MC-Unique: _cunhcL-P5ujd4hiEGDiRQ-1 X-Mimecast-MFC-AGG-ID: _cunhcL-P5ujd4hiEGDiRQ_1771605080 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 D0489180049D; Fri, 20 Feb 2026 16:31:19 +0000 (UTC) Received: from fedora (unknown [10.72.116.11]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F28E81800672; Fri, 20 Feb 2026 16:31:12 +0000 (UTC) Date: Sat, 21 Feb 2026 00:31:07 +0800 From: Ming Lei To: Caleb Sander Mateos Cc: Jens Axboe , Christoph Hellwig , Keith Busch , Sagi Grimberg , io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Anuj gupta , Kanchan Joshi Subject: Re: [PATCH v3 0/4] io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL Message-ID: References: <20260219172228.429479-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 On Fri, Feb 20, 2026 at 08:22:29AM -0800, Caleb Sander Mateos wrote: > On Fri, Feb 20, 2026 at 8:11 AM Ming Lei wrote: > > > > On Fri, Feb 20, 2026 at 07:55:33AM -0800, Caleb Sander Mateos wrote: > > > On Fri, Feb 20, 2026 at 6:25 AM Ming Lei wrote: > > > > > > > > On Thu, Feb 19, 2026 at 10:22:23AM -0700, Caleb Sander Mateos wrote: > > > > > Currently, creating an io_uring with IORING_SETUP_IOPOLL requires all > > > > > requests issued to it to support iopoll. This prevents, for example, > > > > > using ublk zero-copy together with IORING_SETUP_IOPOLL, as ublk > > > > > zero-copy buffer registrations are performed using a uring_cmd. There's > > > > > no technical reason why these non-iopoll uring_cmds can't be supported. > > > > > They will either complete synchronously or via an external mechanism > > > > > that calls io_uring_cmd_done(), so they don't need to be polled. > > > > > > > > For sync uring command, it is fine to support for IOPOLL. > > > > > > > > However, there are async uring command, which may be completed in irq > > > > context, or in multishot way, at least the later isn't supported in > > > > io_do_iopoll() yet. > > > > > > Can you describe the issues you envision in more detail? > > > > Basically IOPOLL doesn't support multishot request yet. > > > > For example, when io_uring_mshot_cmd_post_cqe() is called and new cqe is > > queued, it can't be found from io_iopoll_check()<-io_uring_enter(IORING_ENTER_GETEVENTS). > > I don't think that's a new issue, though. You're right that > io_uring_mshot_cmd_post_cqe() assumes a non-REQ_F_IOPOLL request, so > it's up to the ->uring_cmd() implementation to ensure that (which ublk > already does). Since ublk's struct file_operations don't provide > ->uring_cmd_iopoll(), any ublk uring_cmds issued to an > IORING_SETUP_IOPOLL io_uring won't have REQ_F_IOPOLL set, so > io_uring_mshot_cmd_post_cqe() should work just fine. Please look in the following way: 1) without patch of `io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL`, multishot command submission can't succeed 2) with patch of "io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL", people may see hang forever in io_uring_enter() if multishot command is submitted in context IORING_SETUP_IOPOLL. Thanks, Ming