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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9C2EC47094 for ; Thu, 10 Jun 2021 03:43:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F1C8561403 for ; Thu, 10 Jun 2021 03:43:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F1C8561403 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1B2B56B0036; Wed, 9 Jun 2021 23:43:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 162216B006E; Wed, 9 Jun 2021 23:43:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 029536B0070; Wed, 9 Jun 2021 23:43:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id C2ED96B0036 for ; Wed, 9 Jun 2021 23:43:52 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6479682499A8 for ; Thu, 10 Jun 2021 03:43:52 +0000 (UTC) X-FDA: 78236420304.08.7C1E3FE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id 04CD636D for ; Thu, 10 Jun 2021 03:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=Zr8VcJlxeP3zKbb0wWo0dze8V+6aBUdzrqoW+AghMhE=; b=YTpc/YIOxO6Re635JdNoPpuxaq FC0alPNaVBIl8w3p1Luc23u73m2+9Rs/5MQKSgC/L9P0IM4gB2dvlanSTo4GVcWHbk/vAitapkiHb cDj1daKFnUdU3v0I7CT5n8o6nYAT8Qr3Lnzu7d/dQIAYNOYRO6yJp9fuMIeWik72Z0rh4JfMsbPkY O/aEHt1ts8/A/tXFmuz5us0qbzOIAWwt4svbaVNMwQxCGt3F36Vk1Yhm3TMeaQBLQQPTDaXk7Brr6 Dew+yO6smxfoMCi2+aQ4cpByDCbYC164EceZgciRQ5h85yBYyJbIMmAbKLdUme+d6pxWq2a3v28f/ /ytwDCNA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lrBbC-001CE2-Qw; Thu, 10 Jun 2021 03:43:24 +0000 Date: Thu, 10 Jun 2021 04:43:18 +0100 From: Matthew Wilcox To: Vladimir Davydov , "Kirill A. Shutemov" , Hugh Dickins , linux-mm@kvack.org Subject: Idle THPs Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="YTpc/YIO"; spf=none (imf29.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: rspam03 X-Rspamd-Queue-Id: 04CD636D X-Stat-Signature: rq9kbjum5c8d4nfgqfb1pf5rasxpwmub X-HE-Tag: 1623296624-710053 X-Bogosity: Ham, tests=bogofilter, spamicity=0.024595, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: As part of the folio work, I'm looking at PageIdle and PageYoung and they're defined to operate on PF_ANY. So, for example, in pagecache_get_page(), we will call clear_page_idle() on the head page (actually, I changed this in a8cf7f272b5a -- before, it would call clear_page_idle() on the tail page). However, we never actually call set_page_idle() on tail pages. This is because we only call it here: page = page_idle_get_page(pfn); if (page) { page_idle_clear_pte_refs(page); set_page_idle(page); put_page(page); } where page_idle_get_page() does: struct page *page = pfn_to_online_page(pfn); if (!page || !PageLRU(page) || !get_page_unless_zero(page)) return NULL; get_page_unless_zero() will always fail for tail pages (as it uses page_ref_add_unless(), which does not redirect to the head page's refcount). So all tail pages read back as !idle in page_idle_bitmap_read(). Is this intended? Should they rather mirror the state of their head page?