From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DCC71BC9ED for ; Thu, 31 Oct 2024 21:39:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730410788; cv=none; b=tjaPqQ/019ccdzp51IbqL3v9D5fgvUl7D4dhwyeHl0CqXyQZYRRqL7ZYjfqe/W3sVFkEMcjQbRuforc1PHCVHOEvrCWmhJzkkDjYP8pEm4gq5fHHrSR3kq67cGz6Azv62N6uZDhk4linHhs2lcBSpmmJx/+n4mJ94VI4AhAR6/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730410788; c=relaxed/simple; bh=T9ptpUKi/GgFxDwEi/KpwbTbn7ONdUyU7vHtJUkmZ40=; h=Content-Type:Message-ID:Date:MIME-Version:Subject:From:To:Cc: References:In-Reply-To; b=tIXWcMQC8FtH9jfz6IXVmiI4vkVNXpNGsjmejJJ30k6yfWFwPo+exNh6toBLl+pSFJzamo4URBamOO1nlZ2unVIYY0pknnenzzYBOmdk4u/flP8snYHRefkXwXr1mqI5oCCmGB8GyPRsegqoF7x2GfCfoUuDCJFJhtuc0AVjeRw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=ri0QhJYb; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="ri0QhJYb" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-71e467c3996so1102872b3a.2 for ; Thu, 31 Oct 2024 14:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1730410779; x=1731015579; darn=vger.kernel.org; h=in-reply-to:content-language:references:cc:to:from:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=SibRwC9Q8APdCGrqRSFxgwhEGWfR1A40Mc1oytjUE44=; b=ri0QhJYb8iudG882jH02huKUIyKsDdxvFSAP9HDGdg64Kk7cnmTxR4Gj4QkNOUfkOS +9gAQQLVdvPJfZaHXQC6aNaVo//udDaSZNFmGsQvJHy0vzo3QCU0Rbwoedg/yK8kv+B2 QzAYm8nkj/dMeR0NyDLEFnftQqMns+D0NDz9OgB1dsU79s6vZLTmqFL7ah0PkbUVaz23 rqmRTk+DXhWgRlfSk0rVbAWuRzc5iK7aGl6ayGWqjwJAXZkMykBkQK+faOEZ9YMovyQY 40mJeqHRwE76AZch0OeY5t0q+9FqtzQGoKnkj2/xTaxhidoUNTxh9LfbCsiZQVBbf1ti uudQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730410779; x=1731015579; h=in-reply-to:content-language:references:cc:to:from:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=SibRwC9Q8APdCGrqRSFxgwhEGWfR1A40Mc1oytjUE44=; b=Zg7bDuvK4+lfRqlu9of7Uv6CXuT/PX9ZH4BDkKHBNuVY98g55DXefJRZHgyCPX1T7f +IAUGchfRhrRvR0Dy/Kh+GVpHFJC0RTCizigAKzmMl8YRcM4e4Jsx5PlL97MtjaJKad5 zAVe+/jGDx9mU7HNCdlry251iLJ00wWc/XlxN1v4sxEdFBrdPE2zsEY4wIDRi8mF396J XMvCNEZJCdpAa0hb1+PzHWEYAr61BsX1W4ZlviUZ625YXLRg41IUwiwU8P9vRIUjlCzG eV2S3bpuCwYJGzdpb9EBg7HPgjjjgGL35TtDiZeo7LXdGLrfCC7Q8ai3B6gtKyLVsOUN //2A== X-Forwarded-Encrypted: i=1; AJvYcCXcZj6+JyeUFZ02F6FRxOkT7LFP4XUO//ughZ8bHHc6ir8W1eaHe+6IvQwCdHbPGMFFVDqxMApHtA==@vger.kernel.org X-Gm-Message-State: AOJu0YyTwOUhQa2PIHIo+97ivJ0T9QUEHMhAtsnF/ZI8GbY7AA2Mq26j t/2Gekk/CJEbbuT9KtM6U8hqfya0sQwhOOgqxQXYmqX3dZsfh1KcRWuDuxJ6GY8= X-Google-Smtp-Source: AGHT+IH0uRw7BhAPTs/c1hqwbWUGx9brNc12jGX9vuLZ5XxK/fr+OtvXj78iKECENk7TBKahh527ag== X-Received: by 2002:a05:6a20:4389:b0:1d8:a3ab:720b with SMTP id adf61e73a8af0-1d9a83aeab7mr28176617637.9.1730410778904; Thu, 31 Oct 2024 14:39:38 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc1e5e11sm1573414b3a.50.2024.10.31.14.39.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Oct 2024 14:39:38 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------lj28icUtkEZSz0XGnC7gEiG4" Message-ID: <6a1978e5-50e4-4591-aecc-4e7191034a9e@kernel.dk> Date: Thu, 31 Oct 2024 15:39:37 -0600 Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V8 4/7] io_uring: support SQE group From: Jens Axboe To: Ming Lei , io-uring@vger.kernel.org, Pavel Begunkov Cc: linux-block@vger.kernel.org, Uday Shankar , Akilesh Kailash , Kevin Wolf References: <20241025122247.3709133-1-ming.lei@redhat.com> <20241025122247.3709133-5-ming.lei@redhat.com> <5d99696d-bc46-421c-b8df-c64dda483215@kernel.dk> Content-Language: en-US In-Reply-To: <5d99696d-bc46-421c-b8df-c64dda483215@kernel.dk> This is a multi-part message in MIME format. --------------lj28icUtkEZSz0XGnC7gEiG4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 10/31/24 3:24 PM, Jens Axboe wrote: > On 10/25/24 6:22 AM, Ming Lei wrote: >> SQE group is defined as one chain of SQEs starting with the first SQE that >> has IOSQE_SQE_GROUP set, and ending with the first subsequent SQE that >> doesn't have it set, and it is similar with chain of linked SQEs. >> >> Not like linked SQEs, each sqe is issued after the previous one is >> completed. All SQEs in one group can be submitted in parallel. To simplify >> the implementation from beginning, all members are queued after the leader >> is completed, however, this way may be changed and leader and members may >> be issued concurrently in future. >> >> The 1st SQE is group leader, and the other SQEs are group member. The whole >> group share single IOSQE_IO_LINK and IOSQE_IO_DRAIN from group leader, and >> the two flags can't be set for group members. For the sake of >> simplicity, IORING_OP_LINK_TIMEOUT is disallowed for SQE group now. >> >> When the group is in one link chain, this group isn't submitted until the >> previous SQE or group is completed. And the following SQE or group can't >> be started if this group isn't completed. Failure from any group member will >> fail the group leader, then the link chain can be terminated. >> >> When IOSQE_IO_DRAIN is set for group leader, all requests in this group and >> previous requests submitted are drained. Given IOSQE_IO_DRAIN can be set for >> group leader only, we respect IO_DRAIN by always completing group leader as >> the last one in the group. Meantime it is natural to post leader's CQE >> as the last one from application viewpoint. >> >> Working together with IOSQE_IO_LINK, SQE group provides flexible way to >> support N:M dependency, such as: >> >> - group A is chained with group B together >> - group A has N SQEs >> - group B has M SQEs >> >> then M SQEs in group B depend on N SQEs in group A. >> >> N:M dependency can support some interesting use cases in efficient way: >> >> 1) read from multiple files, then write the read data into single file >> >> 2) read from single file, and write the read data into multiple files >> >> 3) write same data into multiple files, and read data from multiple files and >> compare if correct data is written >> >> Also IOSQE_SQE_GROUP takes the last bit in sqe->flags, but we still can >> extend sqe->flags with io_uring context flag, such as use __pad3 for >> non-uring_cmd OPs and part of uring_cmd_flags for uring_cmd OP. > > Did you run the liburing tests with this? I rebased it on top of the > flags2 patch I just sent out, and it fails defer-taskrun and crashes > link_drain. Don't know if others fail too. I'll try the original one > too, but nothing between those two should make a difference. It passes > just fine with just the flags2 patch, so I'm a bit suspicious this patch > is the issue. False alarm, it was my messup adding the group flag. Works just fine. I'm attaching the version I tested, on top of that flags2 patch. Since we're on the topic - my original bundle patch used a bundle OP to define an sqe grouping, which didn't need to use an sqe flag. Any particular reason why you went with a flag for this one? I do think it comes out nicer with a flag for certain things, like being able to link groups. Maybe that's the primary reason. -- Jens Axboe --------------lj28icUtkEZSz0XGnC7gEiG4 Content-Type: text/x-patch; charset=UTF-8; name="0001-io_uring-support-SQE-group.patch" Content-Disposition: attachment; filename="0001-io_uring-support-SQE-group.patch" Content-Transfer-Encoding: base64 RnJvbSAyYjAzMWVmNDJiYzkyOWZjNWMzNWRkZjcwZGUzYTRhNjE0ODhmYzUwIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBNaW5nIExlaSA8bWluZy5sZWlAcmVkaGF0LmNvbT4K RGF0ZTogRnJpLCAyNSBPY3QgMjAyNCAyMDoyMjo0MSArMDgwMApTdWJqZWN0OiBbUEFUQ0hd IGlvX3VyaW5nOiBzdXBwb3J0IFNRRSBncm91cAoKU1FFIGdyb3VwIGlzIGRlZmluZWQgYXMg b25lIGNoYWluIG9mIFNRRXMgc3RhcnRpbmcgd2l0aCB0aGUgZmlyc3QgU1FFIHRoYXQKaGFz IElPU1FFX1NRRV9HUk9VUCBzZXQsIGFuZCBlbmRpbmcgd2l0aCB0aGUgZmlyc3Qgc3Vic2Vx dWVudCBTUUUgdGhhdApkb2Vzbid0IGh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