dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [dm-devel] [PATCH v5 0/9] fsdax: introduce fs query to support reflink
@ 2021-06-28  0:02 Shiyang Ruan
  2021-06-28  0:02 ` [dm-devel] [PATCH v5 1/9] pagemap: Introduce ->memory_failure() Shiyang Ruan
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Shiyang Ruan @ 2021-06-28  0:02 UTC (permalink / raw)
  To: linux-kernel, linux-xfs, nvdimm, linux-mm, linux-fsdevel, dm-devel
  Cc: snitzer, darrick.wong, rgoldwyn, david, dan.j.williams, hch, agk

This patchset is aimed to support shared pages tracking for fsdax.

Change from V4:
  - Add nr_pfns for ->memory_failure() to support range based notification
  - Remove struct bdev in dax_holder_notify_failure()
  - Add rwsem for dax_holder
  - Rename functions to (*_)notify_failure()
  - Remove sb->corrupted_range(), implement holder_ops in filesystem and
      MD driver instead
  - Reorganize the patchset, make it easy to review
  - Rebased to v5.13-rc7

This patchset moves owner tracking from dax_assocaite_entry() to pmem
device driver, by introducing an interface ->memory_failure() for struct
pagemap.  This interface is called by memory_failure() in mm, and
implemented by pmem device.

Then call holder operations to find the filesystem which the corrupted
data located in, and call filesystem handler to track files or metadata
associated with this page.

Finally we are able to try to fix the corrupted data in filesystem and
do other necessary processing, such as killing processes who are using
the files affected.

The call trace is like this:
memory_failure()
|* fsdax case
|------------
|pgmap->ops->memory_failure()      => pmem_pgmap_memory_failure()
| dax_holder_notify_failure()      =>
|  dax_device->holder_ops->notify_failure() =>
|                                     - xfs_dax_notify_failure()
|                                     - md_dax_notify_failure()
|  |* xfs_dax_notify_failure()
|  |--------------------------
|  |   xfs_rmap_query_range()
|  |    xfs_currupt_helper()
|  |    * corrupted on metadata
|  |       try to recover data, call xfs_force_shutdown()
|  |    * corrupted on file data
|  |       try to recover data, call mf_dax_kill_procs()
|  |* md_dax_notify_failure()
|  |-------------------------
|      md_targets->iterate_devices()
|      md_targets->rmap()          => linear_rmap()
|       dax_holder_notify_failure()
|* normal case
|-------------
 mf_generic_kill_procs()

The fsdax & reflink support for XFS is not contained in this patchset.

(Rebased on v5.13-rc7)
==

Shiyang Ruan (9):
  pagemap: Introduce ->memory_failure()
  dax: Introduce holder for dax_device
  mm: factor helpers for memory_failure_dev_pagemap
  pmem,mm: Implement ->memory_failure in pmem driver
  mm: Introduce mf_dax_kill_procs() for fsdax case
  xfs: Implement ->corrupted_range() for XFS
  dm: Introduce ->rmap() to find bdev offset
  md: Implement dax_holder_operations
  fs/dax: Remove useless functions

 block/genhd.c                 |  30 +++++++
 drivers/dax/super.c           |  49 ++++++++++
 drivers/md/dm-linear.c        |  20 +++++
 drivers/md/dm.c               | 126 +++++++++++++++++++++++++-
 drivers/nvdimm/pmem.c         |  13 +++
 fs/dax.c                      |  73 ++++-----------
 fs/xfs/xfs_fsops.c            |   5 ++
 fs/xfs/xfs_mount.h            |   1 +
 fs/xfs/xfs_super.c            | 140 +++++++++++++++++++++++++++++
 include/linux/dax.h           |  27 ++++++
 include/linux/device-mapper.h |   5 ++
 include/linux/genhd.h         |   1 +
 include/linux/memremap.h      |   9 ++
 include/linux/mm.h            |  10 +++
 mm/memory-failure.c           | 165 ++++++++++++++++++++++------------
 15 files changed, 564 insertions(+), 110 deletions(-)

--
2.32.0



--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


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

end of thread, other threads:[~2021-07-21  7:54 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28  0:02 [dm-devel] [PATCH v5 0/9] fsdax: introduce fs query to support reflink Shiyang Ruan
2021-06-28  0:02 ` [dm-devel] [PATCH v5 1/9] pagemap: Introduce ->memory_failure() Shiyang Ruan
2021-06-28  0:02 ` [dm-devel] [PATCH v5 2/9] dax: Introduce holder for dax_device Shiyang Ruan
2021-07-19 15:17   ` Christoph Hellwig
2021-07-20 10:37     ` ruansy.fnst
2021-06-28  0:02 ` [dm-devel] [PATCH v5 3/9] mm: factor helpers for memory_failure_dev_pagemap Shiyang Ruan
2021-06-28  0:02 ` [dm-devel] [PATCH v5 4/9] pmem, mm: Implement ->memory_failure in pmem driver Shiyang Ruan
2021-06-28  0:02 ` [dm-devel] [PATCH v5 5/9] mm: Introduce mf_dax_kill_procs() for fsdax case Shiyang Ruan
2021-06-28  3:23   ` kernel test robot
2021-06-28 11:49   ` Matthew Wilcox
2021-06-29  7:49     ` ruansy.fnst
2021-06-29 11:46       ` Matthew Wilcox
2021-07-16  6:32         ` ruansy.fnst
2021-06-28  0:02 ` [dm-devel] [PATCH v5 6/9] xfs: Implement ->corrupted_range() for XFS Shiyang Ruan
2021-06-28  2:02   ` kernel test robot
2021-06-28  3:05   ` kernel test robot
2021-06-28  0:02 ` [dm-devel] [PATCH v5 7/9] dm: Introduce ->rmap() to find bdev offset Shiyang Ruan
2021-06-28  0:02 ` [dm-devel] [PATCH v5 8/9] md: Implement dax_holder_operations Shiyang Ruan
2021-06-28  0:02 ` [dm-devel] [PATCH v5 9/9] fs/dax: Remove useless functions Shiyang Ruan
2021-07-19 15:18   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).