mm, soft-offline: convert parameter to pfn
Subsystems (6)
PATCH 1/1 mm, soft-offline: convert parameter to pfn
Hi,
I wrote a simple cleanup for parameter of soft_offline_page(), based on thread https://lkml.org/lkml/2019/10/11/57.
I know that we need more cleanup on hwpoison-inject, but I think that will be mentioned in re-write patchset Oscar is preparing now. So let me shared only this part as a separate one now.
Thanks,
Naoya Horiguchi
---
From: Naoya Horiguchi <[email protected]>
Date: Wed, 16 Oct 2019 15:49:00 +0900
Subject: [PATCH] mm, soft-offline: convert parameter to pfn
Currently soft_offline_page() receives struct page, and its sibling memory_failure() receives pfn. This discrepancy looks weird and makes precheck on pfn validity tricky. So let's align them.
--- drivers/base/memory.c | 2 +- include/linux/mm.h | 2 +- mm/madvise.c | 2 +- mm/memory-failure.c | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/base/memory.c +1 -1
@@ -540,7 +540,7 @@ static ssize_t soft_offline_page_store(struct device *dev, pfn >>=PAGE_SHIFT ;if (!pfn_valid (pfn))return -ENXIO ; - ret =soft_offline_page (pfn_to_page (pfn)); + ret =soft_offline_page (pfn);return ret ==0 ? count : ret; }
include/linux/mm.h +1 -1
@@ -2783,7 +2783,7 @@ extern int sysctl_memory_failure_early_kill;extern int sysctl_memory_failure_recovery;extern void shake_page (struct page *p,int access);extern atomic_long_t num_poisoned_pages__read_mostly ; -extern int soft_offline_page (struct page *page); +extern int soft_offline_page (unsigned long pfn);/*
mm/madvise.c +1 -1
@@ -893,7 +893,7 @@ static int madvise_inject_error(int behavior,if (behavior ==MADV_SOFT_OFFLINE ) {pr_info ("Soft offlining pfn %#lx at process virtual address %#lx\n" , pfn, start); - ret =soft_offline_page (page); + ret =soft_offline_page (pfn);if (ret)return ret; }else {
mm/memory-failure.c +4 -4
@@ -1514,7 +1514,7 @@ static void memory_failure_work_func(struct work_struct *work)if (!gotten)break ;if (entry.flags &MF_SOFT_OFFLINE ) -soft_offline_page (pfn_to_page (entry.pfn)); +soft_offline_page (entry.pfn);else memory_failure (entry.pfn, entry.flags); }
@@ -1822,7 +1822,7 @@ static int soft_offline_free_page(struct page *page)/** * soft_offline_page - Soft offline a page. -* @page: page to offline +* @pfn: pfn to soft-offline * * Returns 0 on success, otherwise negated errno. *
@@ -1841,10 +1841,10 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page (struct page *page) +int soft_offline_page (unsigned long pfn) {int ret; -unsigned long pfn =page_to_pfn (page); +struct page *page =pfn_to_page (pfn);if (is_zone_device_page (page)) { pr_debug_ratelimited("soft_offline: %#lx page is device page\n",
Signature · 1 line
2.17.1
Quoted 93 lines · Naoya Horiguchi
Hi,
I wrote a simple cleanup for parameter of
soft_offline_page(), based on thread https://lkml.org/lkml/2019/10/11/57.I know that we need more cleanup on hwpoison-inject, but I think that will be mentioned in re-write patchset Oscar is preparing now. So let me shared only this part as a separate one now.
Thanks,
Naoya Horiguchi
---
From: Naoya Horiguchi <[email protected]>
Date: Wed, 16 Oct 2019 15:49:00 +0900
Subject: [PATCH] mm, soft-offline: convert parameter to pfnCurrently
soft_offline_page()receives struct page, and its siblingmemory_failure()receives pfn. This discrepancy looks weird and makes precheck on pfn validity tricky. So let's align them.Signed-off-by Naoya Horiguchi <[email protected]>--- drivers/base/memory.c | 2 +- include/linux/mm.h | 2 +- mm/madvise.c | 2 +- mm/memory-failure.c | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-)drivers/base/memory.c +1
-1@@ -540,7 +540,7 @@ static ssize_t soft_offline_page_store(struct device *dev, pfn >>=PAGE_SHIFT ;if (!pfn_valid (pfn))return -ENXIO ; - ret =soft_offline_page (pfn_to_page (pfn)); + ret =soft_offline_page (pfn);return ret ==0 ? count : ret; }include/linux/mm.h +1
-1@@ -2783,7 +2783,7 @@ extern int sysctl_memory_failure_early_kill;extern int sysctl_memory_failure_recovery;extern void shake_page (struct page *p,int access);extern atomic_long_t num_poisoned_pages__read_mostly ; -extern int soft_offline_page (struct page *page); +extern int soft_offline_page (unsigned long pfn);/* mm/madvise.c +1
-1@@ -893,7 +893,7 @@ static int madvise_inject_error(int behavior,if (behavior ==MADV_SOFT_OFFLINE ) {pr_info ("Soft offlining pfn %#lx at process virtual address %#lx\n" , pfn, start); - ret =soft_offline_page (page); + ret =soft_offline_page (pfn);if (ret)return ret; }else {mm/memory-failure.c +2
-2@@ -1514,7 +1514,7 @@ static void memory_failure_work_func(struct work_struct *work)if (!gotten)break ;if (entry.flags &MF_SOFT_OFFLINE ) -soft_offline_page (pfn_to_page (entry.pfn)); +soft_offline_page (entry.pfn);else memory_failure (entry.pfn, entry.flags); }@@ -1822,7 +1822,7 @@ static int soft_offline_free_page(struct page *page)/** * soft_offline_page - Soft offline a page. -* @page: page to offline +* @pfn: pfn to soft-offline * * Returns 0 on success, otherwise negated errno. * @@ -1841,10 +1841,10 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory.
mm/memory-failure.c static int soft_offline_free_page(struct page *page) · line 1850
Quoted 10 lines
mm/memory-failure.c +2
-2*/ -int soft_offline_page (struct page *page) +int soft_offline_page (unsigned long pfn) {int ret; -unsigned long pfn =page_to_pfn (page); +struct page *page =pfn_to_page (pfn);if (is_zone_device_page (page)) { pr_debug_ratelimited("soft_offline: %#lx page is device page\n",
I think you should rebase that patch on linux-next (where the pfn_to_online_page() check is in place). I assume you'll want to move the pfn_to_online_page() check into soft_offline_page() then as well?
Signature · 3 lines
Thanks, David / dhildenb
Quoted 9 lines · David Hildenbrand
Quoted 8 lines · Naoya Horiguchi
Hi,
I wrote a simple cleanup for parameter of
soft_offline_page(), based on thread https://lkml.org/lkml/2019/10/11/57.I know that we need more cleanup on hwpoison-inject, but I think that will be mentioned in re-write patchset Oscar is preparing now. So let me shared only this part as a separate one now.
...
Quoted 4 lines
I think you should rebase that patch on linux-next (where the
pfn_to_online_page()check is in place). I assume you'll want to move thepfn_to_online_page()check intosoft_offline_page()then as well?
I rebased to next-20191016. And yes, we will move pfn_to_online_page() into soft offline code. It seems that we can also move pfn_valid(), but is simply moving like below good enough for you?
@@ -1877,11 +1877,17 @@ static int soft_offline_free_page(struct page *page)
* This is not a 100% solution for all memory, but tries to be
* ``good enough'' for the majority of memory.
*/
-int soft_offline_page(struct page *page, int flags)
+int soft_offline_page(unsigned long pfn, int flags)
{
int ret;
- unsigned long pfn = page_to_pfn(page);
+ struct page *page;
+ if (!pfn_valid(pfn))
+ return -ENXIO;
+ /* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */
+ if (!pfn_to_online_page(pfn))
+ return -EIO;
+ page = pfn_to_page(pfn);
if (is_zone_device_page(page)) {
pr_debug_ratelimited("soft_offline: %#lx page is device page\n",
pfn);
-- Or we might have an option to do as memory_failure() does like below:
int memory_failure(unsigned long pfn, int flags)
{
....
p = pfn_to_online_page(pfn);
if (!p) {
if (pfn_valid(pfn)) {
pgmap = get_dev_pagemap(pfn, NULL);
if (pgmap)
return memory_failure_dev_pagemap(pfn, flags,
pgmap);
}
pr_err("Memory failure: %#lx: memory outside kernel control\n",
pfn);
return -ENXIO;
}Thanks,
Naoya Horiguchi
Quoted 12 lines · Naoya Horiguchi
Quoted 9 lines · David Hildenbrand
Quoted 8 lines · Naoya Horiguchi
Hi,
I wrote a simple cleanup for parameter of
soft_offline_page(), based on thread https://lkml.org/lkml/2019/10/11/57.I know that we need more cleanup on hwpoison-inject, but I think that will be mentioned in re-write patchset Oscar is preparing now. So let me shared only this part as a separate one now.
...
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
I think you should rebase that patch on linux-next (where the
pfn_to_online_page()check is in place). I assume you'll want to move thepfn_to_online_page()check intosoft_offline_page()then as well?I rebased to next-20191016. And yes, we will move
pfn_to_online_page()into soft offline code. It seems that we can also movepfn_valid(), but is simply moving like below good enough for you?
At least I can't am the patch to current next/master (due to pfn_to_online_page()).
Quoted 23 lines
@@ -1877,11 +1877,17 @@ static int soft_offline_free_page(struct page *page)
* This is not a 100% solution for all memory, but tries to be
* ``good enough'' for the majority of memory.
*/
-int soft_offline_page(struct page *page, int flags)
+int soft_offline_page(unsigned long pfn, int flags)
{
int ret;
- unsigned long pfn = page_to_pfn(page);
+ struct page *page;
+ if (!pfn_valid(pfn))
+ return -ENXIO;
+ /* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */
+ if (!pfn_to_online_page(pfn))
+ return -EIO;
+ page = pfn_to_page(pfn);
if (is_zone_device_page(page)) {
pr_debug_ratelimited("soft_offline: %#lx page is device page\n",
pfn);
--Quoted 1 line
Or we might have an option to do as
memory_failure()does like below:
In contrast to soft offlining, memory failure can deal with devmem. So I think the above makes sense.
Signature · 3 lines
Thanks, David / dhildenb
Quoted 46 lines · David Hildenbrand
Quoted 12 lines · Naoya Horiguchi
Quoted 9 lines · David Hildenbrand
Quoted 8 lines · Naoya Horiguchi
Hi,
I wrote a simple cleanup for parameter of
soft_offline_page(), based on thread https://lkml.org/lkml/2019/10/11/57.I know that we need more cleanup on hwpoison-inject, but I think that will be mentioned in re-write patchset Oscar is preparing now. So let me shared only this part as a separate one now.
...
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
I think you should rebase that patch on linux-next (where the
pfn_to_online_page()check is in place). I assume you'll want to move thepfn_to_online_page()check intosoft_offline_page()then as well?I rebased to next-20191016. And yes, we will move
pfn_to_online_page()into soft offline code. It seems that we can also movepfn_valid(), but is simply moving like below good enough for you?At least I can't am the patch to current next/master (due to
pfn_to_online_page()).Quoted 22 lines
@@ -1877,11 +1877,17 @@ static int soft_offline_free_page(struct page *page) * This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page(struct page *page, int flags) +int soft_offline_page(unsigned long pfn, int flags) { int ret; - unsigned long pfn = page_to_pfn(page); + struct page *page; + if (!pfn_valid(pfn)) + return -ENXIO; + /* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + if (!pfn_to_online_page(pfn)) + return -EIO; + page = pfn_to_page(pfn); if (is_zone_device_page(page)) { pr_debug_ratelimited("soft_offline: %#lx page is device page\n", pfn); --
Quoted 4 lines
Quoted 1 line
Or we might have an option to do as
memory_failure()does like below:In contrast to soft offlining, memory failure can deal with devmem. So I think the above makes sense.
OK, so here's the revised one.
Thanks,
Naoya Horiguchi
---
From: Naoya Horiguchi <[email protected]>
Date: Wed, 16 Oct 2019 17:00:33 +0900
Subject: [PATCH] mm, soft-offline: convert parameter to pfn
Currently soft_offline_page() receives struct page, and its sibling memory_failure() receives pfn. This discrepancy looks weird and makes precheck on pfn validity tricky. So let's align them.
--- drivers/base/memory.c | 7 +------ include/linux/mm.h | 2 +- mm/madvise.c | 2 +- mm/memory-failure.c | 14 ++++++++++---- 4 files changed, 13 insertions(+), 12 deletions(-)
drivers/base/memory.c +1 -6
@@ -538,12 +538,7 @@ static ssize_t soft_offline_page_store(struct device *dev,if (kstrtoull (buf,0 , &pfn) <0 )return -EINVAL ; pfn >>=PAGE_SHIFT ; -if (!pfn_valid (pfn)) -return -ENXIO ; -/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ -if (!pfn_to_online_page (pfn)) -return -EIO ; - ret =soft_offline_page (pfn_to_page (pfn),0 ); + ret =soft_offline_page (pfn,0 );return ret ==0 ? count : ret; }
include/linux/mm.h +1 -1
@@ -2794,7 +2794,7 @@ extern int sysctl_memory_failure_early_kill;extern int sysctl_memory_failure_recovery;extern void shake_page (struct page *p,int access);extern atomic_long_t num_poisoned_pages__read_mostly ; -extern int soft_offline_page (struct page *page,int flags); +extern int soft_offline_page (unsigned long pfn,int flags);/*
mm/madvise.c +1 -1
@@ -887,7 +887,7 @@ static int madvise_inject_error(int behavior,pr_info ("Soft offlining pfn %#lx at process virtual address %#lx\n" , pfn, start); - ret =soft_offline_page (page,MF_COUNT_INCREASED ); + ret =soft_offline_page (pfn,MF_COUNT_INCREASED );if (ret)return ret;continue ;
mm/memory-failure.c +10 -4
@@ -1476,7 +1476,7 @@ static void memory_failure_work_func(struct work_struct *work)if (!gotten)break ;if (entry.flags &MF_SOFT_OFFLINE ) -soft_offline_page (pfn_to_page (entry.pfn), entry.flags); +soft_offline_page (entry.pfn, entry.flags);else memory_failure (entry.pfn, entry.flags); }
@@ -1857,7 +1857,7 @@ static int soft_offline_free_page(struct page *page)/** * soft_offline_page - Soft offline a page. -* @page: page to offline +* @pfn: pfn to soft-offline * @flags: flags. Same as memory_failure(). * * Returns 0 on success, otherwise negated errno.
@@ -1877,11 +1877,17 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page (struct page *page,int flags) +int soft_offline_page (unsigned long pfn,int flags) {int ret; -unsigned long pfn =page_to_pfn (page); +struct page *page; +if (!pfn_valid (pfn)) +return -ENXIO ; +/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + page =pfn_to_online_page (pfn); +if (!page) +return -EIO ;if (is_zone_device_page (page)) {pr_debug_ratelimited ("soft_offline: %#lx page is device page\n" , pfn);
Signature · 1 line
2.17.1
Quoted 18 lines · Naoya Horiguchi
Quoted 17 lines · David Hildenbrand
Quoted 16 lines · Naoya Horiguchi
Quoted 9 lines · David Hildenbrand
Quoted 8 lines · Naoya Horiguchi
Hi,
I wrote a simple cleanup for parameter of
soft_offline_page(), based on thread https://lkml.org/lkml/2019/10/11/57.I know that we need more cleanup on hwpoison-inject, but I think that will be mentioned in re-write patchset Oscar is preparing now. So let me shared only this part as a separate one now.
...
Quoted 4 lines
I think you should rebase that patch on linux-next (where the
pfn_to_online_page()check is in place). I assume you'll want to move thepfn_to_online_page()check intosoft_offline_page()then as well?
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
I rebased to next-20191016. And yes, we will move
pfn_to_online_page()into soft offline code. It seems that we can also movepfn_valid(), but is simply moving like below good enough for you?At least I can't am the patch to current next/master (due to
pfn_to_online_page()).
Could also be that my "git am" skills failed as the mail was not a proper patch itself :)
Quoted 123 lines
Quoted 23 lines
Quoted 23 lines
@@ -1877,11 +1877,17 @@ static int soft_offline_free_page(struct page *page) * This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page(struct page *page, int flags) +int soft_offline_page(unsigned long pfn, int flags) { int ret; - unsigned long pfn = page_to_pfn(page); + struct page *page; + if (!pfn_valid(pfn)) + return -ENXIO; + /* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + if (!pfn_to_online_page(pfn)) + return -EIO; + page = pfn_to_page(pfn); if (is_zone_device_page(page)) { pr_debug_ratelimited("soft_offline: %#lx page is device page\n", pfn); --Quoted 4 lines
Quoted 1 line
Or we might have an option to do as
memory_failure()does like below:In contrast to soft offlining, memory failure can deal with devmem. So I think the above makes sense.
OK, so here's the revised one.
Thanks,
Naoya Horiguchi
---
From: Naoya Horiguchi <[email protected]>
Date: Wed, 16 Oct 2019 17:00:33 +0900
Subject: [PATCH] mm, soft-offline: convert parameter to pfnCurrently
soft_offline_page()receives struct page, and its siblingmemory_failure()receives pfn. This discrepancy looks weird and makes precheck on pfn validity tricky. So let's align them.Signed-off-by Naoya Horiguchi <[email protected]>--- drivers/base/memory.c | 7 +------ include/linux/mm.h | 2 +- mm/madvise.c | 2 +- mm/memory-failure.c | 14 ++++++++++---- 4 files changed, 13 insertions(+), 12 deletions(-)drivers/base/memory.c +1
-6@@ -538,12 +538,7 @@ static ssize_t soft_offline_page_store(struct device *dev,if (kstrtoull (buf,0 , &pfn) <0 )return -EINVAL ; pfn >>=PAGE_SHIFT ; -if (!pfn_valid (pfn)) -return -ENXIO ; -/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ -if (!pfn_to_online_page (pfn)) -return -EIO ; - ret =soft_offline_page (pfn_to_page (pfn),0 ); + ret =soft_offline_page (pfn,0 );return ret ==0 ? count : ret; }include/linux/mm.h +1
-1@@ -2794,7 +2794,7 @@ extern int sysctl_memory_failure_early_kill;extern int sysctl_memory_failure_recovery;extern void shake_page (struct page *p,int access);extern atomic_long_t num_poisoned_pages__read_mostly ; -extern int soft_offline_page (struct page *page,int flags); +extern int soft_offline_page (unsigned long pfn,int flags);/* mm/madvise.c +1
-1@@ -887,7 +887,7 @@ static int madvise_inject_error(int behavior,pr_info ("Soft offlining pfn %#lx at process virtual address %#lx\n" , pfn, start); - ret =soft_offline_page (page,MF_COUNT_INCREASED ); + ret =soft_offline_page (pfn,MF_COUNT_INCREASED );if (ret)return ret;continue ;mm/memory-failure.c +3
-3@@ -1476,7 +1476,7 @@ static void memory_failure_work_func(struct work_struct *work)if (!gotten)break ;if (entry.flags &MF_SOFT_OFFLINE ) -soft_offline_page (pfn_to_page (entry.pfn), entry.flags); +soft_offline_page (entry.pfn, entry.flags);else memory_failure (entry.pfn, entry.flags); }@@ -1857,7 +1857,7 @@ static int soft_offline_free_page(struct page *page)/** * soft_offline_page - Soft offline a page. -* @page: page to offline +* @pfn: pfn to soft-offline * @flags: flags. Same as memory_failure(). * * Returns 0 on success, otherwise negated errno. @@ -1877,11 +1877,17 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page (struct page *page,int flags) +int soft_offline_page (unsigned long pfn,int flags) {int ret;
mm/memory-failure.c static int soft_offline_free_page(struct page *page) · line 1891
Quoted 10 lines
mm/memory-failure.c +7
-1-unsigned long pfn =page_to_pfn (page); +struct page *page; +if (!pfn_valid (pfn)) +return -ENXIO ; +/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + page =pfn_to_online_page (pfn); +if (!page) +return -EIO ;if (is_zone_device_page (page)) {
-> this is now no longer possible! So you can drop the whole if (is_zone_device....) case
mm/memory-failure.c static int soft_offline_free_page(struct page *page) · line 1893
Quoted 3 lines
mm/memory-failure.c +0
-0pr_debug_ratelimited ("soft_offline: %#lx page is device page\n" , pfn);
Apart from that, looks good to me.
Signature · 3 lines
Thanks, David / dhildenb
Naoya Horiguchi
reviewerQuoted 23 lines · David Hildenbrand
Quoted 22 lines · Naoya Horiguchi
Quoted 21 lines · David Hildenbrand
Quoted 19 lines · Naoya Horiguchi
Quoted 9 lines · David Hildenbrand
Quoted 8 lines · Naoya Horiguchi
Hi,
I wrote a simple cleanup for parameter of
soft_offline_page(), based on thread https://lkml.org/lkml/2019/10/11/57.I know that we need more cleanup on hwpoison-inject, but I think that will be mentioned in re-write patchset Oscar is preparing now. So let me shared only this part as a separate one now.
...
Quoted 4 lines
I think you should rebase that patch on linux-next (where the
pfn_to_online_page()check is in place). I assume you'll want to move thepfn_to_online_page()check intosoft_offline_page()then as well?I rebased to next-20191016. And yes, we will move
pfn_to_online_page()into soft offline code. It seems that we can also movepfn_valid(), but is simply moving like below good enough for you?
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
At least I can't am the patch to current next/master (due to
pfn_to_online_page()).Could also be that my "git am" skills failed as the mail was not a proper patch itself :)
Sorry for the inconvenience, my company email system breaks original message by introducing quoted-printable format ('=20' or '=3D'). Most mail client usually handles it but git-am doesn't.
I give up using it and send via smtp.gmail.com.
Quoted 12 lines
Quoted 12 lines
(quoted diff) +4
-2@@ -1877,11 +1877,17 @@ static int soft_offline_free_page(struct page *page) * This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page(struct page *page, int flags) +int soft_offline_page(unsigned long pfn, int flags) { int ret; - unsigned long pfn = page_to_pfn(page); + struct page *page; + if (!pfn_valid(pfn)) + return -ENXIO;
Quoted 8 lines
Review static int soft_offline_free_page(struct page *page) · line 1890
Quoted 5 lines
(quoted diff) +4
-0+ /* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + page = pfn_to_online_page(pfn); + if (!page) + return -EIO; if (is_zone_device_page(page)) {-> this is now no longer possible! So you can drop the whole if (
is_zone_device....) case
OK, thanks. I updated it.
Thanks,
Naoya Horiguchi
---
From 5faf227839b578726fe7f5ff414a153abb3b3a31 Mon Sep 17 00:00:00 2001
From: Naoya Horiguchi <[email protected]>
Date: Thu, 17 Oct 2019 08:40:53 +0900
Subject: [PATCH] mm, soft-offline: convert parameter to pfn
Currently soft_offline_page() receives struct page, and its sibling memory_failure() receives pfn. This discrepancy looks weird and makes precheck on pfn validity tricky. So let's align them.
--- drivers/base/memory.c | 7 +------ include/linux/mm.h | 2 +- mm/madvise.c | 2 +- mm/memory-failure.c | 19 +++++++++---------- 4 files changed, 12 insertions(+), 18 deletions(-)
drivers/base/memory.c +1 -6
@@ -538,12 +538,7 @@ static ssize_t soft_offline_page_store(struct device *dev,if (kstrtoull (buf,0 , &pfn) <0 )return -EINVAL ; pfn >>=PAGE_SHIFT ; -if (!pfn_valid (pfn)) -return -ENXIO ; -/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ -if (!pfn_to_online_page (pfn)) -return -EIO ; - ret =soft_offline_page (pfn_to_page (pfn),0 ); + ret =soft_offline_page (pfn,0 );return ret ==0 ? count : ret; }
include/linux/mm.h +1 -1
@@ -2794,7 +2794,7 @@ extern int sysctl_memory_failure_early_kill;extern int sysctl_memory_failure_recovery;extern void shake_page (struct page *p,int access);extern atomic_long_t num_poisoned_pages__read_mostly ; -extern int soft_offline_page (struct page *page,int flags); +extern int soft_offline_page (unsigned long pfn,int flags);/*
mm/madvise.c +1 -1
@@ -887,7 +887,7 @@ static int madvise_inject_error(int behavior,pr_info ("Soft offlining pfn %#lx at process virtual address %#lx\n" , pfn, start); - ret =soft_offline_page (page,MF_COUNT_INCREASED ); + ret =soft_offline_page (pfn,MF_COUNT_INCREASED );if (ret)return ret;continue ;
mm/memory-failure.c +9 -10
@@ -1476,7 +1476,7 @@ static void memory_failure_work_func(struct work_struct *work)if (!gotten)break ;if (entry.flags &MF_SOFT_OFFLINE ) -soft_offline_page (pfn_to_page (entry.pfn), entry.flags); +soft_offline_page (entry.pfn, entry.flags);else memory_failure (entry.pfn, entry.flags); }
@@ -1857,7 +1857,7 @@ static int soft_offline_free_page(struct page *page)/** * soft_offline_page - Soft offline a page. -* @page: page to offline +* @pfn: pfn to soft-offline * @flags: flags. Same as memory_failure(). * * Returns 0 on success, otherwise negated errno.
@@ -1877,18 +1877,17 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page (struct page *page,int flags) +int soft_offline_page (unsigned long pfn,int flags) {int ret; -unsigned long pfn =page_to_pfn (page); +struct page *page; -if (is_zone_device_page (page)) { -pr_debug_ratelimited ("soft_offline: %#lx page is device page\n" , - pfn); -if (flags &MF_COUNT_INCREASED ) -put_page (page); +if (!pfn_valid (pfn)) +return -ENXIO ; +/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + page =pfn_to_online_page (pfn); +if (!page)return -EIO ; - }if (PageHWPoison (page)) {pr_info ("soft offline: %#lx page already poisoned\n" , pfn);
Signature · 1 line
2.17.1
Quoted 155 lines · Naoya Horiguchi
Quoted 23 lines · David Hildenbrand
Quoted 22 lines · Naoya Horiguchi
Quoted 21 lines · David Hildenbrand
Quoted 19 lines · Naoya Horiguchi
Quoted 9 lines · David Hildenbrand
Quoted 8 lines · Naoya Horiguchi
Hi,
I wrote a simple cleanup for parameter of
soft_offline_page(), based on thread https://lkml.org/lkml/2019/10/11/57.I know that we need more cleanup on hwpoison-inject, but I think that will be mentioned in re-write patchset Oscar is preparing now. So let me shared only this part as a separate one now.
...
Quoted 4 lines
I think you should rebase that patch on linux-next (where the
pfn_to_online_page()check is in place). I assume you'll want to move thepfn_to_online_page()check intosoft_offline_page()then as well?I rebased to next-20191016. And yes, we will move
pfn_to_online_page()into soft offline code. It seems that we can also movepfn_valid(), but is simply moving like below good enough for you?Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
At least I can't am the patch to current next/master (due to
pfn_to_online_page()).Could also be that my "git am" skills failed as the mail was not a proper patch itself :)
Sorry for the inconvenience, my company email system breaks original message by introducing quoted-printable format ('=20' or '=3D'). Most mail client usually handles it but git-am doesn't.
I give up using it and send via smtp.gmail.com.Quoted 12 lines
Quoted 12 lines
mm/memory-failure.c +4
-2@@ -1877,11 +1877,17 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page (struct page *page,int flags) +int soft_offline_page (unsigned long pfn,int flags) {int ret; -unsigned long pfn =page_to_pfn (page); +struct page *page; +if (!pfn_valid (pfn)) +return -ENXIO ;Quoted 8 lines
mm/memory-failure.c static int soft_offline_free_page(struct page *page)
Quoted 5 lines
mm/memory-failure.c +4
-0+/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + page =pfn_to_online_page (pfn); +if (!page) +return -EIO ;if (is_zone_device_page (page)) {-> this is now no longer possible! So you can drop the whole if (
is_zone_device....) caseOK, thanks. I updated it.
Thanks,
Naoya Horiguchi
---
From5faf227839b578726fe7f5ff414a153abb3b3a31Mon Sep 17 00:00:00 2001
From: Naoya Horiguchi <[email protected]>
Date: Thu, 17 Oct 2019 08:40:53 +0900
Subject: [PATCH] mm, soft-offline: convert parameter to pfnCurrently
soft_offline_page()receives struct page, and its siblingmemory_failure()receives pfn. This discrepancy looks weird and makes precheck on pfn validity tricky. So let's align them.Signed-off-by Naoya Horiguchi <[email protected]>--- drivers/base/memory.c | 7 +------ include/linux/mm.h | 2 +- mm/madvise.c | 2 +- mm/memory-failure.c | 19 +++++++++---------- 4 files changed, 12 insertions(+), 18 deletions(-)drivers/base/memory.c +1
-6@@ -538,12 +538,7 @@ static ssize_t soft_offline_page_store(struct device *dev,if (kstrtoull (buf,0 , &pfn) <0 )return -EINVAL ; pfn >>=PAGE_SHIFT ; -if (!pfn_valid (pfn)) -return -ENXIO ; -/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ -if (!pfn_to_online_page (pfn)) -return -EIO ; - ret =soft_offline_page (pfn_to_page (pfn),0 ); + ret =soft_offline_page (pfn,0 );return ret ==0 ? count : ret; }include/linux/mm.h +1
-1@@ -2794,7 +2794,7 @@ extern int sysctl_memory_failure_early_kill;extern int sysctl_memory_failure_recovery;extern void shake_page (struct page *p,int access);extern atomic_long_t num_poisoned_pages__read_mostly ; -extern int soft_offline_page (struct page *page,int flags); +extern int soft_offline_page (unsigned long pfn,int flags);/* mm/madvise.c +1
-1@@ -887,7 +887,7 @@ static int madvise_inject_error(int behavior,pr_info ("Soft offlining pfn %#lx at process virtual address %#lx\n" , pfn, start); - ret =soft_offline_page (page,MF_COUNT_INCREASED ); + ret =soft_offline_page (pfn,MF_COUNT_INCREASED );if (ret)return ret;continue ;mm/memory-failure.c +4
-4@@ -1476,7 +1476,7 @@ static void memory_failure_work_func(struct work_struct *work)if (!gotten)break ;if (entry.flags &MF_SOFT_OFFLINE ) -soft_offline_page (pfn_to_page (entry.pfn), entry.flags); +soft_offline_page (entry.pfn, entry.flags);else memory_failure (entry.pfn, entry.flags); }@@ -1857,7 +1857,7 @@ static int soft_offline_free_page(struct page *page)/** * soft_offline_page - Soft offline a page. -* @page: page to offline +* @pfn: pfn to soft-offline * @flags: flags. Same as memory_failure(). * * Returns 0 on success, otherwise negated errno. @@ -1877,18 +1877,17 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page (struct page *page,int flags) +int soft_offline_page (unsigned long pfn,int flags) {int ret; -unsigned long pfn =page_to_pfn (page); +struct page *page;
mm/memory-failure.c static int soft_offline_free_page(struct page *page) · line 1889
Quoted 10 lines
mm/memory-failure.c +5
-5-if (is_zone_device_page (page)) { -pr_debug_ratelimited ("soft_offline: %#lx page is device page\n" , - pfn); -if (flags &MF_COUNT_INCREASED ) -put_page (page); +if (!pfn_valid (pfn)) +return -ENXIO ; +/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + page =pfn_to_online_page (pfn); +if (!page)
If you pass in a PFN with MF_COUNT_INCREASED via mm/madvise.c, you would now no longer do a put_page(page) in case of ZONE_DEVICE (!page = pfn_to_online_page(pfn);)
something like this
page = pfn_to_online_page(pfn);
if (!page) {
/*
* With MF_COUNT_INCREASED, we can use pfn_to_page() directly
* (esp., ZONE_DEVICE).
*/
if (flags & MF_COUNT_INCREASED)
put_page(pfn_to_page(page));
return -EIO;
}For !pfn_valid(pfn), this is not relevant.
Quoted 6 lines
mm/memory-failure.c +0
-1return -EIO ; - }if (PageHWPoison (page)) {pr_info ("soft offline: %#lx page already poisoned\n" , pfn);
Signature · 3 lines
Thanks, David / dhildenb
Quoted 156 lines · David Hildenbrand
Quoted 155 lines · Naoya Horiguchi
Quoted 23 lines · David Hildenbrand
Quoted 22 lines · Naoya Horiguchi
Quoted 21 lines · David Hildenbrand
Quoted 19 lines · Naoya Horiguchi
Quoted 9 lines · David Hildenbrand
Quoted 8 lines · Naoya Horiguchi
Hi,
I wrote a simple cleanup for parameter of
soft_offline_page(), based on thread https://lkml.org/lkml/2019/10/11/57.I know that we need more cleanup on hwpoison-inject, but I think that will be mentioned in re-write patchset Oscar is preparing now. So let me shared only this part as a separate one now.
...
Quoted 4 lines
I think you should rebase that patch on linux-next (where the
pfn_to_online_page()check is in place). I assume you'll want to move thepfn_to_online_page()check intosoft_offline_page()then as well?I rebased to next-20191016. And yes, we will move
pfn_to_online_page()into soft offline code. It seems that we can also movepfn_valid(), but is simply moving like below good enough for you?Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
At least I can't am the patch to current next/master (due to
pfn_to_online_page()).Could also be that my "git am" skills failed as the mail was not a proper patch itself :)
Sorry for the inconvenience, my company email system breaks original message by introducing quoted-printable format ('=20' or '=3D'). Most mail client usually handles it but git-am doesn't.
I give up using it and send via smtp.gmail.com.Quoted 12 lines
Quoted 12 lines
mm/memory-failure.c +4
-2@@ -1877,11 +1877,17 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page (struct page *page,int flags) +int soft_offline_page (unsigned long pfn,int flags) {int ret; -unsigned long pfn =page_to_pfn (page); +struct page *page; +if (!pfn_valid (pfn)) +return -ENXIO ;Quoted 8 lines
mm/memory-failure.c static int soft_offline_free_page(struct page *page)
Quoted 5 lines
mm/memory-failure.c +4
-0+/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + page =pfn_to_online_page (pfn); +if (!page) +return -EIO ;if (is_zone_device_page (page)) {-> this is now no longer possible! So you can drop the whole if (
is_zone_device....) caseOK, thanks. I updated it.
Thanks,
Naoya Horiguchi
---
From5faf227839b578726fe7f5ff414a153abb3b3a31Mon Sep 17 00:00:00 2001
From: Naoya Horiguchi <[email protected]>
Date: Thu, 17 Oct 2019 08:40:53 +0900
Subject: [PATCH] mm, soft-offline: convert parameter to pfnCurrently
soft_offline_page()receives struct page, and its siblingmemory_failure()receives pfn. This discrepancy looks weird and makes precheck on pfn validity tricky. So let's align them.Signed-off-by Naoya Horiguchi <[email protected]>--- drivers/base/memory.c | 7 +------ include/linux/mm.h | 2 +- mm/madvise.c | 2 +- mm/memory-failure.c | 19 +++++++++---------- 4 files changed, 12 insertions(+), 18 deletions(-)drivers/base/memory.c +1
-6@@ -538,12 +538,7 @@ static ssize_t soft_offline_page_store(struct device *dev,if (kstrtoull (buf,0 , &pfn) <0 )return -EINVAL ; pfn >>=PAGE_SHIFT ; -if (!pfn_valid (pfn)) -return -ENXIO ; -/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ -if (!pfn_to_online_page (pfn)) -return -EIO ; - ret =soft_offline_page (pfn_to_page (pfn),0 ); + ret =soft_offline_page (pfn,0 );return ret ==0 ? count : ret; }include/linux/mm.h +1
-1@@ -2794,7 +2794,7 @@ extern int sysctl_memory_failure_early_kill;extern int sysctl_memory_failure_recovery;extern void shake_page (struct page *p,int access);extern atomic_long_t num_poisoned_pages__read_mostly ; -extern int soft_offline_page (struct page *page,int flags); +extern int soft_offline_page (unsigned long pfn,int flags);/* mm/madvise.c +1
-1@@ -887,7 +887,7 @@ static int madvise_inject_error(int behavior,pr_info ("Soft offlining pfn %#lx at process virtual address %#lx\n" , pfn, start); - ret =soft_offline_page (page,MF_COUNT_INCREASED ); + ret =soft_offline_page (pfn,MF_COUNT_INCREASED );if (ret)return ret;continue ;mm/memory-failure.c +5
-9@@ -1476,7 +1476,7 @@ static void memory_failure_work_func(struct work_struct *work)if (!gotten)break ;if (entry.flags &MF_SOFT_OFFLINE ) -soft_offline_page (pfn_to_page (entry.pfn), entry.flags); +soft_offline_page (entry.pfn, entry.flags);else memory_failure (entry.pfn, entry.flags); }@@ -1857,7 +1857,7 @@ static int soft_offline_free_page(struct page *page)/** * soft_offline_page - Soft offline a page. -* @page: page to offline +* @pfn: pfn to soft-offline * @flags: flags. Same as memory_failure(). * * Returns 0 on success, otherwise negated errno. @@ -1877,18 +1877,17 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page (struct page *page,int flags) +int soft_offline_page (unsigned long pfn,int flags) {int ret; -unsigned long pfn =page_to_pfn (page); +struct page *page; -if (is_zone_device_page (page)) { -pr_debug_ratelimited ("soft_offline: %#lx page is device page\n" , - pfn); -if (flags &MF_COUNT_INCREASED ) -put_page (page); +if (!pfn_valid (pfn))
Quoted 8 lines
mm/memory-failure.c static int soft_offline_free_page(struct page *page) · line 1889
Quoted 4 lines
mm/memory-failure.c +4
-0+return -ENXIO ; +/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + page =pfn_to_online_page (pfn); +if (!page)If you pass in a PFN with
MF_COUNT_INCREASEDviamm/madvise.c, you would now no longer do aput_page(page)in case ofZONE_DEVICE(!page =pfn_to_online_page(pfn);)
Yes, right.
Quoted 14 lines
something like this
page =
pfn_to_online_page(pfn);if (!page) { /* * With MF_COUNT_INCREASED, we can use pfn_to_page() directly * (esp., ZONE_DEVICE). */ if (flags & MF_COUNT_INCREASED) put_page(pfn_to_page(page)); return -EIO; }
Quoted 1 line
For !pfn_valid(pfn), this is not relevant.
Actually I guess that !pfn_valid() never happens when called from madvise_inject_error(), because madvise_inject_error() gets pfn via get_user_pages_fast() which only returns valid page for valid pfn.
And we plan to remove MF_COUNT_INCREASED by Oscar's re-design work, so I start feeling that this patch should come on top of his tree.
Thanks,
Naoya Horiguchi
Quoted 182 lines · Naoya Horiguchi
Quoted 156 lines · David Hildenbrand
Quoted 155 lines · Naoya Horiguchi
Quoted 23 lines · David Hildenbrand
Quoted 22 lines · Naoya Horiguchi
Quoted 21 lines · David Hildenbrand
Quoted 19 lines · Naoya Horiguchi
Quoted 9 lines · David Hildenbrand
Quoted 8 lines · Naoya Horiguchi
Hi,
I wrote a simple cleanup for parameter of
soft_offline_page(), based on thread https://lkml.org/lkml/2019/10/11/57.I know that we need more cleanup on hwpoison-inject, but I think that will be mentioned in re-write patchset Oscar is preparing now. So let me shared only this part as a separate one now.
...
Quoted 4 lines
I think you should rebase that patch on linux-next (where the
pfn_to_online_page()check is in place). I assume you'll want to move thepfn_to_online_page()check intosoft_offline_page()then as well?I rebased to next-20191016. And yes, we will move
pfn_to_online_page()into soft offline code. It seems that we can also movepfn_valid(), but is simply moving like below good enough for you?Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
At least I can't am the patch to current next/master (due to
pfn_to_online_page()).Could also be that my "git am" skills failed as the mail was not a proper patch itself :)
Sorry for the inconvenience, my company email system breaks original message by introducing quoted-printable format ('=20' or '=3D'). Most mail client usually handles it but git-am doesn't.
I give up using it and send via smtp.gmail.com.Quoted 12 lines
Quoted 12 lines
mm/memory-failure.c +4
-2@@ -1877,11 +1877,17 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page (struct page *page,int flags) +int soft_offline_page (unsigned long pfn,int flags) {int ret; -unsigned long pfn =page_to_pfn (page); +struct page *page; +if (!pfn_valid (pfn)) +return -ENXIO ;Quoted 8 lines
mm/memory-failure.c static int soft_offline_free_page(struct page *page)
Quoted 5 lines
mm/memory-failure.c +4
-0+/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + page =pfn_to_online_page (pfn); +if (!page) +return -EIO ;if (is_zone_device_page (page)) {-> this is now no longer possible! So you can drop the whole if (
is_zone_device....) caseOK, thanks. I updated it.
Thanks,
Naoya Horiguchi
---
From5faf227839b578726fe7f5ff414a153abb3b3a31Mon Sep 17 00:00:00 2001
From: Naoya Horiguchi <[email protected]>
Date: Thu, 17 Oct 2019 08:40:53 +0900
Subject: [PATCH] mm, soft-offline: convert parameter to pfnCurrently
soft_offline_page()receives struct page, and its siblingmemory_failure()receives pfn. This discrepancy looks weird and makes precheck on pfn validity tricky. So let's align them.Signed-off-by Naoya Horiguchi <[email protected]>--- drivers/base/memory.c | 7 +------ include/linux/mm.h | 2 +- mm/madvise.c | 2 +- mm/memory-failure.c | 19 +++++++++---------- 4 files changed, 12 insertions(+), 18 deletions(-)drivers/base/memory.c +1
-6@@ -538,12 +538,7 @@ static ssize_t soft_offline_page_store(struct device *dev,if (kstrtoull (buf,0 , &pfn) <0 )return -EINVAL ; pfn >>=PAGE_SHIFT ; -if (!pfn_valid (pfn)) -return -ENXIO ; -/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ -if (!pfn_to_online_page (pfn)) -return -EIO ; - ret =soft_offline_page (pfn_to_page (pfn),0 ); + ret =soft_offline_page (pfn,0 );return ret ==0 ? count : ret; }include/linux/mm.h +1
-1@@ -2794,7 +2794,7 @@ extern int sysctl_memory_failure_early_kill;extern int sysctl_memory_failure_recovery;extern void shake_page (struct page *p,int access);extern atomic_long_t num_poisoned_pages__read_mostly ; -extern int soft_offline_page (struct page *page,int flags); +extern int soft_offline_page (unsigned long pfn,int flags);/* mm/madvise.c +1
-1@@ -887,7 +887,7 @@ static int madvise_inject_error(int behavior,pr_info ("Soft offlining pfn %#lx at process virtual address %#lx\n" , pfn, start); - ret =soft_offline_page (page,MF_COUNT_INCREASED ); + ret =soft_offline_page (pfn,MF_COUNT_INCREASED );if (ret)return ret;continue ;mm/memory-failure.c +5
-9@@ -1476,7 +1476,7 @@ static void memory_failure_work_func(struct work_struct *work)if (!gotten)break ;if (entry.flags &MF_SOFT_OFFLINE ) -soft_offline_page (pfn_to_page (entry.pfn), entry.flags); +soft_offline_page (entry.pfn, entry.flags);else memory_failure (entry.pfn, entry.flags); }@@ -1857,7 +1857,7 @@ static int soft_offline_free_page(struct page *page)/** * soft_offline_page - Soft offline a page. -* @page: page to offline +* @pfn: pfn to soft-offline * @flags: flags. Same as memory_failure(). * * Returns 0 on success, otherwise negated errno. @@ -1877,18 +1877,17 @@ static int soft_offline_free_page(struct page *page)* This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page (struct page *page,int flags) +int soft_offline_page (unsigned long pfn,int flags) {int ret; -unsigned long pfn =page_to_pfn (page); +struct page *page; -if (is_zone_device_page (page)) { -pr_debug_ratelimited ("soft_offline: %#lx page is device page\n" , - pfn); -if (flags &MF_COUNT_INCREASED ) -put_page (page); +if (!pfn_valid (pfn))Quoted 8 lines
mm/memory-failure.c static int soft_offline_free_page(struct page *page) · line 1889
Quoted 4 lines
mm/memory-failure.c +4
-0+return -ENXIO ; +/* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ + page =pfn_to_online_page (pfn); +if (!page)If you pass in a PFN with
MF_COUNT_INCREASEDviamm/madvise.c, you would now no longer do aput_page(page)in case ofZONE_DEVICE(!page =pfn_to_online_page(pfn);)Yes, right.
Quoted 14 lines
something like this
page =
pfn_to_online_page(pfn);if (!page) { /* * With MF_COUNT_INCREASED, we can use pfn_to_page() directly * (esp., ZONE_DEVICE). */ if (flags & MF_COUNT_INCREASED) put_page(pfn_to_page(page)); return -EIO; }
Quoted 8 lines
Quoted 1 line
For !pfn_valid(pfn), this is not relevant.
Actually I guess that !pfn_valid() never happens when called from
madvise_inject_error(), becausemadvise_inject_error()gets pfn viaget_user_pages_fast()which only returns valid page for valid pfn.And we plan to remove
MF_COUNT_INCREASEDby Oscar's re-design work, so I start feeling that this patch should come on top of his tree.
I agree, let's clean that up first.
Signature · 3 lines
Thanks, David / dhildenb
Oscar Salvador
maintainerQuoted 6 lines · Naoya Horiguchi
Actually I guess that !pfn_valid() never happens when called from
madvise_inject_error(), becausemadvise_inject_error()gets pfn viaget_user_pages_fast()which only returns valid page for valid pfn.And we plan to remove
MF_COUNT_INCREASEDby Oscar's re-design work, so I start feeling that this patch should come on top of his tree.
Hi Naoya,
I am pretty much done with my testing.
If you feel like, I can take the patch and add it on top of [1] , then I will do some more testing and, if nothing pops up, I will send it upstream.
[1] https://github.com/leberus/linux/tree/hwpoison-v2
Quoted 3 lines
Thanks,
Naoya Horiguchi
Signature · 2 lines
Oscar Salvador SUSE L3
Quoted 8 lines · Oscar Salvador
Quoted 6 lines · Naoya Horiguchi
Actually I guess that !pfn_valid() never happens when called from
madvise_inject_error(), becausemadvise_inject_error()gets pfn viaget_user_pages_fast()which only returns valid page for valid pfn.And we plan to remove
MF_COUNT_INCREASEDby Oscar's re-design work, so I start feeling that this patch should come on top of his tree.
Quoted 6 lines
Hi Naoya,
I am pretty much done with my testing.
If you feel like, I can take the patch and add it on top of [1] , then I will do some more testing and, if nothing pops up, I will send it upstream.
Hi Oscar,
Yes, please take it, thank you for speaking up.