RE: [PATCH] arm: mm: lockless get_user_pages_fast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Steve Capper [mailto:steve.capper@xxxxxxx]
> Sent: Wednesday, April 10, 2013 5:21 PM
> To: Chanho Park
> Cc: Steve Capper; 'Chanho Park'; linux@xxxxxxxxxxxxxxxx; Catalin Marinas;
> 'Inki Dae'; linux-mm@xxxxxxxxx; 'Kyungmin Park'; 'Myungjoo Ham'; linux-
> arm-kernel@xxxxxxxxxxxxxxxxxxx; 'Grazvydas Ignotas'
> Subject: Re: [PATCH] arm: mm: lockless get_user_pages_fast
> 
> On Wed, Apr 10, 2013 at 08:30:54AM +0100, Chanho Park wrote:
> > > Apologies for the tardy response, this patch slipped past me.
> >
> > Never mind.
> >
> > > I've tested this patch out, unfortunately it treats huge pmds as
> > > regular pmds and attempts to traverse them rather than fall back to a
> slow path.
> > > The fix for this is very minor, please see my suggestion below.
> > OK. I'll fix it.
> >
> > >
> > > As an aside, I would like to extend this fast_gup to include full
> > > huge page support and include a __get_user_pages_fast
> > > implementation. This will hopefully fix a problem that was brought
> > > to my attention by Grazvydas Ignotas whereby a FUTEX_WAIT on a THP
> > > tail page will cause an infinite loop due to the stock
> > > implementation of __get_user_pages_fast always returning 0.
> >
> > I'll add the __get_user_pages_fast implementation. BTW, HugeTLB on ARM
> > wasn't supported yet. There is no problem to add gup_huge_pmd. But I
> > think it need a test for hugepages.
> >
> 
> Thanks, that would be helpful. My plan was to then put the huge page
> specific bits in, with another patch. That way I can test it all out here.

Can I see the patch? I think it will be helpful to implement the
gup_huge_pmd.
Or how about you think except gup_huge_pmd in this patch?
IMO it will be added easily after hugetlb on arm is merged.

> 
> > > I would suggest:
> > > 		if (pmd_none(*pmdp) || pmd_bad(*pmdp))
> > > 			return 0;
> > > as this will pick up pmds that can't be traversed, and fall back to
> > > the slow path.
> >
> > Thanks for your suggestion.
> > I'll prepare the v2 patch.
> >
> 
> Also, just one more thing. In your gup_pte_range function there is an
> smp_rmb() just after the pte is dereferenced. I don't understand why
> though?

I think it would be needed for 64 bit machine. A pte of 64bit machine
consists of low and high value. In this version, there is no need to add it.
I'll remove it. Thanks.

Best regards,
Chanho Park

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]