From patchwork Sat Dec 17 10:58:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 13075814 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 677A7C4332F for ; Sat, 17 Dec 2022 10:58:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3F1758E0003; Sat, 17 Dec 2022 05:58:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A2258E0001; Sat, 17 Dec 2022 05:58:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 269DB8E0003; Sat, 17 Dec 2022 05:58:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1681C8E0001 for ; Sat, 17 Dec 2022 05:58:56 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DF2351A09C0 for ; Sat, 17 Dec 2022 10:58:55 +0000 (UTC) X-FDA: 80251500630.15.91C1A55 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf19.hostedemail.com (Postfix) with ESMTP id 4ED3F1A000D for ; Sat, 17 Dec 2022 10:58:54 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="U/BgvNZ9"; spf=pass (imf19.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671274734; a=rsa-sha256; cv=none; b=ZUY37VaaMNpDifCg5FTnhGVc6eBN2vncsB7JxS1VodiD9qaSw8RNHi1Y5GEuC+QzmxsHPc r/pbe6WQyFsgUhZcL+T2sXfvQ4brPwj67MxpOtcU46A6HYFCIdLy5y+82NfdpAtYMFas6X GVQZKCy4kDMbVFp04yjwBw2gC2zeohw= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="U/BgvNZ9"; spf=pass (imf19.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671274734; 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:references:dkim-signature; bh=TDZrCIg3hoRpoSSnfKkCTLqyQDjd3jYF6YvvbUfZo+c=; b=Zyh1VjHSIaIMfuowg2jiQx7yclIZXUXTUxk9wolMTZCV6gAmTXo6xTFPxIP/wXuIU6IuWi Crxzq/nJmLWOBV5VGnugg/m2dZYMWaFIqsO1zsJvqC+oPbrWMf1tENM4apXbpy9GBS5/8r k75czv32nToxcfOCBn+FhzIOwV/xBcg= Received: by mail-pj1-f45.google.com with SMTP id 3-20020a17090a098300b00219041dcbe9so4746701pjo.3 for ; Sat, 17 Dec 2022 02:58:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=TDZrCIg3hoRpoSSnfKkCTLqyQDjd3jYF6YvvbUfZo+c=; b=U/BgvNZ9OavRGBQWobiXeEE0/VIdFovI0IKC5VH7BaqdJeY/KFzaNAsLzrFDmpS1u7 kE8PKkGqgAKgD3b1f/IG9rmcerHKZTb7LLOkq7Lh1X8//1yB6tAmsiWUpU11jd7XHzuc MpEUF3ckdzB3e0sEInrqoyjz/R2attDTO1tZ1vwuuThU+LtbcNKLCCRokD2Fmnj+bweV EttKrk/YnzivWlL84Q7wZEQWtqmMAgbc4E6BCWGIrUbirNAkuXFb4uXtOdLg4pSkAzxg p6zGT5wtJCJpXKWdlqsUP6IpZisFKmQSOW8brg0z8AgCZfiR3mTtzFmV18LqsHX62Chv EXPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TDZrCIg3hoRpoSSnfKkCTLqyQDjd3jYF6YvvbUfZo+c=; b=ZwzKr2MeAj/auudOv6pLIJoHdaqQAHPznfyK5mxaXorIN7Cp26x9CjYTrk6kv4G0Vp EiBkB8RrI/PvEMQEmm/OjlfiGm1N1HcFgsXK0wBc93AJjJlGUn72AB+b70WlWxyPw60U VV4dLa4AacuegujII371FgCg2owqrje01iJCVAdLSzbVZ2RyUfR585tBGns9s9XCjQNR fQDE8oQ+vYSn9CzMh0SbZiLal3p4TKmG0QP433P5jJmM3mmf5JQSh03AYA/kRxWRao8f ryDT0BXDbWgzEM19veoo8b2lsZtKgOPy2BZa8CfrUqkWzwbLPFCGSC6z+aZRJj1xCaUc 1KCA== X-Gm-Message-State: ANoB5pn29vn3yEUamjccQQubS6d39Bza+Lys0ZZTlIzuk1krOr8CYz4E wkKY9tJ6UAaC/v1AZiU22Ao= X-Google-Smtp-Source: AA0mqf4pIYdNLufhGUSQixVmEBKfDLTqSEVv6ZVFAAjOiOZJZ2q+KP7Va6uz3UYPvuEIo13vdV7ybA== X-Received: by 2002:a17:903:41c5:b0:189:cec6:7ac5 with SMTP id u5-20020a17090341c500b00189cec67ac5mr52675864ple.44.1671274732977; Sat, 17 Dec 2022 02:58:52 -0800 (PST) Received: from vultr.guest ([2001:19f0:7001:12a1:5400:4ff:fe3e:f0b8]) by smtp.gmail.com with ESMTPSA id q10-20020a170902daca00b00185402cfedesm3226690plx.246.2022.12.17.02.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 02:58:52 -0800 (PST) From: Yafang Shao To: akpm@linux-foundation.org Cc: vbabka@suse.cz, 42.hyeyoo@gmail.com, willy@infradead.org, linux-mm@kvack.org, Yafang Shao Subject: [PATCH -mm 0/2] mm: page_ext: split page_ext flags Date: Sat, 17 Dec 2022 10:58:31 +0000 Message-Id: <20221217105833.24851-1-laoar.shao@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 4ED3F1A000D X-Rspamd-Server: rspam01 X-Stat-Signature: rti41h5jnnbypw33y1wh1mj4jbtrbykh X-HE-Tag: 1671274734-561125 X-HE-Meta: U2FsdGVkX1/+k+SOZAsvgpDhhkj3qHu6tjHVSydhGSV+XUhf2BkUy9U8Ht+x3uwLiqeD37m4n7OSq93VYd9WkEqbvkXvuW3KTuOGYcvscIaDCWsam+mgoADIyNzp1apX5FY2PjZ7cK0NWN/3sdA0bnwvy2QKBIMXbt3SWyRNfA2PhpqSpr4NQ0a1QF2UKYequ83EMeOHwd3gEhR1KXbUWWl7ldNsytdEBgvDa9XXjbOxdNOGl/Nrq90e5MLrryhjVtcK3utPXh7WFiQh+r1uGaOcJjw7qt/ECtuAK2A6i/I2JHI4TL4CAoGXIwhuZw7vCPtUs64sf2UyRF3PSSN99bmBYzcewK3H44RYO82e5HSV2Tk9bPxxxRAKkdzBfWO3TMAp4AZewdungVCFnCDnreICCMurW1mLF5uvS9a4xdV+0rvvf6guV/RqwhD0lHXUne5pybYgSKcWcSivWHNKjoHAKsbh+IsguiIS1Enke7nYhFacxS99U8Gy8c05r3UNQbWDXJgQ7jeaEU60Ah5TrgI/P34QstCx+qswbXL5RgfSxzajhM+5KawcG9yxHdEH1xjfMdR099Ey0oGMti79Gr81D7HNhZsp+YssZZclFKTPDJWwLUwEh9kMpjNU8o0bdxcUVeGF8MuaW1uam8Ss3CaeeDJOyGuvTSojXtUHPNadyCMpqZwHGbYhseXfc0ehgev6lVnVIZ9fazYAidevUaCVvwmgsp+RvfD5ZsPUNBZjvKMv4nPASzwqSiPpDAL2dAe4Ajjzn+uocvLPoFvOwKFqSC4qcdncjcMol27G7+KEHaWJwqqnrvbJ/hG3Q8t0/TeaOoion9isWk1WUgR4rBNKtw8eW6cNsQhCC2GJ/sg1E0C5eRjYye5x91/TvjiY6YLltr2c+7E5BNbDN6FS1M0i5Ls3l8ZsXiHxpoL70jzfca800zcoX/J3SPWMD8uhzZk8kXcrqEX4B0DP/Dr J6acV6o2 skBtTgz3SIL1pYhDU2pXicjxSJcyx8ejceV4b6ir/EZo8nlzBScnuIuO3zxBBB2c7/o1QtrknHl/R4FchEZbM1wKf2HmKmTIkqZrCV4rtiBgK9VTYoCA761zmKu4S3RlbNnWyY6ZVNjPes4U1igdcWVpb/celR2Ekf1hnsS9+z9RKUueBsQAzY4arsBtYBjIX6s6MSphGW/eUUahW8sdmudrK1AFLKROJLINmTdonZwqmR5ulAmygMhg6TqaQg0ljPvi1Ps4AwKoO25Vl1RbgmXQs/Nw/WM/ZfrxHGwkJW62e5O23cw75cOWcBFMPrpuZZpNu 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 64bit system, page extension is for debugging purpose only currently, because of its overhead, in particular the memory overhead. Once a page_ext is enabled, at least it will take 0.2% of the total memory because of the page_ext flags, no matter this page_ext uses it or not. Currently this page_ext flags is only used for page_owner on 64bit system. So it doesn't make sense to allocate this flags for all page_ext by default. We'd better move it into page_owner's structure, then when someone wants to introduce a new page_ext which may be memory-overhead sensitive, it will save this unneeded overhead. On 32bit system, there's page_idle running on production envrionment, which also uses this page_ext flags. So it will take another 0.2% of total memory if the user enable both page_idle and page_owner after this change, but considering page_owner is for debugging purpose only, the memory overhead in this case won't be a problem. So, let split the page_ext flags. Yafang Shao (2): mm: page_owner: split page_owner's flag from the comm flags mm: page_idle: split 32bit page_idle's flag from the common flags include/linux/page_ext.h | 14 +------------- include/linux/page_idle.h | 39 +++++++++++++++++++++++++++++++++------ mm/page_ext.c | 10 ---------- mm/page_idle.c | 12 ++++++++++++ mm/page_owner.c | 36 ++++++++++++++++++++++-------------- 5 files changed, 68 insertions(+), 43 deletions(-)