linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [REGRESSION] v5.13: FS_DAX unavailable on 32-bit ARM
@ 2024-01-26 19:33 Mathieu Desnoyers
  2024-01-26 20:14 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Desnoyers @ 2024-01-26 19:33 UTC (permalink / raw)
  To: Dan Williams, Vishal Verma, Dave Jiang, Matthew Wilcox,
	Andrew Morton, Linus Torvalds, linux-mm, linux-arch, nvdimm,
	linux-cxl, linux-kernel, Russell King, Arnd Bergmann

Hi,

This commit introduced in v5.13 prevents building FS_DAX on 32-bit ARM,
even on ARMv7 which does not have virtually aliased dcaches:

commit d92576f1167c ("dax: does not work correctly with virtual aliasing caches")

It used to work fine before: I have customers using dax over pmem on ARMv7, but
this regression will likely prevent them from upgrading their kernel.

The root of the issue here is the fact that DAX was never designed to handle
virtually aliased dcache (VIVT and VIPT with aliased dcache). It touches the
pages through their linear mapping, which is not consistent with the userspace
mappings on virtually aliased dcaches.

I can see a few ways forward to address this:

A) I have prepared a patch series introducing cache_is_aliasing() with new Kconfig
    options:

   * ARCH_HAS_CACHE_ALIASING
   * ARCH_HAS_CACHE_ALIASING_DYNAMIC

and implemented it for all architectures. The "DYNAMIC" implementation
implements cache_is_aliasing() as a runtime check, which is what is needed
on architectures like 32-bit ARM.

With this we can basically narrow down the list of architectures which are
unsupported by DAX to those which are really affected, without actually solving
the issue for architectures with virtually aliased dcaches.

B) Another approach would be to dig into what exactly DAX is doing with the linear
    mapping, and try to fix this. I see two options there:

B.1) Either we extend vmap to allow vmap'd pages to be aligned on specific multiples,
      and use a coloring trick based on SHMLBA like userspace mappings do for all DAX
      internal pages accesses, or

B.2) We introduce flush_dcache_folio() at relevant spots (perhaps dax_flush() ?) to
      synchronize the linear mapping wrt userspace mappings. (would this work ?)

Any thoughts on how to best move forward with this issue are welcome.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-26 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-26 19:33 [REGRESSION] v5.13: FS_DAX unavailable on 32-bit ARM Mathieu Desnoyers
2024-01-26 20:14 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox