[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7a55366f-bd65-7ab9-be9e-3bfd3aea3ea1@amd.com>
Date: Mon, 16 Aug 2021 15:00:49 -0400
From: Felix Kuehling <felix.kuehling@....com>
To: Christoph Hellwig <hch@....de>, Alex Sierra <alex.sierra@....com>
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org,
rcampbell@...dia.com, linux-ext4@...r.kernel.org,
linux-xfs@...r.kernel.org, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, jgg@...dia.com,
jglisse@...hat.com, Roger Pau Monne <roger.pau@...rix.com>,
Dan Williams <dan.j.williams@...el.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>
Subject: Re: [PATCH v6 08/13] mm: call pgmap->ops->page_free for
DEVICE_GENERIC pages
Am 2021-08-15 um 11:40 a.m. schrieb Christoph Hellwig:
> On Fri, Aug 13, 2021 at 01:31:45AM -0500, Alex Sierra wrote:
>> Add MEMORY_DEVICE_GENERIC case to free_zone_device_page callback.
>> Device generic type memory case is now able to free its pages properly.
> How is this going to work for the two existing MEMORY_DEVICE_GENERIC
> that now change behavior? And which don't have a ->page_free callback
> at all?
That's a good catch. Existing drivers shouldn't need a page_free
callback if they didn't have one before. That means we need to add a
NULL-pointer check in free_device_page.
Regards,
Felix
>
>> Signed-off-by: Alex Sierra <alex.sierra@....com>
>> ---
>> mm/memremap.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/mm/memremap.c b/mm/memremap.c
>> index 5aa8163fd948..5773e15b6ac9 100644
>> --- a/mm/memremap.c
>> +++ b/mm/memremap.c
>> @@ -459,7 +459,7 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn,
>> EXPORT_SYMBOL_GPL(get_dev_pagemap);
>>
>> #ifdef CONFIG_DEV_PAGEMAP_OPS
>> -static void free_device_private_page(struct page *page)
>> +static void free_device_page(struct page *page)
>> {
>>
>> __ClearPageWaiters(page);
>> @@ -498,7 +498,8 @@ void free_zone_device_page(struct page *page)
>> wake_up_var(&page->_refcount);
>> return;
>> case MEMORY_DEVICE_PRIVATE:
>> - free_device_private_page(page);
>> + case MEMORY_DEVICE_GENERIC:
>> + free_device_page(page);
>> return;
>> default:
>> return;
>> --
>> 2.32.0
> ---end quoted text---
>
Powered by blists - more mailing lists