Messages in this thread | | | Date | Wed, 17 Aug 2022 16:05:47 -0700 | Subject | Re: [PATCH v4 2/2] mm/gup.c: Refactor check_and_migrate_movable_pages() | From | John Hubbard <> |
| |
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
| |