lkml.org 
[lkml]   [2022]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 1/2] mm/gup.c: Don't pass gup_flags to check_and_migrate_movable_pages()
Date

Jason Gunthorpe <jgg@nvidia.com> writes:

> On Fri, Aug 05, 2022 at 04:29:52PM +1000, Alistair Popple wrote:
>> @@ -2053,7 +2046,9 @@ static long __gup_longterm_locked(struct mm_struct *mm,
>> NULL, gup_flags);
>> if (rc <= 0)
>> break;
>> - rc = check_and_migrate_movable_pages(rc, pages, gup_flags);
>> +
>> + WARN_ON_ONCE(!(gup_flags & FOLL_PIN));
>> + rc = check_and_migrate_movable_pages(rc, pages);
>
> This should be moved up:

Ok. I debated doing that originally but wanted to keep the WARN_ON
close to the code that makes that assumption. On the other hand a
comment would achieve that so will move it up. Thanks.

> if (!(gup_flags & FOLL_LONGTERM))
> return __get_user_pages_locked(mm, start, nr_pages, pages, vmas,
> NULL, gup_flags);
> if (WARN_ON(!(gup_flags & FOLL_PIN)))
> return -EINVAL;
> flags = memalloc_pin_save();
>
> Jason

\
 
 \ /
  Last update: 2022-08-08 04:21    [W:0.241 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site