Re: [PATCH V7 08/18] x86/entry: Preserve PKRS MSR across exceptions

2021-12-02 Thread Andy Lutomirski
On 11/12/21 16:50, Ira Weiny wrote: On Tue, Aug 03, 2021 at 09:32:21PM -0700, 'Ira Weiny' wrote: From: Ira Weiny The PKRS MSR is not managed by XSAVE. It is preserved through a context switch but this support leaves exception handling code open to memory accesses during exceptions. 2

[PATCH v8 7/9] dax: add dax holder helper for filesystems

2021-12-02 Thread Shiyang Ruan
Add these helper functions, and export them for filesystem use. Signed-off-by: Shiyang Ruan --- drivers/dax/super.c | 19 +++ include/linux/dax.h | 15 +++ 2 files changed, 34 insertions(+) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index

[PATCH v8 6/9] mm: Introduce mf_dax_kill_procs() for fsdax case

2021-12-02 Thread Shiyang Ruan
This function is called at the end of RMAP routine, i.e. filesystem recovery function, to collect and kill processes using a shared page of DAX file. The difference between mf_generic_kill_procs() is, it accepts file's mapping,offset instead of struct page. Because different file's mappings and

[PATCH v8 4/9] pagemap,pmem: Introduce ->memory_failure()

2021-12-02 Thread Shiyang Ruan
When memory-failure occurs, we call this function which is implemented by each kind of devices. For the fsdax case, pmem device driver implements it. Pmem device driver will find out the filesystem in which the corrupted page located in. With dax_holder notify support, we are able to notify the

[PATCH v8 3/9] mm: factor helpers for memory_failure_dev_pagemap

2021-12-02 Thread Shiyang Ruan
memory_failure_dev_pagemap code is a bit complex before introduce RMAP feature for fsdax. So it is needed to factor some helper functions to simplify these code. Signed-off-by: Shiyang Ruan Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- mm/memory-failure.c | 141

[PATCH v8 1/9] dax: Use percpu rwsem for dax_{read,write}_lock()

2021-12-02 Thread Shiyang Ruan
In order to introduce dax holder registration, we need a write lock for dax. Change the current lock to percpu_rw_semaphore and introduce a write lock for registration. Signed-off-by: Shiyang Ruan --- drivers/dax/device.c | 11 +-- drivers/dax/super.c| 40

[RESEND PATCH v8 0/9] fsdax: introduce fs query to support reflink

2021-12-02 Thread Shiyang Ruan
This patchset is aimed to support shared pages tracking for fsdax. Christoph has posted "decouple DAX from block devices v2", I need to rebase to his tree. And since my v8 patchset sent before hasn't been reviewed yet. So, I send this patchset as a RESEND of v8. Changes from V8: - Rebased to

[PATCH v8 2/9] dax: Introduce holder for dax_device

2021-12-02 Thread Shiyang Ruan
To easily track filesystem from a pmem device, we introduce a holder for dax_device structure, and also its operation. This holder is used to remember who is using this dax_device: - When it is the backend of a filesystem, the holder will be the superblock of this filesystem. - When this

[PATCH v8 8/9] xfs: Implement ->notify_failure() for XFS

2021-12-02 Thread Shiyang Ruan
Introduce xfs_notify_failure.c to handle failure related works, such as implement ->notify_failure(), register/unregister dax holder in xfs, and so on. If the rmap feature of XFS enabled, we can query it to find files and metadata which are associated with the corrupt data. For now all we do is

[PATCH v8 5/9] fsdax: Introduce dax_lock_mapping_entry()

2021-12-02 Thread Shiyang Ruan
The current dax_lock_page() locks dax entry by obtaining mapping and index in page. To support 1-to-N RMAP in NVDIMM, we need a new function to lock a specific dax entry corresponding to this file's mapping,index. And BTW, output the page corresponding to the specific dax entry for caller use.

[PATCH v8 9/9] fsdax: set a CoW flag when associate reflink mappings

2021-12-02 Thread Shiyang Ruan
Introduce a FS_DAX_MAPPING_COW flag to support association with CoW file mappings. In this case, the dax-RMAP already takes the responsibility to look up for shared files by given dax page. The page->mapping is no longer to used for rmap but for marking that this dax page is shared. And to make