Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp829956lqo; Fri, 17 May 2024 02:56:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWNRBXyoXo/xpzlkGEk+ShswdY/u/mjRrUPcdhmDy9yMqXodHdIOxf4BTnL3aIfRVU+ufpgugoa090Xb3Ly5g45ZZ2I8vsawEp/mDxcTQ== X-Google-Smtp-Source: AGHT+IGcPMfqCc3CmZYJEvjUNU3DViz5Y/3G+ln7wks5Uv9boFy4IK0z9u875FP6ERF5UW9G5+uo X-Received: by 2002:a17:906:6882:b0:a5a:76e2:c2a8 with SMTP id a640c23a62f3a-a5a76e2c306mr843977966b.23.1715939767699; Fri, 17 May 2024 02:56:07 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c03d1dsi962544266b.900.2024.05.17.02.56.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 02:56:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@szeredi.hu header.s=google header.b=DpILjKRH; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-181960-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181960-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 590501F23EE1 for ; Fri, 17 May 2024 09:56:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E85A24B34; Fri, 17 May 2024 09:55:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="DpILjKRH" 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 98ABE262A8 for ; Fri, 17 May 2024 09:55:52 +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=1715939754; cv=none; b=eQjo239LiOPCHNG8907JBfDqQDGus0nfSbveqUgFdBVk9vJjPLjdJyoVQMsN/bwmsMrR4xdaXKV/HThjBIrKAkhZ8BQVNZqfE3nDXm5i3mnbheh3ilTGrlQardrhEwzdCMqlgxW7701f5GIb+W4rWbP4m9hhqydcudJdROtJjaU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715939754; c=relaxed/simple; bh=yEo5GShOkRDZDNm8NkQ+gpHhI/5nysUzlnONr9Kdx9s=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=BRojC8l4npSygDsfliYI/2t7aLKURnSb+EPqe+ztkKU+rneCyiP1Bjl2f2+qY5A6RdTB9qpvIeUMke43CY2gWRbusXNuP6yya8OSGCn9vXlUNXoW38EVbl73rmGNDOXmYVOS2n/QhI+oIsljf/JH7Y6PMoI25oLQCHa7Zrgm2nw= 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=DpILjKRH; arc=none smtp.client-ip=209.85.208.52 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 Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-572669fd9f9so4707582a12.0 for ; Fri, 17 May 2024 02:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; t=1715939751; x=1716544551; 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=pcObKvA4ZG4W5f3+AevN4kRUemeykWizQkVWPJqy2SU=; b=DpILjKRH3vDhAYA/ARHOtJO01BJvGSVK5u3XIsj2wW9u7ojtsbZVIzdtnMieqnEia3 //gIOLPeQ1vncIvQzju+tV9TOQyQDRp48z1kOh7lHwy758BU26Hy108pt8htsKLpAg0f 6PvYu8WCDcuJ0iy79GmV5cKOboNxTdTOZb8TU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715939751; x=1716544551; 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=pcObKvA4ZG4W5f3+AevN4kRUemeykWizQkVWPJqy2SU=; b=N8sP4kXwjwmsAvIBi/Uvtb1RvXTxTdiKk1G7oEAmuM0sSYfMUAFkZryQp7OjAzyH+T ftJomwRZJ7BAsRW76L6et5LdOFdkqSLdK929L2NRJgFFeSRiKiaZ9F+6f5QVpMEVUhb7 zG8LvOIeni9udeYzK2Ap/eL6UvQPNILGvxt7fruAa+fRJHS1Xu21QpjMeqMegwDXA4Eo znHFQCDxEgFYy2/ZWzU6kdYmp7efvKbdEmaHnpPHybOh2Ot++MDdfIAQihP2e2XggL0y C+wAKkJ7DJ3ZKCFijbjXjtbI5NBX+Uaadr+bXAAWljbjmYh2zERU1jPjWYEFYaljcUOh clOA== X-Forwarded-Encrypted: i=1; AJvYcCVfXl6d/l0ygOLB0AEmDrceoDxc2BCP3o7+T11VCY8lPvZpgtfWazSqmZsyIo5VXzHTim26sUnJ+WL0FAqM9kECwU/fpo19anCicS+l X-Gm-Message-State: AOJu0YxzPHiPUGWIguw6XK33P3gQpXgg83LbYfa/ksU+bNfJTpKFNtN2 mINQVaFlO1MSfSwKU8q1+uz5+cF/DbR0nnG+rwzUJxAyeCZR6JVznGv/lu508aR6/GajsewaZW4 jhVnYTaIrtN9bH/Mz2xvjJqCO2c/oA3pR8uSQVQ== X-Received: by 2002:a17:907:7f09:b0:a59:b61f:b96d with SMTP id a640c23a62f3a-a5a2d53bc6amr1654347366b.5.1715939750690; Fri, 17 May 2024 02:55:50 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Miklos Szeredi Date: Fri, 17 May 2024 11:55:38 +0200 Message-ID: Subject: Re: [RFC PATCH 00/20] Introduce the famfs shared-memory file system To: Amir Goldstein Cc: John Groves , John Groves , Jonathan Corbet , Dan Williams , Vishal Verma , Dave Jiang , Alexander Viro , Christian Brauner , Jan Kara , Matthew Wilcox , linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, john@jagalactic.com, Dave Chinner , Christoph Hellwig , dave.hansen@linux.intel.com, gregory.price@memverge.com, Vivek Goyal Content-Type: text/plain; charset="UTF-8" On Thu, 29 Feb 2024 at 07:52, Amir Goldstein wrote: > I'm not virtiofs expert, but I don't think that you are wrong about this. > IIUC, virtiofsd could map arbitrary memory region to any fuse file mmaped > by virtiofs client. > > So what are the gaps between virtiofs and famfs that justify a new filesystem > driver and new userspace API? Let me try to fill in some gaps. I've looked at the famfs driver (even tried to set it up in a VM, but got stuck with the EFI stuff). - famfs has an extent list per file that indicates how each page within the file should be mapped onto the dax device, IOW it has the following mapping: [famfs file, offset] -> [offset, length] - fuse can currently map a fuse file onto a backing file: [fuse file] -> [backing file] The interface for the latter is backing_id = ioctl(dev_fuse_fd, FUSE_DEV_IOC_BACKING_OPEN, backing_map); .. fuse_open_out.flags |= FOPEN_PASSTHROUGH; fuse_open_out.backing_id = backing_id; This looks suitable for doing the famfs file - > dax device mapping as well. I wouldn't extend the ioctl with extent information, since famfs can just use FUSE_DEV_IOC_BACKING_OPEN once to register the dax device. The flags field could be used to tell the kernel to treat this fd as a dax device instead of a a regular file. Letter, when the file is opened the extent list could be sent in the open reply together with the backing id. The fuse_ext_header mechanism seems suitable for this. And I think that's it as far as API's are concerned. Note: this is already more generic than the current famfs prototype, since multiple dax devices could be used as backing for famfs files, with the constraint that a single file can only map data from a single dax device. As for implementing dax passthrough, I think that needs a separate source file, the one used by virtiofs (fs/fuse/dax.c) does not appear to have many commonalities with this one. That could be renamed to virtiofs_dax.c as it's pretty much virtiofs specific, AFAICT. Comments? Am I missing something significant? Thanks, Miklos