Re: [PATCH 09/17] gup: Convert gup_pte_range() to use a folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/4/22 23:52, Matthew Wilcox wrote:
On Tue, Jan 04, 2022 at 11:36:29PM -0800, John Hubbard wrote:
-		SetPageReferenced(page);
+		folio_set_referenced(folio);

For the case of a tail page, I *think* the above hunk changes the
behavior. Previously, the tail page's flags were affected, but now, the
head page's (folio's) page flags are being changed...right?

So ... most flags don't really "exist" for tail pages.

PAGEFLAG(Referenced, referenced, PF_HEAD)

#define PF_HEAD(page, enforce)  PF_POISONED_CHECK(compound_head(page))

so any time you call SetPageReferenced(page), we have a hidden call to
compound_head() in order to set PG_referenced on the head page.

It's only the PF_ANY flags which are (theoretically) settable on tail
pages:

PAGEFLAG(Private, private, PF_ANY)
PAGEFLAG(Private2, private_2, PF_ANY)
PAGEFLAG(OwnerPriv1, owner_priv_1, PF_ANY)
PAGEFLAG(HWPoison, hwpoison, PF_ANY)
TESTPAGEFLAG(Young, young, PF_ANY)
PAGEFLAG(Idle, idle, PF_ANY)
__PAGEFLAG(Head, head, PF_ANY)
__PAGEFLAG(Isolated, isolated, PF_ANY)

I honestly doubt many of these are actually settable on tail pages;
it's simply that nobody's really thought about them for compound pages.

OK, I see. Thanks for spelling that out for me. :)

Please feel free to add:

Reviewed-by: John Hubbard <jhubbard@xxxxxxxxxx>


thanks,
--
John Hubbard
NVIDIA




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux