[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d9a9c57-4322-270b-b636-7214019f87e9@nvidia.com>
Date: Fri, 2 Aug 2019 11:48:08 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
<john.hubbard@...il.com>
CC: Christoph Hellwig <hch@...radead.org>,
Dan Williams <dan.j.williams@...el.com>,
Dave Chinner <david@...morbit.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ira Weiny <ira.weiny@...el.com>, Jan Kara <jack@...e.cz>,
Jason Gunthorpe <jgg@...pe.ca>,
Jérôme Glisse <jglisse@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
<amd-gfx@...ts.freedesktop.org>, <ceph-devel@...r.kernel.org>,
<devel@...verdev.osuosl.org>, <devel@...ts.orangefs.org>,
<dri-devel@...ts.freedesktop.org>,
<intel-gfx@...ts.freedesktop.org>, <kvm@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-block@...r.kernel.org>, <linux-crypto@...r.kernel.org>,
<linux-fbdev@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
<linux-media@...r.kernel.org>, <linux-mm@...ck.org>,
<linux-nfs@...r.kernel.org>, <linux-rdma@...r.kernel.org>,
<linux-rpi-kernel@...ts.infradead.org>,
<linux-xfs@...r.kernel.org>, <netdev@...r.kernel.org>,
<rds-devel@....oracle.com>, <sparclinux@...r.kernel.org>,
<x86@...nel.org>, <xen-devel@...ts.xenproject.org>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
David Airlie <airlied@...ux.ie>
Subject: Re: [PATCH 06/34] drm/i915: convert put_page() to put_user_page*()
On 8/2/19 2:19 AM, Joonas Lahtinen wrote:
> Quoting john.hubbard@...il.com (2019-08-02 05:19:37)
>> From: John Hubbard <jhubbard@...dia.com>
>>
>> For pages that were retained via get_user_pages*(), release those pages
>> via the new put_user_page*() routines, instead of via put_page() or
>> release_pages().
>>
>> This is part a tree-wide conversion, as described in commit fc1d8e7cca2d
>> ("mm: introduce put_user_page*(), placeholder versions").
>>
>> Note that this effectively changes the code's behavior in
>> i915_gem_userptr_put_pages(): it now calls set_page_dirty_lock(),
>> instead of set_page_dirty(). This is probably more accurate.
>
> We've already fixed this in drm-tip where the current code uses
> set_page_dirty_lock().
>
> This would conflict with our tree. Rodrigo is handling
> drm-intel-next for 5.4, so you guys want to coordinate how
> to merge.
>
Hi Joonas, Rodrigo,
First of all, I apologize for the API breakage: put_user_pages_dirty_lock()
has an additional "dirty" parameter.
In order to deal with the merge problem, I'll drop this patch from my series,
and I'd recommend that the drm-intel-next take the following approach:
1) For now, s/put_page/put_user_page/ in i915_gem_userptr_put_pages(),
and fix up the set_page_dirty() --> set_page_dirty_lock() issue, like this
(based against linux.git):
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
index 528b61678334..94721cc0093b 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
@@ -664,10 +664,10 @@ i915_gem_userptr_put_pages(struct drm_i915_gem_object *obj,
for_each_sgt_page(page, sgt_iter, pages) {
if (obj->mm.dirty)
- set_page_dirty(page);
+ set_page_dirty_lock(page);
mark_page_accessed(page);
- put_page(page);
+ put_user_page(page);
}
obj->mm.dirty = false;
That will leave you with your original set_page_dirty_lock() calls
and everything works properly.
2) Next cycle, move to the new put_user_pages_dirty_lock().
thanks,
--
John Hubbard
NVIDIA
> Regards, Joonas
>
Powered by blists - more mailing lists