From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BE11C433F5 for ; Wed, 5 Jan 2022 07:52:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1852C6B0074; Wed, 5 Jan 2022 02:52:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 134EF6B0075; Wed, 5 Jan 2022 02:52:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0244B6B0078; Wed, 5 Jan 2022 02:52:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id E42946B0074 for ; Wed, 5 Jan 2022 02:52:06 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A008B9367F for ; Wed, 5 Jan 2022 07:52:06 +0000 (UTC) X-FDA: 78995465052.21.9526D15 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf31.hostedemail.com (Postfix) with ESMTP id 4A70C20003 for ; Wed, 5 Jan 2022 07:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Mzq5Wy2uVd6yiztkhOJgEQf6y1oQMVJ4hq5isJvgc9Y=; b=PLTwRwHGckBShIFNFxBIH2+CvS jGf+mBTqd2LXmGJ5eeKwfne8ODRY2663ajVfTGTCu4V3wA//dWEIr5iqkT1daTJK7qKdhBz28eI1i hntbULL998rj4sCN4+wXLhgCo5fyznB4GZ4TI7+woiWZS2wxh/nZ7KP7Cu3CMCCIxznJlTPFtJRmr ZY9uq+fjqf9meNUm1W47JJFJXXqmKawoBC2FQdWfRnSu+6+UTOyRwoA40yNJvA8I2ykHKBv/iBAtP Newjjvgn3iAW+Vf41lN2YtjPhYaNn/Ds4ivhbecSWOu3afck3r3mc8x73TaFyoVIfAvTafJPf+qQc ARBHYjew==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n515W-00ENyf-Es; Wed, 05 Jan 2022 07:52:02 +0000 Date: Wed, 5 Jan 2022 07:52:02 +0000 From: Matthew Wilcox To: John Hubbard Cc: linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH 09/17] gup: Convert gup_pte_range() to use a folio Message-ID: References: <20220102215729.2943705-1-willy@infradead.org> <20220102215729.2943705-10-willy@infradead.org> <02e2dd23-4400-1ac7-8e5c-ffdcbb8200ad@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02e2dd23-4400-1ac7-8e5c-ffdcbb8200ad@nvidia.com> X-Rspamd-Queue-Id: 4A70C20003 X-Stat-Signature: nhrsa7zni4xiqns9tygebjxiyogz5u57 Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=PLTwRwHG; spf=none (imf31.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam10 X-HE-Tag: 1641369100-531701 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.