[lkml]   [2020]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] mm: remove extra ZONE_DEVICE struct page refcount
On Tue, Sep 15, 2020 at 09:39:47AM -0700, Ralph Campbell wrote:
>> I don't think any of the three ->page_free instances even cares about
>> the page refcount.
> Not true. The page_free() callback records the page is free by setting
> a bit or putting the page on a free list but when it allocates a free
> device private struct page to be used with migrate_vma_setup(), it needs to
> increment the refcount.
> struct pages, I think you are correct because they don't define page_free()
> and from what I can see, don't decrement the page refcount to zero.

Umm, the whole point of ZONE_DEVICE is to have a struct page for
something that is not system memory. For both the ppc kvm case (magic
hypervisor pool) and Noveau (device internal) memory that clear is the
case. But looks like test_hmm uses normal pages to fake this up, so
I was wrong about the third caller. But I think we can just call
set_page_count just before freeing the page there with a comment
explaining what is goin on.

 \ /
  Last update: 2020-09-16 07:38    [W:0.061 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site