[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210208105530.3072869-2-ruansy.fnst@cn.fujitsu.com>
Date: Mon, 8 Feb 2021 18:55:20 +0800
From: Shiyang Ruan <ruansy.fnst@...fujitsu.com>
To: <linux-kernel@...r.kernel.org>, <linux-xfs@...r.kernel.org>,
<linux-nvdimm@...ts.01.org>, <linux-mm@...ck.org>,
<linux-fsdevel@...r.kernel.org>, <dm-devel@...hat.com>
CC: <darrick.wong@...cle.com>, <dan.j.williams@...el.com>,
<david@...morbit.com>, <hch@....de>, <agk@...hat.com>,
<snitzer@...hat.com>, <rgoldwyn@...e.de>, <qi.fuli@...itsu.com>,
<y-goto@...itsu.com>
Subject: [PATCH v3 01/11] pagemap: Introduce ->memory_failure()
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 block device where
the error page locates in, and try to get the filesystem on this block
device. And finally call filesystem handler to deal with the error.
The filesystem will try to recover the corrupted data if possiable.
Signed-off-by: Shiyang Ruan <ruansy.fnst@...fujitsu.com>
---
include/linux/memremap.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/memremap.h b/include/linux/memremap.h
index 79c49e7f5c30..0bcf2b1e20bd 100644
--- a/include/linux/memremap.h
+++ b/include/linux/memremap.h
@@ -87,6 +87,14 @@ struct dev_pagemap_ops {
* the page back to a CPU accessible page.
*/
vm_fault_t (*migrate_to_ram)(struct vm_fault *vmf);
+
+ /*
+ * Handle the memory failure happens on one page. Notify the processes
+ * who are using this page, and try to recover the data on this page
+ * if necessary.
+ */
+ int (*memory_failure)(struct dev_pagemap *pgmap, unsigned long pfn,
+ int flags);
};
#define PGMAP_ALTMAP_VALID (1 << 0)
--
2.30.0
Powered by blists - more mailing lists