Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-31 Thread John Hubbard
On 10/31/19 2:09 PM, Ira Weiny wrote: > On Thu, Oct 31, 2019 at 11:43:37AM -0700, John Hubbard wrote: >> On 10/31/19 11:35 AM, Ira Weiny wrote: >>> On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: >> ... + +static int __huge_pt_done(struct page *head, int nr_recorded_pages, i

Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-31 Thread Ira Weiny
On Thu, Oct 31, 2019 at 11:43:37AM -0700, John Hubbard wrote: > On 10/31/19 11:35 AM, Ira Weiny wrote: > > On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: > ... > >> + > >> +static void __remove_refs_from_head(struct page *page, int refs) > >> +{ > >> + /* Do a get_page() first, in c

Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-31 Thread John Hubbard
On 10/31/19 11:35 AM, Ira Weiny wrote: > On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: ... >> + >> +static void __remove_refs_from_head(struct page *page, int refs) >> +{ >> +/* Do a get_page() first, in case refs == page->_refcount */ >> +get_page(page); >> +page_ref_su

Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: > There are four locations in gup.c that have a fair amount of code > duplication. This means that changing one requires making the same > changes in four places, not to mention reading the same code four > times, and wondering if there

[PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-30 Thread John Hubbard
There are four locations in gup.c that have a fair amount of code duplication. This means that changing one requires making the same changes in four places, not to mention reading the same code four times, and wondering if there are subtle differences. Factor out the common code into static functi