From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 C4E92315D4E for ; Thu, 30 Oct 2025 17:42:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846168; cv=none; b=rTGPsLr0jqxneNQ7eBo6eJci6NiRqWnklZ8MVeHOQmrgjYiQhcGueRUHo1rpkwnQkm+foit6k2pJVMm5/tGRVgn28yr6K6XwdTtJjiIJfNOy8ysJJf4NIDfMxQnJE4nMbBfjBGHks69hpYolYu9ddLDQETHmBBcdVTm8VjxG9vU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761846168; c=relaxed/simple; bh=b1POjuns61tfvPvDtbqhXxCP3k6/ikC6HAP/XOZbGzE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pNolz0zITCuhH/tTwFhl7ziyZMAlN1/ODM4gfcjYbZwcLhIw4zONkBCwa10Z0Xxk4uPA52WWsTKKSTeikEFfpHzQ1rQ6teMUsoKvXKFqzLg+kH3YNZqcjCpy+zFtd5rZyjCvdMZdWmtJBJULKgvlwR6yTod/9QteV6mOdzmRlb8= 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=EBZw2Dsq; arc=none smtp.client-ip=209.85.128.46 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="EBZw2Dsq" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-475dbb524e4so8625595e9.2 for ; Thu, 30 Oct 2025 10:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761846165; x=1762450965; darn=vger.kernel.org; h=content-transfer-encoding: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=FYfzDRGnnPlhr93W60j8zTUhCMGw1L+Yzwlr2e0Jw3s=; b=EBZw2DsqQj1Imt6n7CY0ZfuBSSij4+LJSuMCDgoELWGEJ/HTzaWmA5/kjdHVtBtw0p 6OHhe8VLUdmEoBRgh5mR3NzXQw49eT77a5IplHqdFI5LlwEJXQnSi9H+QAq3pV8cjNtJ ddia7WS6z067axa4iukqH/C3J9v7qeEn1omtjIsz5bppSdNPX7pJgSTLHM0ssNxkt6IO 3u0tZ5jg86huXFlhSBEbXo/V+8x9KUhqma7yvL/z0Yf3Hs7e3+nnQQjxRejX/rY3yfbi 1YkYw6bevF8WfQQiqu5yLl4n5wknaXeeKXR4/va4li4nqnPA9gD1dJVyf5BwJCx+ClJg tpPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761846165; x=1762450965; h=content-transfer-encoding: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=FYfzDRGnnPlhr93W60j8zTUhCMGw1L+Yzwlr2e0Jw3s=; b=G15tWqbCfPX1nA7uoCQoRN3cIVZPBM9GjzBzay0RZTt2GFscTHI7/Zvow/KYemm3GO +OoW2yW8TzKx+k4V700r2waNTqIS+ApPulSLU1zfKUgbKQYp6WUWtDoqToIHY1e7Hf7H wciIhT+Kl5ho7PBfhz0xUDSa+Wd9nCiE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:b0:46f:aac5:daf with SMTP id 5b1f17b1804b1-477308dbefdmr6098625e9.35.1761846164760; Thu, 30 Oct 2025 10:42:44 -0700 (PDT) Received: from ?IPV6:2a01:4b00:bd21:4f00:7cc6:d3ca:494:116c? ([2a01:4b00:bd21:4f00:7cc6:d3ca:494:116c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952db99asm33502479f8f.32.2025.10.30.10.42.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Oct 2025 10:42:44 -0700 (PDT) Message-ID: Date: Thu, 30 Oct 2025 17:42:41 +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: [PATCH v2 1/8] io_uring/uring_cmd: add io_uring_cmd_import_fixed_full() To: Bernd Schubert , Joanne Koong Cc: "miklos@szeredi.hu" , "axboe@kernel.dk" , "linux-fsdevel@vger.kernel.org" , "io-uring@vger.kernel.org" , "xiaobing.li@samsung.com" , "csander@purestorage.com" , "kernel-team@meta.com" References: <20251027222808.2332692-1-joannelkoong@gmail.com> <20251027222808.2332692-2-joannelkoong@gmail.com> <455fe1cb-bff1-4716-add7-cc4edecc98d2@gmail.com> <3bddaa1e-b4a0-4f0a-8b30-05a2cb8fd1fd@ddn.com> Content-Language: en-US From: Pavel Begunkov In-Reply-To: <3bddaa1e-b4a0-4f0a-8b30-05a2cb8fd1fd@ddn.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 10/29/25 19:59, Bernd Schubert wrote: > On 10/29/25 19:37, Joanne Koong wrote: >> On Wed, Oct 29, 2025 at 7:01 AM Pavel Begunkov wrote: >>> >>> On 10/27/25 22:28, Joanne Koong wrote: >>>> Add an API for fetching the registered buffer associated with a >>>> io_uring cmd. This is useful for callers who need access to the buffer >>>> but do not have prior knowledge of the buffer's user address or length. >>> >>> Joanne, is it needed because you don't want to pass {offset,size} >>> via fuse uapi? It's often more convenient to allocate and register >>> one large buffer and let requests to use subchunks. Shouldn't be >>> different for performance, but e.g. if you try to overlay it onto >>> huge pages it'll be severely overaccounted. >>> >> >> Hi Pavel, >> >> Yes, I was thinking this would be a simpler interface than the >> userspace caller having to pass in the uaddr and size on every >> request. Right now the way it is structured is that userspace >> allocates a buffer per request, then registers all those buffers. On >> the kernel side when it fetches the buffer, it'll always fetch the >> whole buffer (eg offset is 0 and size is the full size). >> >> Do you think it is better to allocate one large buffer and have the >> requests use subchunks? My worry with this is that it would lead to >> suboptimal cache locality when servers offload handling requests to >> separate thread workers. From a code perspective it seems a bit >> simpler to have each request have its own buffer, but it wouldn't be >> much more complicated to have it all be part of one large buffer. > > I don't think it would be a huge issue to let userspace allocate a large > buffer and to distribute it among requests - there is nothing in the > kernel side to be done for that? You can, but unless I missed something with this patchset you'd need to register it N times, which is not terrible but have memory overaccounting problems and feels less flexible. > (I think I had even done that for the 1st io-uring patches and removed > it because there were other issues and I wanted to keep the initial code > simple). -- Pavel Begunkov