From patchwork Wed Aug 21 19:34:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13772024 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 9C0D0C52D6F for ; Wed, 21 Aug 2024 19:35:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C436A6B019B; Wed, 21 Aug 2024 15:35:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF22B6B019C; Wed, 21 Aug 2024 15:35:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A93526B019D; Wed, 21 Aug 2024 15:35:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 871436B019B for ; Wed, 21 Aug 2024 15:35:08 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 43FA11601E6 for ; Wed, 21 Aug 2024 19:35:08 +0000 (UTC) X-FDA: 82477255896.24.9977304 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id 9F6D6C0016 for ; Wed, 21 Aug 2024 19:35:06 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=bz4y1KMz; dmarc=none; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724268817; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PFYGF888esVx5is+dDOIN1XZFjPX09/KPzfotQSNrpE=; b=HajmzoGVM2eVlHAoysdEunvFdyU7b/f+xkXWbiNtGES4W/IvU6359jJ4GLZoEkzKv628EO axG5HiSMOcEQWz/mDKwm/wg7Aeemvi9lZ6jzSOnDjw3fNHy/8UV3g2UzvcPst6TFXspUy0 mZvAwQWsiMFGa7zJH18WnIBjMW2W1r0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724268817; a=rsa-sha256; cv=none; b=mTooGQktVZ8GuVO7HeYMVucURqtNZ8/ZAu6CnAEacQtjpErm1d859+GtH43pCQfKQf7kq0 4s5dWoyYmYJo3/PyRLkFf55+giWAxGJMkosUAebD6BJph1zUj+YPjPi98X4AiFE+O5Q6pD /XwZsQcasDqE+wQ9SNkw2OqoiweK13Q= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=bz4y1KMz; dmarc=none; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=PFYGF888esVx5is+dDOIN1XZFjPX09/KPzfotQSNrpE=; b=bz4y1KMzS8T/uu3zwWjk/iTFzg Dz9zVtDX+aD2O81VUnyS8Ci9+9iROW7x9hQql9Wl5x+3DUJBCFOA8Rc6THDTlZPyNUw1JNh8r97EL 9Uyvq+us/PqHxShueB0wN+4yqlLVJYl2pJBKi1F822Gmz1+NW14DGHuqCdc3gzGW33NKNnDnyKkzb mkjaG4Xmsa2cZq+dwzT7ZSmEdJB0PqXbB/tHlpwQnaFPRAORo7YVew2AdiCEBpTOsF4oPdJogOMHH 35SWcnbOzIBtUZjARl0d8MNDoJRMzBo0Kiluc4G6jTBIz79/mPp0tqyo0s+9yvEonoR4dgaQC9Jrq IVLRVLAg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgr6V-00000009cqj-0l7L; Wed, 21 Aug 2024 19:34:47 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: [PATCH 05/10] mm: Remove PageUnevictable Date: Wed, 21 Aug 2024 20:34:38 +0100 Message-ID: <20240821193445.2294269-6-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240821193445.2294269-1-willy@infradead.org> References: <20240821193445.2294269-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9F6D6C0016 X-Stat-Signature: kmtk76a4x94zk1gr4yzpc6zza8aoipym X-Rspam-User: X-HE-Tag: 1724268906-84966 X-HE-Meta: U2FsdGVkX1//PtbVt0HKnDWJcuQTaTJvU2VxgVx3yBj73lcSayRQYMbYKbtpkQvNi4eqkxYO8T8Ahu9aLDLN3c9RiDDXi94VfsQ5SsARQ1seabbdE0aA/gHJIPbEIObHz8jlXt0//BUWoOdmOdNK2kpcxlG1sl8Lu3AncEP+/iOUcmPsTesTk+eXuqRccm+ZZHYsV7tS6rNVaeJe6qjxB5HtIaL8rckuxwqcFza2FiC7+ImraNwHUEBxRwRBfFoVh/TOy6bnzLFzEAteE5jTobcfFaBaehWGNPbxrWO+KQJh7jmNWdKyg5vDPTYTk0XqRT0Oljsk1zdtNrhz9HDihgUP9uY5YAM2KOICYyTRrC7TjMnxKMklvCYnN57401dArpKMvs++RPJ52JtvGpQ0keiRTXZs+5CyeXuiG5L+lr/wMhB7AeHXeSG3jR65apP3zn3/HctxCkO5jqgTLbXtpGyN8na1AsJll1InnMnjmnmZZV7HGnsxajIk7j1+zmbRtNETWYqmruf75+4aZokZogWToZ3jwNpc8kuhFDrH74ohCqO2xnPMbDyownucg4+sbT4VMk1A9efucFcL9M3KFFRSNR1ZntXiurTa3T7kqPF1I8QmBAlxyGJx4lBbBaQ0/kSHxVRj1bRBp+MD9pmk34k9mhhMiuWcZBUaaqofqMR87x39/P88ag1XfpamCS6D90hToFB5z1cXpC7dFpyd2G0NZVCIpBqEkCrc8LTyDsS5/hKKWX0w83YEL8cm2wuPGhFrBBpUrAIRMlCeQCAE52LRevw9W/QOnFn4vMoh+0iotsdEqB7dr7uXH96kq1cYSMpWam4+Jfx2K5l5N/DIlLvDxE8Du7b5iEmJtd5yEhVuQHm0FlkljaZxYUs6CCQ1KOAVUaiYP+4loXxiCGlc9tC1yk6zHLMs6pbkJEhYx4s9M7eaUWzbVDLkIln3Skb29NpB8pA1NfGZYafpbrF ZsNslPk4 r8cGlIv6uvpKFhmfZm6N9krBatMcbVlOFqQ5AHFs6EQtOvxEQfPqRNmYesLJCKS1xq6otX66u9tQX3/4lo6CGz0UpVGMhjeAjCkjm31cjKw2jHD9eere2ENFd1qMD2vTyamNoB+4cYFOwzvpzRecrGIWAn4YhL00f8X3NZBgXBCSbj9iAOW23EFPanIrqYwFYO+H/q49HCGCT/XD26MH3BIe7XQ== 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: List-Subscribe: List-Unsubscribe: There is only one caller of PageUnevictable() left; convert it to call folio_test_unevictable() and remove all the page accessors. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 6 +++--- mm/huge_memory.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 43a7996c53d4..bdf24f65d998 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -580,9 +580,9 @@ FOLIO_CLEAR_FLAG(swapcache, FOLIO_HEAD_PAGE) FOLIO_FLAG_FALSE(swapcache) #endif -PAGEFLAG(Unevictable, unevictable, PF_HEAD) - __CLEARPAGEFLAG(Unevictable, unevictable, PF_HEAD) - TESTCLEARFLAG(Unevictable, unevictable, PF_HEAD) +FOLIO_FLAG(unevictable, FOLIO_HEAD_PAGE) + __FOLIO_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE) + FOLIO_TEST_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE) #ifdef CONFIG_MMU PAGEFLAG(Mlocked, mlocked, PF_NO_TAIL) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index cf8e34f62976..d92f19812c89 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3017,25 +3017,25 @@ static void remap_page(struct folio *folio, unsigned long nr) } } -static void lru_add_page_tail(struct page *head, struct page *tail, +static void lru_add_page_tail(struct folio *folio, struct page *tail, struct lruvec *lruvec, struct list_head *list) { - VM_BUG_ON_PAGE(!PageHead(head), head); - VM_BUG_ON_PAGE(PageLRU(tail), head); + VM_BUG_ON_FOLIO(!folio_test_large(folio), folio); + VM_BUG_ON_FOLIO(PageLRU(tail), folio); lockdep_assert_held(&lruvec->lru_lock); if (list) { /* page reclaim is reclaiming a huge page */ - VM_WARN_ON(PageLRU(head)); + VM_WARN_ON(folio_test_lru(folio)); get_page(tail); list_add_tail(&tail->lru, list); } else { /* head is still on lru (and we have it frozen) */ - VM_WARN_ON(!PageLRU(head)); - if (PageUnevictable(tail)) + VM_WARN_ON(!folio_test_lru(folio)); + if (folio_test_unevictable(folio)) tail->mlock_count = 0; else - list_add_tail(&tail->lru, &head->lru); + list_add_tail(&tail->lru, &folio->lru); SetPageLRU(tail); } } @@ -3134,7 +3134,7 @@ static void __split_huge_page_tail(struct folio *folio, int tail, * pages to show after the currently processed elements - e.g. * migrate_pages */ - lru_add_page_tail(head, page_tail, lruvec, list); + lru_add_page_tail(folio, page_tail, lruvec, list); } static void __split_huge_page(struct page *page, struct list_head *list,