lkml.org 
[lkml]   [2022]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 2/2] mm/gup.c: Refactor check_and_migrate_movable_pages()
From
On 8/17/22 15:50, Jason Gunthorpe wrote:
>
> But why return 0 from the helper function in the first place?
>

The caller is looking for three distinct return code cases: 0, -EAGAIN,
or some other -errno. Unless you restructure more, you need all three
of those cases. The 0 case leads to the caller, __gup_longterm_locked,
returning nr_pages.

Here is the comment block that I recommended earlier in this thread, that
documents those cases:

https://lore.kernel.org/r/dc8fd102-ba30-d980-bdbb-11f39326103d@nvidia.com




thanks,
--
John Hubbard
NVIDIA

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