lkml.org 
[lkml]   [2023]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [GIT PULL] MM updates for 6.5-rc1
On Mon, 26 Jun 2023 at 08:50, Andrew Morton <akpm@linux-foundation.org> wrote:
>
> Linus, please merge the MM updates for the 6.5-rc cycle.
> [...]
> merge conflict in mm/gup.c, vs block tree:
> https://lkml.kernel.org/r/20230616115856.3ce7682c@canb.auug.org.au

Hmm. I think this merge resolution in -next is wrong.

It now does a common

folio = try_get_folio(page, refs);
if (flags & FOLL_GET)
return folio;

for both FOLL_GET and FOLL_PIN, and then *after* that for the FOLL_PIN
case it does that

/*
* Don't take a pin on the zero page - it's not going anywhere
* and it is used in a *lot* of places.
*/
if (is_zero_page(page))
return page_folio(page);

but by then it has already done the try_get_folio().

End result: it has already updated refcounts, despite the comment
saying not to do that.

So I think it needs to match the comment (and the try_grab_page()
logic), and just basically

if (flags & FOLL_GET)
return try_get_folio(page, refs);

if (is_zero_page(page))
return page_folio(page);

folio = try_get_folio(page, refs);
if (!folio)
return NULL;

instead.

That's what my resolution is going to do, but let's add others to the
participants list just in case somebody goes "No, Linus, the reason
-next does that is XYZ"...

Linus

\
 
 \ /
  Last update: 2023-06-28 19:30    [W:0.051 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site