[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjyJyV=Kyb8XJcLjFEPP-RMF0J6CQfT2OXLmJdM2yEv8w@mail.gmail.com>
Date: Wed, 28 Jun 2023 10:27:44 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andrew Morton <akpm@...ux-foundation.org>,
David Howells <dhowells@...hat.com>,
Stephen Rothwell <sfr@...b.auug.org.au>
Cc: linux-mm@...ck.org, mm-commits@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [GIT PULL] MM updates for 6.5-rc1
On Mon, 26 Jun 2023 at 08:50, Andrew Morton <akpm@...ux-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
Powered by blists - more mailing lists