From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 2265E1E0DBB; Wed, 13 Nov 2024 13:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731505359; cv=none; b=anlP6jUzmHaxxVGf1nV71eHvUukQtrKKjXWOhm0+HF0jBncaZ60Su11gZM+nS24+OUL+AilToS4+Y5vJZfsHJ/ZHJ6XlpzcdbQRZhsrOh/aXarbqN7Qp6q0GcGMh0KQ3zWl3/CtVHywTsWJEdpRoLQ7vgij5IYXp0kIvfbl/eG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731505359; c=relaxed/simple; bh=ZHO3TW8UuP/0k2HV/m0/53ox9/+jzGlBqqnXmSGJvtI=; h=Content-Type:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To; b=nkXJFFzkZquxXozzgyT6P/SbuUu8VV8ktaz1Oezmv6T5hgL3RY15VYaDNC7NKt7DNSwoyn1k8zdqAZHMEyOM/U52Gq61Gp4moobl1Gn8y/PBrx8iq6L1Q2xbEBBmagtLVpyjBQX6N3kyFyuw4xKev9NNddWMXHQyNEj+2x79B74= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LsRt+HSd; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LsRt+HSd" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5cf6f7ee970so667011a12.3; Wed, 13 Nov 2024 05:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731505355; x=1732110155; darn=vger.kernel.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Lcx7iIFB0kI/xOgdylVqxZSeRdMB0IY7wD+28otgglI=; b=LsRt+HSdM7Zpb8ZvRt3ATZqq4oBLnh0phNN4COeZ5orp9Y0UbQGgC3NLMHeBK6WH8I ih9Cg5uIYSrDnLyeKLegiPSVpVy0w/aCuOSPswV4UtUdUoXa3GT4+Ekc0JzZrTzmdHht r6AjZsX8yhcUeqQjzUS7fykWMKgHGRywFid4PUV/6sN9PBYVOBAfNNxQkUonoeBSsJ52 ogSVcEwFOV/xMdQWgFXxJx+mzCNMsG8QjT2wEFr+cCdTODDc/VeWDEzvgRd2azdEW5C6 zCKZJh0BcTKu1USpX4BuqRofMohKUa42uYzrig+dy/ReZOkvpuitNchXetcawtL09QJt Te9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731505355; x=1732110155; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Lcx7iIFB0kI/xOgdylVqxZSeRdMB0IY7wD+28otgglI=; b=TFHDp7py7rlHNJWpkztarDu7XDsaPxEGT3uXH4KpcWvA3pd7bEsr6b+W0h9bdYjY26 DVLAQDOQwaBmsOrBtDItnyS5R4yOIwo5vkcP1dlPF5NKEZhJ74cdRaXq4QDBuUNu3nYZ r1is8ygE7Soq1Bfv+tNFQTB1U9Ycix60m8KgYjyq4DBWYY4Y5BAwFvPywbS8Zorkk06a 13/PVL1PjX7Z/XbSNA+RxNnmTbLi5QyjIswxq5h2bUSkx3TcJvlnDMvDzC9H5pX2Earc t7NcKE8ADLf+BIoAy0+Gp6pr+2nxwlcsJYa3q9daULmqXDekPcvF5Z3TxsB1cjt0Vfh9 4LhQ== X-Forwarded-Encrypted: i=1; AJvYcCW+hmzZSlXs7d8uZKYClRJPOdzhLLXkVIGN69C8T67v/SCc/6b7Rh8spScdT/ZYmeduK1osVl1e3lzjZg==@vger.kernel.org X-Gm-Message-State: AOJu0YyNBOCX+Uqs79MveURkPJFV8ebDXTtEQX842Uc3KS7to7yGKqOY 5WHddvh9h4ggkytIyjIj/p+txjDtt2JKbuRDXoJUyief3S5MOSCO X-Google-Smtp-Source: AGHT+IGu36OgIURULdZzSRFpH9EWz3Y4e1u00mjdb4cOs7Nr0xzsTSyE6ad0kjfsmnR4FyEn+8tH1g== X-Received: by 2002:a05:6402:42c6:b0:5c4:24c2:43e0 with SMTP id 4fb4d7f45d1cf-5cf4f351c7bmr5869126a12.13.1731505355005; Wed, 13 Nov 2024 05:42:35 -0800 (PST) Received: from [192.168.42.17] ([163.114.131.193]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cf03c4edd8sm7207696a12.71.2024.11.13.05.42.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Nov 2024 05:42:34 -0800 (PST) Content-Type: multipart/mixed; boundary="------------q0liBxCIfPPClYaelhI7qduZ" Message-ID: Date: Wed, 13 Nov 2024 13:43:23 +0000 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: (subset) [PATCH V10 0/12] io_uring: support group buffer & ublk zc To: Ming Lei , Jens Axboe Cc: io-uring@vger.kernel.org, linux-block@vger.kernel.org, Uday Shankar , Akilesh Kailash References: <20241107110149.890530-1-ming.lei@redhat.com> <173101830487.993487.13218873496602462534.b4-ty@kernel.dk> Content-Language: en-US From: Pavel Begunkov In-Reply-To: This is a multi-part message in MIME format. --------------q0liBxCIfPPClYaelhI7qduZ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/12/24 00:53, Ming Lei wrote: > On Thu, Nov 07, 2024 at 03:25:59PM -0700, Jens Axboe wrote: >> On 11/7/24 3:25 PM, Jens Axboe wrote: ... > Hi Jens, > > Any comment on the rest of the series? Ming, it's dragging on because it's over complicated. I very much want it to get to some conclusion, get it merged and move on, and I strongly believe Jens shares the sentiment on getting the thing done. Please, take the patches attached, adjust them to your needs and put ublk on top. Or tell if there is a strong reason why it doesn't work. The implementation is very simple and doesn't need almost anything from io_uring, it's low risk and we can merge in no time. If you can't cache the allocation in ublk, io_uring can add a cache. If ublk needs more space and cannot embed the structure, we can add a "private" pointer into io_mapped_ubuf. If it needs to check the IO direction, we can add that as well (though I have doubts you really need it, read-only might makes sense, write-only not so much). We'll also merge Jens' patch allowing to remove a buffer with a request. -- Pavel Begunkov --------------q0liBxCIfPPClYaelhI7qduZ Content-Type: text/x-patch; charset=UTF-8; name="io_uring-leased-buffers.patch" Content-Disposition: attachment; filename="io_uring-leased-buffers.patch" Content-Transfer-Encoding: base64 RnJvbSA3OGE5YzhhM2I5ZDU5ZTc0NjVkNmMxNTgyODNhNTMxYTIyMWZhM2IyIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpEYXRlOiBUdWUsIDEyIE5vdiAyMDI0IDIyOjU4OjE4ICswMDAw ClN1YmplY3Q6IFtQQVRDSCAxLzRdIGlvX3VyaW5nOiBleHBvcnQgaW9fbWFwcGVkX3VidWYg ZGVmaW5pdGlvbgoKLS0tCiBpbmNsdWRlL2xpbnV4L2lvX3VyaW5nL2tidWYuaCB8IDE5ICsr KysrKysrKysrKysrKysrKysKIGlvX3VyaW5nL3JzcmMuaCAgICAgICAgICAgICAgIHwgMTIg KystLS0tLS0tLS0tCiAyIGZpbGVzI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R4LCBJ T1JJTkdfUlNSQ19CVUZGRVIpOworCWlmICghbm9kZSkKKwkJcmV0dXJuIC1FTk9NRU07CisJ bm9kZS0+YnVmID0gYnVmOworCWlvX3Jlc2V0X3JzcmNfbm9kZShjdHgsICZjdHgtPmJ1Zl90 YWJsZSwgaWR4KTsKKwljdHgtPmJ1Zl90YWJsZS5ub2Rlc1tpZHhdID0gbm9kZTsKKwlyZXR1 cm4gMDsKK30KKworaW50IGlvdV9leHBvcnRfa2J1ZihzdHJ1Y3QgaW9fcmluZ19jdHggKmN0 eCwgdW5zaWduZWQgaXNzdWVfZmxhZ3MsCisJCSAgICBzdHJ1Y3QgaW9fbWFwcGVkX3VidWYg KmJ1ZiwgdW5zaWduZWQgaWR4KQoreworCWludCByZXQ7CisKKwlpb19yaW5nX3N1Ym1pdF9s b2NrKGN0eCwgaXNzdWVfZmxhZ3MpOworCXJldCA9IF9faW91X2V4cG9ydF9rYnVmKGN0eCwg aXNzdWVfZmxhZ3MsIGJ1ZiwgaWR4KTsKKwlpb19yaW5nX3N1Ym1pdF91bmxvY2soY3R4LCBp c3N1ZV9mbGFncyk7CisJcmV0dXJuIHJldDsKK30KKwogaW50IGlvX3NxZV9idWZmZXJzX3Jl Z2lzdGVyKHN0cnVjdCBpb19yaW5nX2N0eCAqY3R4LCB2b2lkIF9fdXNlciAqYXJnLAogCQkJ ICAgIHVuc2lnbmVkIGludCBucl9hcmdzLCB1NjQgX191c2VyICp0YWdzKQogewotLSAKMi40 Ni4wCg== --------------q0liBxCIfPPClYaelhI7qduZ Content-Type: text/x-csrc; charset=UTF-8; name="leased-buffer-test.c" Content-Disposition: attachment; filename="leased-buffer-test.c" Content-Transfer-Encoding: base64 I2luY2x1ZGUgPGVycm5vLmg+CiNpbmNsdWRlIDxzdGRpby5oPgojaW5jbHVkZSA8dW5pc3Rk Lmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgojaW5jbHVkZSA8 ZmNudGw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