Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-17 Thread Naoya Horiguchi
On Thu, Oct 17, 2019 at 10:03:21AM +0200, Oscar Salvador wrote: > On Thu, Oct 17, 2019 at 07:50:18AM +, Naoya Horiguchi wrote: > > 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()

Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-17 Thread David Hildenbrand
OK, thanks. I updated it. Thanks, Naoya Horiguchi --- From 5faf227839b578726fe7f5ff414a153abb3b3a31 Mon Sep 17 00:00:00 2001 From: Naoya Horiguchi Date: Thu, 17 Oct 2019 08:40:53 +0900 Subject: [PATCH] mm, soft-offline: convert parameter to pfn Currently soft_offline_page() receives struct

Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-17 Thread Oscar Salvador
On Thu, Oct 17, 2019 at 07:50:18AM +, Naoya Horiguchi wrote: > 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

Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-17 Thread Naoya Horiguchi
> +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)) > > >

Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-17 Thread David Hildenbrand
00:00:00 2001 From: Naoya Horiguchi 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 tri

Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-16 Thread Naoya Horiguchi
e); > >+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; >

Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-16 Thread David Hildenbrand
st 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 Date: Wed, 16 Oct 2019 17:00:33 +0900 Subject: [PATCH] mm, soft-offline: convert parameter to pfn Currently soft_offline_pa

Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-16 Thread Naoya Horiguchi
t; pfn); > >-- > > > > 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 on

Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-16 Thread David Hildenbrand
On 16.10.19 10:27, Naoya Horiguchi wrote: On Wed, Oct 16, 2019 at 09:56:19AM +0200, David Hildenbrand wrote: On 16.10.19 09:09, Naoya Horiguchi wrote: 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

Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-16 Thread Naoya Horiguchi
On Wed, Oct 16, 2019 at 09:56:19AM +0200, David Hildenbrand wrote: > On 16.10.19 09:09, Naoya Horiguchi wrote: > > 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

Re: [PATCH] mm, soft-offline: convert parameter to pfn

2019-10-16 Thread David Hildenbrand
. So let me shared only this part as a separate one now. Thanks, Naoya Horiguchi --- From: Naoya Horiguchi 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

[PATCH] mm, soft-offline: convert parameter to pfn

2019-10-16 Thread Naoya Horiguchi
as a separate one now. Thanks, Naoya Horiguchi --- From: Naoya Horiguchi 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