From patchwork Tue Aug 15 03:26:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13353480 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 1D5F3C04A6A for ; Tue, 15 Aug 2023 03:27:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7F6190001B; Mon, 14 Aug 2023 23:27:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A30A190000B; Mon, 14 Aug 2023 23:27:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8815F90001B; Mon, 14 Aug 2023 23:27:04 -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 7B69490000B for ; Mon, 14 Aug 2023 23:27:04 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4DABC407D1 for ; Tue, 15 Aug 2023 03:27:04 +0000 (UTC) X-FDA: 81124902768.01.799D17E Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf28.hostedemail.com (Postfix) with ESMTP id 8F6ABC0005 for ; Tue, 15 Aug 2023 03:27:02 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=JGbswiDJ; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692070022; 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=f59aeb0mmdHQJI1C4RwzY3Ldg6y1fWJH+3t+QmXVWA0=; b=MEZmv8sG7ivuILtRJlJ+7gGaOJ5YWF9chSv2olwFAWX2aWa2zfuAxtjb9m+fw63db2st9Z VwSwXhu5ppGnxrU2YHNA9zYQmSijpoauHsbVnVV1TspdUnG0Zg2CqmbBhTIn1AYRwwjUid yrwL2LdZ98vlXY1oahzhoGewF3JGOhQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=JGbswiDJ; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692070022; a=rsa-sha256; cv=none; b=sDWpBPWuLxnihtKI1KOiwplsZmQlO/Bz39riILmEUMH4v9nV0FPAMz9tO4pQ1PFjGZaVYs Bd6kGLmb/gy3glzwJ7U2i3CAZEBRFYTqIqc2CbfPpmOHX+lG/iWTw/S5hCGGO/YwgMxUX8 x+Rp4ckiEnylSkvi6UMnMyLdw7xCQ9M= 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=f59aeb0mmdHQJI1C4RwzY3Ldg6y1fWJH+3t+QmXVWA0=; b=JGbswiDJ34dDq4gaBq7kG58sIS ZFsx9XleJZknvuEtpNq42FfDPlnHuX6TJKg+qKrB9bPr27v53sWti/JJY3r4PKJ0bZg6XW2eRIQ+Q Mdz3lE5/xT1YzPMl2rGLC45LWCh7CMhhqc4XE/Z0tkyAwARxFW4BlJJetWxK1o7XDA96tY9wgNqlt fJC3fFpbLEm4XMYOsXG3w5i+3DeaIX45zQbQvlUVXb0qInhNW50xMQkZz72aFiy+C1WcUi+rJ9wvN uWB4pyQ8mCy6Y5iofpd7VKM0IPNOwIYAaszCRZFEp3heABqH4/zWVq/nij67Ybt462ftX48Hf5zIX RlDlHxrw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qVkhm-005qaf-Rr; Tue, 15 Aug 2023 03:26:50 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , Jens Axboe , io-uring@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 8/9] mm: Rearrange page flags Date: Tue, 15 Aug 2023 04:26:44 +0100 Message-Id: <20230815032645.1393700-9-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230815032645.1393700-1-willy@infradead.org> References: <20230815032645.1393700-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 8F6ABC0005 X-Rspam-User: X-Stat-Signature: gsdaohmbgk5eh4xsser37fzwbe3877b7 X-Rspamd-Server: rspam01 X-HE-Tag: 1692070022-779358 X-HE-Meta: U2FsdGVkX1+oA4X98F0H7ScYIBTL2aNviOypQNHUTV4vkIDTGIE8h5RPQHN7bNUQC/ZpbPHnm5WRkG/4DoIFfIa3KNusF0Ud5XwL7JvY+5lrwgti7FpVKFoAtObTN+2J5FZM85ceP9TPa3MrR/ud8wvafrBlsyLUMkd5Qw8fi1cQSbEVWwq+Q3MQ+zXB3wExYDgBpJpAlTeXHqtA57eWs/KSoW60WquyBG1Y3pj27KohVSoia7zHKWAy3aRkgoHmPfXhZaKz/fX6bJE8oGQybVEsNk7mHe8ynA4sCkm1QdLlnO4QfbQpAierjp7toYcys9+pQSG1pvBCF/xa1KA9tBEc0G76HiGg3MwyBOYyzAmV99/nDkTSEQOlTBPa8629yaBga+Djv0dltZyABKfbwW6tuuZTJlnj8F/11bBcwvsFA4HJ2T9TlT4rLkHXIpJ2z1iXP+LXDER62/1Sy4tArt5mvQlpfaQOZ4ilk7oyWF3BOxJzAkNfpBzBXnBPCYbWWawfFuUWr8MwbRziczvrOZRur4fSWGeWGa1ENIDiHoE1BA9YZ+4Uf+csc+rf7EahXctl8TbB5/KMw8J22mT3ZdpTse/gS2gG3kPcbvjzPCD1Dpd5pOOtiFHAo7O4gh9/+poT+8R+yLwdr/7nyYMcm5BmZPHfVLLCHr4oUUUptDhe2A9jfRMLKTmrA+5AlK//te7RDDkpioLryga2E5mBGS7zMoYMBx1Yi70/OHB6YTqdmEo4lvvknpO2227gOJYXb7zD3KN1HJ6f0SGbl6crA3afH77tQUicVMU4gaPWTnMkMjvJdfNbK5xGEPeG4EXco2hI/sJ1YKJItg5ogBUaqj0++BpOktXYyNMRlEYb7r+AhiLtSiTM9ug/WmXtifm1rQiJet+ieIS2tpz3QxpCSpwJh0zKBSmgSEB8RLWRnQm0l1jzoQhBLgFplNvO7v2kgPAKRtvAH6ZFZJoTt5E RxKC+xK9 FFNpQdCcwSBX/ZE+phrALVp/1CATLdO4VPxu5i1TLd/6Ulf76KxKPK05M3dkZ0oBqAGsQ1smzNJ9PnetzU1hdW7NpBl2aOS6fcjIjNwpYzgsiqLrk6NSmkYrdhe2bqnVIqU5w0F+JTUqnCieVSv4Q+dnMssvMZren9LIwn4aiRBWpRImZw2oAwGkaow== 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: Move PG_writeback into bottom byte so that it can use PG_waiters in a later patch. Move PG_head into bottom byte as well to match with where 'order' is moving next. PG_active and PG_workingset move into the second byte to make room for them. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index aabf50dc71a3..6a0dd94b2460 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -99,13 +99,15 @@ */ enum pageflags { PG_locked, /* Page is locked. Don't touch. */ + PG_writeback, /* Page is under writeback */ PG_referenced, PG_uptodate, PG_dirty, PG_lru, + PG_head, /* Must be in bit 6 */ + PG_waiters, /* Page has waiters, check its waitqueue. Must be bit #7 and in the same byte as "PG_locked" */ PG_active, PG_workingset, - PG_waiters, /* Page has waiters, check its waitqueue. Must be bit #7 and in the same byte as "PG_locked" */ PG_error, PG_slab, PG_owner_priv_1, /* Owner use. If pagecache, fs may use*/ @@ -113,8 +115,6 @@ enum pageflags { PG_reserved, PG_private, /* If pagecache, has fs-private data */ PG_private_2, /* If pagecache, has fs aux data */ - PG_writeback, /* Page is under writeback */ - PG_head, /* A head page */ PG_mappedtodisk, /* Has blocks allocated on-disk */ PG_reclaim, /* To be reclaimed asap */ PG_swapbacked, /* Page is backed by RAM/swap */ @@ -171,21 +171,19 @@ enum pageflags { /* Remapped by swiotlb-xen. */ PG_xen_remapped = PG_owner_priv_1, -#ifdef CONFIG_MEMORY_FAILURE /* - * Compound pages. Stored in first tail page's flags. - * Indicates that at least one subpage is hwpoisoned in the - * THP. + * Flags only valid for compound pages. Stored in first tail page's + * flags word. */ - PG_has_hwpoisoned = PG_error, -#endif - - /* Is a hugetlb page. Stored in first tail page. */ - PG_hugetlb = PG_writeback, - /* Has a deferred list (may be empty). First tail page. */ + /* At least one page is hwpoisoned in the folio. */ + PG_has_hwpoisoned = PG_error, + /* Belongs to hugetlb */ + PG_hugetlb = PG_active, + /* Has a deferred list (does not indicate whether it is active) */ PG_deferred_list = PG_reclaim, + /* non-lru isolated movable page */ PG_isolated = PG_reclaim,