Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2435098rwl; Sat, 1 Apr 2023 07:44:07 -0700 (PDT) X-Google-Smtp-Source: AKy350YujfY4EMjHdASgxaM/zt2yOfVzyshlEZGBvtdjV+1Jyv8jfO+8uop3Zz/UBYw0eVuWs5DM X-Received: by 2002:a17:906:1502:b0:93d:e6c8:ed5e with SMTP id b2-20020a170906150200b0093de6c8ed5emr12346253ejd.20.1680360247442; Sat, 01 Apr 2023 07:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680360247; cv=none; d=google.com; s=arc-20160816; b=HFzFQn7Dw6VO+VC9OrQxxjP6G+sdRpS4eYea7JPXpSxKQfdulLvaT//IaaKDNiEmtW E8FkXLKR22sIF4vlb7hA1USaIDTLijdioyP1B0uG5l/eO8bNSgtxHXKV9qsc/ExEc+P0 HzB5PQcyIQB4z3iGdtokX4c6R5fPDPTBZtcx5yHn940RAGO9woyaf1cezpkmoQ1ZfP6/ EZx5a5l91O8lYtzlH/IK07QqYBKFC0jw5kN8crBJzy7URINK68YpwN62oNZF40lObfB6 7Rn6Ve7Aj21V7zjRgweFXsOoXVC8Nq4/WVYgCRbN5mO0riWMZCpPYcwquBbZnyamH0Jg HOkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HV6/OHVclbGiO335z21XsKMkjGpi6QM03ig/0pOY3VQ=; b=gLf97Or4bROjHsKL3IzDcVxida7Ln8ev6AjwGib3N2IhMjYs26KypzGoUOJKeDjBBL 5qEiq4WyO+vBnmuPS4Z08VMPiWIf6h3m8EYJBvmvxtHTc4817IK4Q7+KVY2pDSWvms7j d4ol+CQr2mCV/r7hIZT3d9rhGkgF/jbFWl1f/7SMwMoyJElYQqj4o89R1clvnUEZgVoc NZJgKrZ1a2+VPs6yAVskAOzasMOItDyb5lyF2mpx5Tp84aTK6lKaKjbf/ufPKhxLOcBo rM8ELWQPpblC6wal/V2Nn+Me+ZZbiIlk9mNlPgrRj7wgYAcDYA7Cwx+8TWrRUPL0z8Ze bGKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M8y23xUL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a17090685c600b009309c8ea649si530086ejy.55.2023.04.01.07.43.42; Sat, 01 Apr 2023 07:44:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M8y23xUL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230112AbjDAOg4 (ORCPT + 99 others); Sat, 1 Apr 2023 10:36:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjDAOg4 (ORCPT ); Sat, 1 Apr 2023 10:36:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98A82CA0B for ; Sat, 1 Apr 2023 07:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680359764; 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=HV6/OHVclbGiO335z21XsKMkjGpi6QM03ig/0pOY3VQ=; b=M8y23xULVWzqS82mAn8pJcazqhkDvGm2jl9oehA7d4OInWoTVZNLGL5gP9itYFN9FTqelp g5/wOtWepDXIeD0wcTAyiK9Uko5G8msL1xWkN6TEB25B90b6cCgS/ZBq4bK+sruhEcrscL be7l594zljG8ub2fsNjElqKQrx1klzY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-639-FZbD6ekWNoGRjMLDkTehCQ-1; Sat, 01 Apr 2023 10:36:01 -0400 X-MC-Unique: FZbD6ekWNoGRjMLDkTehCQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8B57B85A5A3; Sat, 1 Apr 2023 14:36:00 +0000 (UTC) Received: from ovpn-8-19.pek2.redhat.com (ovpn-8-19.pek2.redhat.com [10.72.8.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C78054020C82; Sat, 1 Apr 2023 14:35:52 +0000 (UTC) Date: Sat, 1 Apr 2023 22:35:47 +0800 From: Ming Lei To: Jens Axboe , io-uring@vger.kernel.org, linux-block@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Miklos Szeredi , ZiyangZhang , Xiaoguang Wang , Bernd Schubert , Pavel Begunkov , Stefan Hajnoczi , Dan Williams , ming.lei@redhat.com Subject: Re: [PATCH V6 03/17] io_uring: add generic IORING_OP_FUSED_CMD Message-ID: References: <20230330113630.1388860-1-ming.lei@redhat.com> <20230330113630.1388860-4-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230330113630.1388860-4-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 30, 2023 at 07:36:16PM +0800, Ming Lei wrote: > Multiple requests submitted as one whole request logically, and the 1st one > is primary command(IORING_OP_FUSED_CMD), and the others are secondary > requests, which number can be retrieved from primary SQE. > > Primary command is responsible for providing resources and submitting > secondary requests, which depends on primary command's resources, and > primary command won't be completed until all secondary requests are done. > > The provided resource has same lifetime with primary command, and it > lifetime won't cross multiple OPs, and this way provides safe way for > secondary OPs to use the resource. > > Add generic IORING_OP_FUSED_CMD for modeling this primary/secondary > relationship among requests. BTW, this model also solves 1:N dependency problem of io_uring. Current io_uring can't handle this kind of dependency(1:N) efficiently, and simply convert it into one linked list: - N requests(1~n) depends on one request(0), and there isn't dependency among these N requests - current io_uring converts the dependency to linked list of (N + 1) requests (0, 1, ...., n), in which all requests are just issued one by one from 0 to n, inefficiently The primary/secondary model solves it by issuing request 0 first, then issues all other N requests concurrently. Thanks, Ming