[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20370ebb-8e63-2065-307a-81fa874eced2@nvidia.com>
Date: Wed, 17 Aug 2022 16:05:47 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: Alistair Popple <apopple@...dia.com>, linux-mm@...ck.org,
akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
"Sierra Guiza, Alejandro (Alex)" <alex.sierra@....com>,
Chaitanya Kulkarni <kch@...dia.com>,
Dan Williams <dan.j.williams@...el.com>,
Felix Kuehling <Felix.Kuehling@....com>,
Logan Gunthorpe <logang@...tatee.com>,
Miaohe Lin <linmiaohe@...wei.com>,
Muchun Song <songmuchun@...edance.com>,
Ralph Campbell <rcampbell@...dia.com>,
David Hildenbrand <david@...hat.com>,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v4 2/2] mm/gup.c: Refactor
check_and_migrate_movable_pages()
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
Powered by blists - more mailing lists