[PATCH V4 1/6] mm: Introduce a general RCU get_user_pages_fast.
steve.capper at linaro.org
Thu Oct 2 09:18:00 PDT 2014
On 2 October 2014 19:19, Andrea Arcangeli <aarcange at redhat.com> wrote:
> Hi Steve,
> On Fri, Sep 26, 2014 at 03:03:48PM +0100, Steve Capper wrote:
>> This patch provides a general RCU implementation of get_user_pages_fast
>> that can be used by architectures that perform hardware broadcast of
>> TLB invalidations.
>> It is based heavily on the PowerPC implementation by Nick Piggin.
> It'd be nice if you could also at the same time apply it to sparc and
> powerpc in this same patchset to show the effectiveness of having a
> generic version. Because if it's not a trivial drop-in replacement,
> then this should go in arch/arm* instead of mm/gup.c...
I think it should be adapted (if need be) and adopted for sparc, power
and others, especially as it will result in a reduction in code size
and make future alterations to gup easier.
I would prefer to get this in iteratively; and have people who are
knowledgeable of those architectures and have a means of testing the
code thoroughly to help out. (it will be very hard for me to implement
this on my own, but likely trivial for people who know and can test
> Also I wonder if it wouldn't be better to add it to mm/util.c along
> with the __weak gup_fast but then this is ok too. I'm just saying
> because we never had sings of gup_fast code in mm/gup.c so far but
> then this isn't exactly a __weak version of it... so I don't mind
> either ways.
mm/gup.c was recently created?
It may even make sense to move the weak version in a future patch?
>> + down_read(&mm->mmap_sem);
>> + ret = get_user_pages(current, mm, start,
>> + nr_pages - nr, write, 0, pages, NULL);
>> + up_read(&mm->mmap_sem);
> This has a collision with a patchset I posted, but it's trivial to
> solve, the above three lines need to be replaced with:
> + ret = get_user_pages_unlocked(current, mm, start,
> + nr_pages - nr, write, 0, pages);
> And then arm gup_fast will also page fault with FOLL_FAULT_ALLOW_RETRY
> the first time to release the mmap_sem before I/O.
I'm currently on holiday and have very limited access to email, I'd
appreciate it if someone can keep an eye out for this during the merge
window if this conflict arises?
More information about the linux-arm-kernel