lkml.org 
[lkml]   [2022]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 2/2] mm/gup.c: Refactor check_and_migrate_movable_pages()
On Thu, Aug 18, 2022 at 09:24:28AM +1000, Alistair Popple wrote:
> collected = collect_longterm_unpinnable_pages(&movable_page_list,
> nr_pages, pages);
> if (collected == 0)
> return 0;
>
> ret = migrate_longterm_unpinnable_pages(&movable_page_list, nr_pages,
> pages);
> if (ret)
> return ret;
>
> return -EAGAIN;
>
> Which IMHO looks at lot more normal and sane than what I had.

That isn't "success oriented flow" :)

> > But why return 0 from the helper function in the first place?
>
> To stick with the paradigm of 0 == success. Ie.

But it doesn't mean success if we squashed it to EAGAIN here.

-EAGAIN == retry
0 == success, real success
everything else == -ERRNO, failure

Stick with one convection in all the functions in this file in this grouping.

Jason

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