Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-17 Thread Dan Williams
On Wed, Sep 16, 2020 at 5:29 PM Ralph Campbell wrote: > > > On 9/15/20 10:36 PM, Christoph Hellwig wrote: > > 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.

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-17 Thread Christoph Hellwig
On Mon, Sep 14, 2020 at 04:10:38PM -0700, Dan Williams wrote: > You also need to fix up ext4_break_layouts() and > xfs_break_dax_layouts() to expect ->_refcount is 0 instead of 1. This > also needs some fstests exposure. While we're at it, can we add a wait_fsdax_unref helper macro that hides the

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-17 Thread Ralph Campbell
On 9/15/20 10:36 PM, Christoph Hellwig wrote: 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

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-17 Thread Christoph Hellwig
> diff --git a/include/linux/mm.h b/include/linux/mm.h > index 517751310dd2..5a82037a4b26 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -1093,34 +1093,6 @@ static inline bool is_zone_device_page(const struct > page *page) > #ifdef CONFIG_DEV_PAGEMAP_OPS > void

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-16 Thread Ralph Campbell
On 9/15/20 11:10 PM, Christoph Hellwig wrote: On Mon, Sep 14, 2020 at 04:10:38PM -0700, Dan Williams wrote: You also need to fix up ext4_break_layouts() and xfs_break_dax_layouts() to expect ->_refcount is 0 instead of 1. This also needs some fstests exposure. While we're at it, can we add

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-16 Thread Ralph Campbell
On 9/15/20 11:09 PM, Christoph Hellwig wrote: diff --git a/include/linux/mm.h b/include/linux/mm.h index 517751310dd2..5a82037a4b26 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1093,34 +1093,6 @@ static inline bool is_zone_device_page(const struct page *page) #ifdef

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-15 Thread Christoph Hellwig
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

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-15 Thread Ralph Campbell
On 9/15/20 9:29 AM, Christoph Hellwig wrote: On Mon, Sep 14, 2020 at 04:53:25PM -0700, Ralph Campbell wrote: Since set_page_refcounted() is defined in mm_interal.h I would have to move the definition to someplace like page_ref.h or have the drivers cal init_page_count() or set_page_count()

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-15 Thread Christoph Hellwig
On Mon, Sep 14, 2020 at 04:53:25PM -0700, Ralph Campbell wrote: > Since set_page_refcounted() is defined in mm_interal.h I would have to > move the definition to someplace like page_ref.h or have the drivers > cal init_page_count() or set_page_count() since get_page() calls > VM_BUG_ON_PAGE() if

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-14 Thread Dan Williams
On Mon, Sep 14, 2020 at 3:45 PM Ralph Campbell wrote: > > ZONE_DEVICE struct pages have an extra reference count that complicates the > code for put_page() and several places in the kernel that need to check the > reference count to see that a page is not being used (gup, compaction, > migration,