[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c78962ba-ffa1-90e2-0116-6c94d082de2f@redhat.com>
Date: Wed, 16 Oct 2019 10:34:52 +0200
From: David Hildenbrand <david@...hat.com>
To: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Cc: "linux-mm@...ck.org" <linux-mm@...ck.org>,
Michal Hocko <mhocko@...nel.org>,
Oscar Salvador <osalvador@...e.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] mm, soft-offline: convert parameter to pfn
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 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.
> ...
>>
>> 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?
>
> 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?
At least I can't am the patch to current next/master (due to
pfn_to_online_page()).
>
> @@ -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:
In contrast to soft offlining, memory failure can deal with devmem. So I
think the above makes sense.
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists