From patchwork Wed Aug 16 15:11:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13355392 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 B5971C04A6A for ; Wed, 16 Aug 2023 15:13:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDAC2280029; Wed, 16 Aug 2023 11:13:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D3B38280021; Wed, 16 Aug 2023 11:13:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C0360280029; Wed, 16 Aug 2023 11:13:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B1085280021 for ; Wed, 16 Aug 2023 11:13:37 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8AB4FC04AD for ; Wed, 16 Aug 2023 15:13:37 +0000 (UTC) X-FDA: 81130312074.27.CAE86DD Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id 186CA120184 for ; Wed, 16 Aug 2023 15:12:33 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=hqH+Q0gP; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692198754; 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=fRlSze2Vu2RAUc5LjCjDIqaAj5/iOS1M5mvXvX9PDDw=; b=bIMYAHkbSbmQ+7tk74PpzdsL5/8o+ogbATd3kaq949JHdcke/YB3r/kvvfzdOE5N9KCn9V dN7TQAI9tsFd5bTkSKq86BNz5KTv5KllYPhhpdpy5FqwRZDvvOVVPCtCAMPrxWOD2vBjTk QswSgHJygbYdL9cnr39N1iyUXaqqYOk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692198754; a=rsa-sha256; cv=none; b=Uk0RH2n9UaiY7AUBTtZst5ULNs+yB/e8++5xe7Ev+8uKaiQ6THTrkXgM1CXl1TThvlyexg HzAgQd0r8X3Ep/xgpLDu5vpYyXRHzHILaL6lwVrd+tvpdzCIndSRhEEzw+5UqUXddwVW7x XiPTRTy280gBBwfAYiOlBqfxi3PDuZc= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=hqH+Q0gP; 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 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=fRlSze2Vu2RAUc5LjCjDIqaAj5/iOS1M5mvXvX9PDDw=; b=hqH+Q0gPF+1UpvSSyqUxsFf4I0 X97/VQIqchvL8dLzAOuQqjV7diMHv6PpA47rTRkvtyc+aaoSTHazv0MbfgJYGZrT6265rX3Za0llG kiVcHK9BbDrHW+izGIIVTQ4+l7K/fCH95DwfXshiXgIu5QKRcMPyWm1oOvcgYIYyu07pYV8BzDNSO iQ/KCHQ6Gnjqf5TX3PEdpyupPqQh343vZ33oCBxk0E9OhP3TWqNygV/fy1Qbpup4ISwkfaZcbPUYB k78xN3790BwfNHze1FN4ZiVhkVuSYlbnaIk0mvwObBBGQi7piqGcmNr63IKJHlObElgumTBnzwrCY M1ycGL+Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qWIBu-00FL8g-Kq; Wed, 16 Aug 2023 15:12:10 +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 v2 09/13] mm: Rearrange page flags Date: Wed, 16 Aug 2023 16:11:57 +0100 Message-Id: <20230816151201.3655946-10-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230816151201.3655946-1-willy@infradead.org> References: <20230816151201.3655946-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 186CA120184 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: g93esuw8u77zhcm1owerqw7mg5pyd537 X-HE-Tag: 1692198753-467097 X-HE-Meta: U2FsdGVkX1+85gnQhwL0zzF7rvvlvxsZP+XW60gcMbSeMbFxCJsrO/NTm1Ox7yG41NAVXk+JMHYeYDOgSmHg7PRG0OGNnGPJRYhYPbD0Kq0qU+a3UR2VTfOiZhK/0mFW41osyPsDDf5Qt2J7riVvlzNAb+awaYDu+RaU2OUwtl/5pTb1vhoXFMkqdbgTyOJ0GhxLGRVV3zUwcN4T2G4XbpvOCERy9RtNWQcGOcGwUmXFHcgHQSEbag2EkmGh71XKPbiaIjuVeJOzanxbn24KGCIblhjFbgU4ZG0RbvBvMku9+XwDOcYXkWE9vNjMyBiIMEw29uOftJouQBWXPKZuPE/96nO7F0YzLbAV34RHXdEThdauaMZY55L+/gg9YD9GLR3O9A/F7CgtsucRJ3wg4NHpw3ag3w9imAjkEx+96UFHjLoHmEPKhs2rJxOHxGpe2pjc25OgiE9w2vas60ekwKVhju/A3pBI1ufNCXGDta5CEgbJ5aWEYW+jKPH+zkDspryk86uYl1lshFdbg4YunWglw8BPZYErWmo97tPHBz5Z5coejDzNGv7CMREdVeEdRn51K6UxjRjsIecIVeuEeYPQ4OENrlm55F5CV3bZ+VSQfQXtQtPvJphVcVs+2Bs4lxIAagF0j5WAselKoqJwGZqu0Z4io9ffaRORFluMj7BH3GPg6s38MCQdt3cdcHwPhcm8AF2uEzLZ3Mq3iTPL8PYJecgtP0BlRnaOvr9lGt5D6lIox3EDVi4bMBW8wJ+Y9NeSmncO5rAugJKhjhj+jniL58sDgagmVj+QLQEmQUp6VJ9QcPYPT5t3CM3CVuAH6qcSEz1JmaZw9CuYzYaRye5uXAl4+hM0mPu/vBnztnRmA1ZJZ/N932BkWBDT0+wXZ52tfrb3yzoKs2LYul8vvdFbXmFBIys4Bt2equm4hxQ8kARI1kBNysn3UUQaYy8Iyi8Ko85oF/I3hmdOw6E DkyhCbeg +UFbXQ779O9lLCAGnTiMlDGea6ExZe1PS/K4KQe+vAPg34AXj7jr+LtFdj3i5DdcV7U+lR6G52tX157AQYc6qtnkffOlYj5yRaADsrWGbY6AkFKUsWNEb2muTESuPI2jPQfJyypJ9El8gLDv9v3ul9MIGguAjYt7+e2kSjzCYyk2ERKKp5rY7CWjzPw== 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. By putting PG_head in bit 6, we ensure that it is cleared by assigning the folio order to the bottom byte of the first tail page (since the order cannot be larger than 63). Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 732d13c708e7..b452fba9bc71 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 */