From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (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 DE65122A80E for ; Fri, 16 May 2025 07:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747382330; cv=none; b=Sh2h4D423giOX5MYhywxRYaxXpWFs/tPuxfh6TWTdnQHRhXqDDmDimN4lPqeUmceTZhabI18h9p4kjb8fx5M+1OSoergzgokJmTmcFMdH4jDpZ7kx39y5rTvvUirs88MPoOm/xkJIKRv6uog9suiUEk6NQyhX7tY/QiXaI5bgFE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747382330; c=relaxed/simple; bh=YmL2D7Er6F7l3Q5ukzLK6B5Pg9nF74OFkgOHhmlQ2Sc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=JQWsLKobybQE8kCWqC+2/fWHClJ3vXjB3I3UfoVU8Ckf7jS5jNs5kmZoH7Rn6lNDzbdagppvfRmuHrcpfvdSPjp5Q+Jnq8Bl1AAz+dpB6INSIqjYG9H5/OoV3PFj8Q9PmnKEG+MNEZd3lzZnehTyEHwEd7TmxSHvH1AOE+NnWVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=szeredi.hu; spf=pass smtp.mailfrom=szeredi.hu; dkim=pass (1024-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b=jPj6Vsj5; arc=none smtp.client-ip=209.85.166.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=szeredi.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=szeredi.hu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="jPj6Vsj5" Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-85b3f92c8f8so171746939f.1 for ; Fri, 16 May 2025 00:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; t=1747382327; x=1747987127; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PFVgKp/dY3dqAEkCj0mC8AvL3gLOkml9a9KsWgEYU4M=; b=jPj6Vsj5yPhkU/FCs17rYu/65y9grkaiFt6XihazHkHzWRLoqjgIy5BujQ3ewLI9J1 QVMHHo4FmjBcGbzRODEhkgSlvQAljslAdhEqY1fT8HuBimCvxB8sgy2bkirzTFIjQoPJ QPkVRNPiDvmLh6oc7ow2DpI9HobEwcVoxNxdg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747382327; x=1747987127; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PFVgKp/dY3dqAEkCj0mC8AvL3gLOkml9a9KsWgEYU4M=; b=EF34h8wbwv1kSwLZs0A94TdAYFkmNWiOuck0epLwidOW8seT7ftdIk/B7daQWi+2oi U8PWjXjgVytW3WmL0N1qkCTL63cQaF1qElaLrDkLcaQrJtOgyK3r/yGCZ3Fm9wkXIqQB sXfc0UuMd3JV7KkMfdzLA2faMN8qXelagTGRlL69WCVMCi/z6pPxGRcFoTF7zunOeNM0 KZVS8tYwtsQ/YJOeeDq7L2iIbXVnGgQUPIaOKFqkiYPpDlJFOqKNiqv6awh64A1pOk3i Kh2CuPTWVCORbIhvjA6Jgdjz03m0Qz/SE1o7lWvHFD+rh/tqJDJrFqdnUr80P2tFzX7t w14A== X-Gm-Message-State: AOJu0YxxLKkbGDwD9FfoKWXRgsgzaPOJAHW5OETS0JDpiYBf385FjNwg FCA0b+UKg/u8DmuZRRB3KnyWR9T9g8ahXHR+KDJQMsib7OizgSo0tDDwuJ/c5kwan1xjAJX22nF vMy+aUhGQj+Vxv8WIeqECNQ9sqqVsBUvzxqxemUXlUVXpG6QZ5EqAqqU= X-Gm-Gg: ASbGncvneQuCGm+QaYiv1wn/RUb/JOx5g74JhqOpgxHjebKvdpzkl6PXXn3fqZ1qDRn BLnxu76XdovnjVtYXcVHci793EvAKfbglJV19LmRnpLa/ddJYk3Lf/eFa1k3udeRFXgBwRChbKq wGBgICxtI0a7TpUJGujgxfuVlin+yA6hn/btlJmMgkQg== X-Google-Smtp-Source: AGHT+IHYaMsPHgZcS2lfeLI0VKjgKHJ5XwjuFmQi2Cu4otbSVP2MF21iP69mMCCz+Ld5fFykaU3Uo87nHAp9lEa2nGk= X-Received: by 2002:a05:622a:4c0a:b0:47b:4f3:b257 with SMTP id d75a77b69052e-494ae3a81d1mr44057981cf.31.1747382316518; Fri, 16 May 2025 00:58:36 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20250422235607.3652064-1-joannelkoong@gmail.com> In-Reply-To: From: Miklos Szeredi Date: Fri, 16 May 2025 09:58:25 +0200 X-Gm-Features: AX0GCFu2fOO9_kKT4DfQdUVMWPL4-utph466aa5QkYR4E2dvwsH0AF6Td3KqRBQ Message-ID: Subject: Re: [PATCH v2] fuse: use splice for reading user pages on servers that enable it To: Joanne Koong Cc: linux-fsdevel@vger.kernel.org, bernd.schubert@fastmail.fm, jlayton@kernel.org, kernel-team@meta.com Content-Type: text/plain; charset="UTF-8" On Thu, 15 May 2025 at 21:16, Joanne Koong wrote: > As I understand it, the zero copy uring api (I think the one you're > talking about is the one discussed here [1]?) requires client-side > changes in order to utilize it. > > [1] https://lore.kernel.org/linux-fsdevel/dc3a5c7d-b254-48ea-9749-2c464bfd3931@davidwei.uk/ No, that's not what I was thinking. That sort of thing is out of scope for fuse, I think. Hmm, so you actually need "single copy" direct write. - there's the buffer that write(2) gets from application - it's copied into server's own buffer, at which point the write(2) can return - at some point this buffer is sent to the network and freed/reused Currently this is not possible: - there's the buffer that write(2) gets from application - it's copied into libfuse's buffer, which is passed to the write callback - the server's write callback copies this to its own buffer, ... What's preventing libfuse to allow the server to keep the buffer? It seems just a logistic problem, not some fundamental API issue. Adding a fuse_buf_clone() that just transfers ownership of the underlying buffer is all that's needed on the API side. As for the implementation: libfuse would then need to handle the case of a buffer that has been transferred. Does this make sense? Thanks, Miklos