[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cb3e2acc-0a83-4053-fbcc-6d75dc47f174@nvidia.com>
Date: Fri, 29 Nov 2019 13:44:53 -0800
From: John Hubbard <jhubbard@...dia.com>
To: Jan Kara <jack@...e.cz>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Alex Williamson <alex.williamson@...hat.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Björn Töpel <bjorn.topel@...el.com>,
Christoph Hellwig <hch@...radead.org>,
Dan Williams <dan.j.williams@...el.com>,
Daniel Vetter <daniel@...ll.ch>,
Dave Chinner <david@...morbit.com>,
David Airlie <airlied@...ux.ie>,
"David S . Miller" <davem@...emloft.net>,
Ira Weiny <ira.weiny@...el.com>,
Jason Gunthorpe <jgg@...pe.ca>, Jens Axboe <axboe@...nel.dk>,
Jonathan Corbet <corbet@....net>,
Jérôme Glisse <jglisse@...hat.com>,
Magnus Karlsson <magnus.karlsson@...el.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>,
Michal Hocko <mhocko@...e.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Paul Mackerras <paulus@...ba.org>,
Shuah Khan <shuah@...nel.org>,
Vlastimil Babka <vbabka@...e.cz>, <bpf@...r.kernel.org>,
<dri-devel@...ts.freedesktop.org>, <kvm@...r.kernel.org>,
<linux-block@...r.kernel.org>, <linux-doc@...r.kernel.org>,
<linux-fsdevel@...r.kernel.org>, <linux-kselftest@...r.kernel.org>,
<linux-media@...r.kernel.org>, <linux-rdma@...r.kernel.org>,
<linuxppc-dev@...ts.ozlabs.org>, <netdev@...r.kernel.org>,
<linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 17/19] powerpc: book3s64: convert to pin_user_pages()
and put_user_page()
On 11/29/19 3:23 AM, Jan Kara wrote:
> On Mon 25-11-19 15:10:33, John Hubbard wrote:
>> 1. Convert from get_user_pages() to pin_user_pages().
>>
>> 2. As required by pin_user_pages(), release these pages via
>> put_user_page(). In this case, do so via put_user_pages_dirty_lock().
>>
>> That has the side effect of calling set_page_dirty_lock(), instead
>> of set_page_dirty(). This is probably more accurate.
>
> Maybe more accurate but it doesn't work for mm_iommu_unpin(). As I'm
> checking mm_iommu_unpin() gets called from RCU callback which is executed
> interrupt context and you cannot lock pages from such context. So you need
> to queue work from the RCU callback and then do the real work from the
> workqueue...
>
> Honza
ah yes, fixed locally. (In order to avoid distracting people during the merge
window, I won't post any more versions of the series until the merge window is
over, unless a maintainer tells me that any of these patches are desired for
5.5.)
With that, we are back to a one-line diff for this part:
@@ -215,7 +214,7 @@ static void mm_iommu_unpin(struct mm_iommu_table_group_mem_t *mem)
if (mem->hpas[i] & MM_IOMMU_TABLE_GROUP_PAGE_DIRTY)
SetPageDirty(page);
- put_page(page);
+ put_user_page(page);
mem->hpas[i] = 0;
}
}
btw, I'm also working on your feedback for patch 17 (mm/gup: track FOLL_PIN pages [1]),
from a few days earlier, it's not being ignored, I'm just trying to avoid distracting
people during the merge window.
[1] https://lore.kernel.org/r/20191121093941.GA18190@quack2.suse.cz
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists