Re: [PATCHv2 1/2] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

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

 



On 6/3/19 9:42 AM, Christoph Hellwig wrote:
>> +#if defined(CONFIG_CMA)
> 
> You can just use #ifdef here.
> 
>> +static inline int reject_cma_pages(int nr_pinned, unsigned int gup_flags,
>> +	struct page **pages)
> 
> Please use two instead of one tab to indent the continuing line of
> a function declaration.
> 
>> +{
>> +	if (unlikely(gup_flags & FOLL_LONGTERM)) {
> 
> IMHO it would be a little nicer if we could move this into the caller.
> 

It does feel wrong-ish to loop through potentially every page that
gup_fast just followed. But could you clarify what you had in mind just
a bit more detail? For example, in qib_user_sdma_pin_pages() we have:

    ret = get_user_pages_fast(addr, j, FOLL_LONGTERM, pages);

Should this call a filter routine to avoid CMA pages, is that it?


thanks,
-- 
John Hubbard
NVIDIA




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

  Powered by Linux