Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
On 2024-02-02 15:14, Dan Williams wrote: Mathieu Desnoyers wrote: [..] Thanks for that. All of those need to be done before the fs goes live later in virtio_device_ready(), but before that point nothing should be calling into virtio_fs_dax_ops, so as far as I can see it is safe to change the

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Dan Williams
Mathieu Desnoyers wrote: [..] > > Thanks for that. All of those need to be done before the fs goes live > > later in virtio_device_ready(), but before that point nothing should be > > calling into virtio_fs_dax_ops, so as far as I can see it is safe to > > change the order. > > Sounds good, I'll

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
On 2024-02-02 14:41, Dan Williams wrote: Mathieu Desnoyers wrote: On 2024-02-02 12:37, Dan Williams wrote: Mathieu Desnoyers wrote: [...] The alternative route I intend to take is to audit all callers of alloc_dax() and make sure they all save the alloc_dax() return value in a struct

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Dan Williams
Mathieu Desnoyers wrote: > On 2024-02-02 12:37, Dan Williams wrote: > > Mathieu Desnoyers wrote: > [...] > >> > > > >> The alternative route I intend to take is to audit all callers > >> of alloc_dax() and make sure they all save the alloc_dax() return > >> value in a struct dax_device * local

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
On 2024-02-02 12:37, Dan Williams wrote: Mathieu Desnoyers wrote: [...] The alternative route I intend to take is to audit all callers of alloc_dax() and make sure they all save the alloc_dax() return value in a struct dax_device * local variable first for the sake of checking for

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Dan Williams
Mathieu Desnoyers wrote: [..] > The change for -EOPNOTSUPP in header and implementation would look like > this (more questions below): > > diff --git a/include/linux/dax.h b/include/linux/dax.h > index b463502b16e1..df2d52b8a245 100644 > --- a/include/linux/dax.h > +++ b/include/linux/dax.h > @@

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
On 2024-02-01 10:44, Mathieu Desnoyers wrote: On 2024-01-31 17:18, Dan Williams wrote: [...] diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 5f1be1da92ce..11053a70f5ab 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -16,6 +16,7 @@   #include   #include  

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
On 2024-02-01 10:44, Mathieu Desnoyers wrote: [...] diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 4e8fdcb3f1c8..b69c9e442cf4 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -560,17 +560,19 @@ static int pmem_attach_disk(struct device *dev,   dax_dev =

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-01 Thread Mathieu Desnoyers
On 2024-01-31 17:18, Dan Williams wrote: Mathieu Desnoyers wrote: On 2024-01-31 16:02, Dan Williams wrote: Mathieu Desnoyers wrote: Replace the following fs/Kconfig:FS_DAX dependency: depends on !(ARM || MIPS || SPARC) By a runtime check within alloc_dax(). This is done in preparation

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-01-31 Thread Dan Williams
Mathieu Desnoyers wrote: > On 2024-01-31 16:02, Dan Williams wrote: > > Mathieu Desnoyers wrote: > >> Replace the following fs/Kconfig:FS_DAX dependency: > >> > >>depends on !(ARM || MIPS || SPARC) > >> > >> By a runtime check within alloc_dax(). > >> > >> This is done in preparation for its

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-01-31 Thread Mathieu Desnoyers
On 2024-01-31 16:02, Dan Williams wrote: Mathieu Desnoyers wrote: Replace the following fs/Kconfig:FS_DAX dependency: depends on !(ARM || MIPS || SPARC) By a runtime check within alloc_dax(). This is done in preparation for its use by each filesystem supporting the "dax" mount option to

RE: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-01-31 Thread Dan Williams
Mathieu Desnoyers wrote: > Replace the following fs/Kconfig:FS_DAX dependency: > > depends on !(ARM || MIPS || SPARC) > > By a runtime check within alloc_dax(). > > This is done in preparation for its use by each filesystem supporting > the "dax" mount option to validate whether DAX is indeed