Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread Dan Williams
Matthew Wilcox wrote: > On Fri, Feb 23, 2024 at 03:50:33PM -0800, Dan Williams wrote: > > Certainly something like that would have satisified this sanity test use > > case. I will note that mm_account_fault() would need some help to figure > > out the size of the page table entry that got installed

Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread Matthew Wilcox
On Fri, Feb 23, 2024 at 03:50:33PM -0800, Dan Williams wrote: > Certainly something like that would have satisified this sanity test use > case. I will note that mm_account_fault() would need some help to figure > out the size of the page table entry that got installed. Maybe > extensions to vm_fau

Re: [RFC PATCH 07/20] famfs: Add include/linux/famfs_ioctl.h

2024-02-23 Thread Randy Dunlap
Hi John, On 2/23/24 18:23, John Groves wrote: >>> + >>> +#define FAMFSIOC_MAGIC 'u' >> This 'u' value should be documented in >> Documentation/userspace-api/ioctl/ioctl-number.rst. >> >> and if possible, you might want to use values like 0x5x or 0x8x >> that don't conflict with the ioctl numbers t

Re: [RFC PATCH 20/20] famfs: Add Kconfig and Makefile plumbing

2024-02-23 Thread John Groves
On 24/02/23 05:50PM, Randy Dunlap wrote: > Hi, > > On 2/23/24 09:42, John Groves wrote: > > Add famfs Kconfig and Makefile, and hook into fs/Kconfig and fs/Makefile > > > > Signed-off-by: John Groves > > --- > > fs/Kconfig| 2 ++ > > fs/Makefile | 1 + > > fs/famfs/Kconfig | 10

Re: [RFC PATCH 07/20] famfs: Add include/linux/famfs_ioctl.h

2024-02-23 Thread John Groves
On 24/02/23 05:39PM, Randy Dunlap wrote: > Hi-- > > On 2/23/24 09:41, John Groves wrote: > > Add uapi include file for famfs. The famfs user space uses ioctl on > > individual files to pass in mapping information and file size. This > > would be hard to do via sysfs or other means, since it's > >

Re: [RFC PATCH 20/20] famfs: Add Kconfig and Makefile plumbing

2024-02-23 Thread Randy Dunlap
Hi, On 2/23/24 09:42, John Groves wrote: > Add famfs Kconfig and Makefile, and hook into fs/Kconfig and fs/Makefile > > Signed-off-by: John Groves > --- > fs/Kconfig| 2 ++ > fs/Makefile | 1 + > fs/famfs/Kconfig | 10 ++ > fs/famfs/Makefile | 5 + > 4 files change

Re: [RFC PATCH 07/20] famfs: Add include/linux/famfs_ioctl.h

2024-02-23 Thread Randy Dunlap
Hi-- On 2/23/24 09:41, John Groves wrote: > Add uapi include file for famfs. The famfs user space uses ioctl on > individual files to pass in mapping information and file size. This > would be hard to do via sysfs or other means, since it's > file-specific. > > Signed-off-by: John Groves > --- >

Re: [RFC PATCH 00/20] Introduce the famfs shared-memory file system

2024-02-23 Thread Luis Chamberlain
On Fri, Feb 23, 2024 at 11:41:44AM -0600, John Groves wrote: > This patch set introduces famfs[1] - a special-purpose fs-dax file system > for sharable disaggregated or fabric-attached memory (FAM). Famfs is not > CXL-specific in anyway way. > > * Famfs creates a simple access method for storing a

Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread Dan Williams
Dave Hansen wrote: > On 2/23/24 12:39, John Groves wrote: > >> We had similar unit test regression concerns with fsdax where some > >> upstream change silently broke PMD faults. The solution there was trace > >> points in the fault handlers and a basic test that knows apriori that it > >> *should*

Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread Dave Hansen
On 2/23/24 12:39, John Groves wrote: >> We had similar unit test regression concerns with fsdax where some >> upstream change silently broke PMD faults. The solution there was trace >> points in the fault handlers and a basic test that knows apriori that it >> *should* be triggering a certain numbe

Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread John Groves
On 24/02/23 12:04PM, Dan Williams wrote: > John Groves wrote: > > On 24/02/23 10:23AM, Dave Hansen wrote: > > > On 2/23/24 09:42, John Groves wrote: > > > > One of the key requirements for famfs is that it service vma faults > > > > efficiently. Our metadata helps - the search order is n for n exte

Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread Dan Williams
John Groves wrote: > On 24/02/23 10:23AM, Dave Hansen wrote: > > On 2/23/24 09:42, John Groves wrote: > > > One of the key requirements for famfs is that it service vma faults > > > efficiently. Our metadata helps - the search order is n for n extents, > > > and n is usually 1. But we can still obs

Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread John Groves
On 24/02/23 10:23AM, Dave Hansen wrote: > On 2/23/24 09:42, John Groves wrote: > > One of the key requirements for famfs is that it service vma faults > > efficiently. Our metadata helps - the search order is n for n extents, > > and n is usually 1. But we can still observe gnarly lock contention >

Re: [RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread Dave Hansen
On 2/23/24 09:42, John Groves wrote: > One of the key requirements for famfs is that it service vma faults > efficiently. Our metadata helps - the search order is n for n extents, > and n is usually 1. But we can still observe gnarly lock contention > in mm if PTE faults are happening. This commit

[RFC PATCH 20/20] famfs: Add Kconfig and Makefile plumbing

2024-02-23 Thread John Groves
Add famfs Kconfig and Makefile, and hook into fs/Kconfig and fs/Makefile Signed-off-by: John Groves --- fs/Kconfig| 2 ++ fs/Makefile | 1 + fs/famfs/Kconfig | 10 ++ fs/famfs/Makefile | 5 + 4 files changed, 18 insertions(+) create mode 100644 fs/famfs/Kconfig cr

[RFC PATCH 19/20] famfs: Update MAINTAINERS file

2024-02-23 Thread John Groves
This patch introduces famfs into the MAINTAINERS file Signed-off-by: John Groves --- MAINTAINERS | 11 +++ 1 file changed, 11 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 73d898383e51..e4e8bf3602bb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8097,6 +8097,17 @@ F:

[RFC PATCH 18/20] famfs: Support character dax via the dev_dax_iomap patch

2024-02-23 Thread John Groves
This commit introduces the ability to open a character /dev/dax device instead of a block /dev/pmem device. This rests on the dev_dax_iomap patches earlier in this series. Signed-off-by: John Groves --- fs/famfs/famfs_inode.c | 97 +- 1 file changed, 87 in

[RFC PATCH 17/20] famfs: Add module stuff

2024-02-23 Thread John Groves
This commit introduces the module init and exit machinery for famfs. Signed-off-by: John Groves --- fs/famfs/famfs_inode.c | 44 ++ 1 file changed, 44 insertions(+) diff --git a/fs/famfs/famfs_inode.c b/fs/famfs/famfs_inode.c index ab46ec50b70d..0d659820e

[RFC PATCH 16/20] famfs: Add fault counters

2024-02-23 Thread John Groves
One of the key requirements for famfs is that it service vma faults efficiently. Our metadata helps - the search order is n for n extents, and n is usually 1. But we can still observe gnarly lock contention in mm if PTE faults are happening. This commit introduces fault counters that can be enabled

[RFC PATCH 15/20] famfs: Add ioctl to file_operations

2024-02-23 Thread John Groves
This commit introduces the per-file ioctl function famfs_file_ioctl() into struct file_operations, and introduces the famfs_file_init_dax() function (which is called by famfs_file_ioct()) famfs_file_init_dax() associates a dax extent list with a file, making it into a proper famfs file. It is call

[RFC PATCH 14/20] famfs: Add struct file_operations

2024-02-23 Thread John Groves
This commit introduces the famfs file_operations. We call thp_get_unmapped_area() to force PMD page alignment. Our read and write handlers (famfs_dax_read_iter() and famfs_dax_write_iter()) call dax_iomap_rw() to do the work. famfs_file_invalid() checks for various ways a famfs file can be in an i

[RFC PATCH 13/20] famfs: Add iomap_ops

2024-02-23 Thread John Groves
This commit introduces the famfs iomap_ops. When either dax_iomap_fault() or dax_iomap_rw() is called, we get a callback via our iomap_begin() handler. The question being asked is "please resolve (file, offset) to (daxdev, offset)". The function famfs_meta_to_dax_offset() does this. The per-file m

[RFC PATCH 12/20] famfs: Add inode_operations and file_system_type

2024-02-23 Thread John Groves
This commit introduces the famfs inode_operations. There is nothing really unique to famfs here in the inode_operations.. This commit also introduces the famfs_file_system_type struct and the famfs_kill_sb() function. Signed-off-by: John Groves --- fs/famfs/famfs_inode.c | 132 +

[RFC PATCH 11/20] famfs: Add fs_context_operations

2024-02-23 Thread John Groves
This commit introduces the famfs fs_context_operations and famfs_get_inode() which is used by the context operations. Signed-off-by: John Groves --- fs/famfs/famfs_inode.c | 178 + 1 file changed, 178 insertions(+) diff --git a/fs/famfs/famfs_inode.c b/fs

[RFC PATCH 10/20] famfs: famfs_open_device() & dax_holder_operations

2024-02-23 Thread John Groves
Famfs works on both /dev/pmem and /dev/dax devices. This commit introduces the function that opens a block (pmem) device and the struct dax_holder_operations that are needed for that ABI. In this commit, support for opening character /dev/dax is stubbed. A later commit introduces this capability.

[RFC PATCH 09/20] famfs: Add super_operations

2024-02-23 Thread John Groves
Introduce the famfs superblock operations Signed-off-by: John Groves --- fs/famfs/famfs_inode.c | 72 ++ 1 file changed, 72 insertions(+) create mode 100644 fs/famfs/famfs_inode.c diff --git a/fs/famfs/famfs_inode.c b/fs/famfs/famfs_inode.c new file mode

[RFC PATCH 08/20] famfs: Add famfs_internal.h

2024-02-23 Thread John Groves
Add the famfs_internal.h include file. This contains internal data structures such as the per-file metadata structure (famfs_file_meta) and extent formats. Signed-off-by: John Groves --- fs/famfs/famfs_internal.h | 53 +++ 1 file changed, 53 insertions(+) cre

[RFC PATCH 07/20] famfs: Add include/linux/famfs_ioctl.h

2024-02-23 Thread John Groves
Add uapi include file for famfs. The famfs user space uses ioctl on individual files to pass in mapping information and file size. This would be hard to do via sysfs or other means, since it's file-specific. Signed-off-by: John Groves --- include/uapi/linux/famfs_ioctl.h | 56 +++

[RFC PATCH 06/20] dev_dax_iomap: Add CONFIG_DEV_DAX_IOMAP kernel build parameter

2024-02-23 Thread John Groves
Add the CONFIG_DEV_DAX_IOMAP kernel config parameter to control building of the iomap functionality to support fsdax on devdax. Signed-off-by: John Groves --- drivers/dax/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/dax/Kconfig b/drivers/dax/Kconfig index a8874424414

[RFC PATCH 05/20] dev_dax_iomap: Add dax_operations for use by fs-dax on devdax

2024-02-23 Thread John Groves
Notes about this commit: * These methods are based somewhat loosely on pmem_dax_ops from drivers/nvdimm/pmem.c * dev_dax_direct_access() is returns the hpa, pfn and kva. The kva was newly stored as dev_dax->virt_addr by dev_dax_probe(). * The hpa/pfn are used for mmap (dax_iomap_fault()), an

[RFC PATCH 04/20] dev_dax_iomap: Save the kva from memremap

2024-02-23 Thread John Groves
Save the kva from memremap because we need it for iomap rw support Prior to famfs, there were no iomap users of /dev/dax - so the virtual address from memremap was not needed. Also: in some cases dev_dax_probe() is called with the first dev_dax->range offset past pgmap[0].range. In those cases we

[RFC PATCH 03/20] dev_dax_iomap: Move dax_pgoff_to_phys from device.c to bus.c since both need it now

2024-02-23 Thread John Groves
bus.c can't call functions in device.c - that creates a circular linkage dependency. Signed-off-by: John Groves --- drivers/dax/bus.c| 24 drivers/dax/device.c | 23 --- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/drivers/dax/

[RFC PATCH 02/20] dev_dax_iomap: Add fs_dax_get() func to prepare dax for fs-dax usage

2024-02-23 Thread John Groves
This function should be called by fs-dax file systems after opening the devdax device. This adds holder_operations. This function serves the same role as fs_dax_get_by_bdev(), which dax file systems call after opening the pmem block device. Signed-off-by: John Groves --- drivers/dax/super.c | 3

[RFC PATCH 01/20] famfs: Documentation

2024-02-23 Thread John Groves
Introduce Documentation/filesystems/famfs.rst into the Documentation tree Signed-off-by: John Groves --- Documentation/filesystems/famfs.rst | 124 1 file changed, 124 insertions(+) create mode 100644 Documentation/filesystems/famfs.rst diff --git a/Documentation/f

[RFC PATCH 00/20] Introduce the famfs shared-memory file system

2024-02-23 Thread John Groves
This patch set introduces famfs[1] - a special-purpose fs-dax file system for sharable disaggregated or fabric-attached memory (FAM). Famfs is not CXL-specific in anyway way. * Famfs creates a simple access method for storing and sharing data in sharable memory. The memory is exposed and accesse

[PATCH v6] tracing: Support to dump instance traces by ftrace_dump_on_oops

2024-02-23 Thread Huang Yiwei
Currently ftrace only dumps the global trace buffer on an OOPs. For debugging a production usecase, instance trace will be helpful to check specific problems since global trace buffer may be used for other purposes. This patch extend the ftrace_dump_on_oops parameter to dump a specific or multiple

Re: [PATCH v5] tracing: Support to dump instance traces by ftrace_dump_on_oops

2024-02-23 Thread Huang Yiwei
On 2/23/2024 9:47 AM, Steven Rostedt wrote: On Thu, 8 Feb 2024 21:18:14 +0800 Huang Yiwei wrote: Currently ftrace only dumps the global trace buffer on an OOPs. For debugging a production usecase, instance trace will be helpful to check specific problems since global trace buffer may be use