[linux-next RFC] mm/gup.c: Convert to use get_user_pages_fast_only()
John Hubbard
jhubbard at nvidia.com
Sun May 24 08:18:41 AEST 2020
On 2020-05-23 12:35, Souptick Joarder wrote:
...
>> Everything you have done here is an improvement, and I'd be happy to
>> see it go in (after fixing the bug I note below).
>>
>> But in reading through it, I noticed almost every user ...
>>
>>> - if (__get_user_pages_fast(hva, 1, 1, &page) == 1) {
>>> + if (get_user_pages_fast_only(hva, 1, FOLL_WRITE, &page) == 1) {
>>
>> passes '1' as the second parameter. So do we want to add:
>>
>> static inline bool get_user_page_fast_only(unsigned long addr,
>> unsigned int gup_flags, struct page **pagep)
>> {
>> return get_user_pages_fast_only(addr, 1, gup_flags, pagep) == 1;
>> }
>>
> Yes, this can be added. Does get_user_page_fast_only() naming is fine ?
It seems like a good name to me. And I think that the new wrapper call is
a good move, too.
I did pause and reflect for a moment about the number gup/pup API calls we
are building up, but that's merely an indication of the wide usage of this
functionality. So it all feels about right.
thanks,
--
John Hubbard
NVIDIA
More information about the Linuxppc-dev
mailing list