From patchwork Fri Feb 26 09:17:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 12106189 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=-11.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 B9BDFC433DB for ; Fri, 26 Feb 2021 09:17:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 36F0E64F1B for ; Fri, 26 Feb 2021 09:17:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36F0E64F1B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6DD1A6B0070; Fri, 26 Feb 2021 04:17:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 68D3D8D0002; Fri, 26 Feb 2021 04:17:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52C008D0001; Fri, 26 Feb 2021 04:17:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 3EBF26B0070 for ; Fri, 26 Feb 2021 04:17:38 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 04AB91835C982 for ; Fri, 26 Feb 2021 09:17:38 +0000 (UTC) X-FDA: 77859866196.18.73FDA28 Received: from mail-qk1-f201.google.com (mail-qk1-f201.google.com [209.85.222.201]) by imf11.hostedemail.com (Postfix) with ESMTP id 203812000388 for ; Fri, 26 Feb 2021 09:17:26 +0000 (UTC) Received: by mail-qk1-f201.google.com with SMTP id s184so6815701qke.18 for ; Fri, 26 Feb 2021 01:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=3ZV7zZPMbpU90hBRfWaNQjlV4YJIoQKZGm7WEWLxpX4=; b=bVhcMmIyAbwGbLJBYZ75Qq9rNu19JeSUX5B4gMG2srJgTft177olYXRffkrhdTHnTA BRELpmytdqOo1mKL5BOGk77f0O069iHh8TR8mDx1fYQ8IErV8OtvmwGnSjFdWD6qCM8E 5Z3qyAYaasiI7I7U2iy7nePmC+aKb4N0rBoe8hNh85tTAXQEXomY7GrKeJMIG14qK/rp /YaKvpGEoFsBm7+hGRnTeHKSzVYP3d3SUTIDQ3DV5PtxR2pyUHtjGRfuMj09T9ATPsrJ /A/KQIjZ1xiHWBlHtpvmFVUQGfspEQwfjfzOXSqwaH3BC5mx+Of1ztfhf/7ekrblccD1 qSrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=3ZV7zZPMbpU90hBRfWaNQjlV4YJIoQKZGm7WEWLxpX4=; b=Fix3NXy0YeBNKccAMucHyop2IDWz3J0E7GbUqiNflTTVGeRPFdhBu9zqmEaB81xYTw UnF/jQrcsIdIbPY67tNj2qk1tg0VWia5qZMBIrw61YHX9KWiWK3VVi/DJCVBBV8UYPHD RmOgEdrPTVC+GJtE6Imrn0Y6TZJnaDdBq44D0ZC/xu2lzV2LRhIPOtcI7BXVNvckp4EF tNnGaK+c/O0OA5Jow+4QdQjvbbEPDpfcAF+jDwZHk0+wAvd+I6yhX7U7t55sCyVIwR38 wEpoDMd2l37ladksRBSonTU9Lm2PcUmKgW4ETlXtr9fe4AHMNFz5CuwPcu0eWOzlQ+m6 4S6g== X-Gm-Message-State: AOAM531g5fQ9qiY43KytOp6e/TjSLRmjkneEYve2JiboCCEE7kdPnjFL KzhT7s61mJYiUpCqzOT4PJDDj1/KN8Q= X-Google-Smtp-Source: ABdhPJx8nJVj5jAhSGuPMleKa6a6NW+uOHQVRn7EGIb51y0p35dsddTx/zqDTNTX0eFHlbdcF2Ta3TyGIOA= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:69b6:2618:c96a:ceba]) (user=yuzhao job=sendgmr) by 2002:a05:6214:aae:: with SMTP id ew14mr1604473qvb.24.1614331056594; Fri, 26 Feb 2021 01:17:36 -0800 (PST) Date: Fri, 26 Feb 2021 02:17:15 -0700 In-Reply-To: <20210224084807.2179942-1-yuzhao@google.com> Message-Id: <20210226091718.2927291-1-yuzhao@google.com> Mime-Version: 1.0 References: <20210224084807.2179942-1-yuzhao@google.com> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog Subject: [PATCH v2 0/3] trim the uses of compound_head() From: Yu Zhao To: akpm@linux-foundation.org, alex.shi@linux.alibaba.com, vbabka@suse.cz, willy@infradead.org Cc: guro@fb.com, hannes@cmpxchg.org, hughd@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@kernel.org, vdavydov.dev@gmail.com, Yu Zhao X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 203812000388 X-Stat-Signature: jsdkjz1zbdqkf17kfaqg49h9u949dmd3 Received-SPF: none (flex--yuzhao.bounces.google.com>: No applicable sender policy available) receiver=imf11; identity=mailfrom; envelope-from="<3sLw4YAYKCBUJFK2v919916z.x97638FI-775Gvx5.9C1@flex--yuzhao.bounces.google.com>"; helo=mail-qk1-f201.google.com; client-ip=209.85.222.201 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614331046-608204 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: Patch series "mm: lru related cleanups" starting at commit 42895ea73bcd ("mm/vmscan.c: use add_page_to_lru_list()") bloated vmlinux by 1777 bytes, according to: https://lore.kernel.org/linux-mm/85b3e8f2-5982-3329-c20d-cf062b8da71e@suse.cz/ It turned out many places inline Page{Active,Unevictable} which in turn include compound_head(). From the v1: Removing compound_head() entirely from Page{Active,Unevictable} may not be the best option (for the moment) because there may be other cases that need compound_head(). In addition to picking a couple pieces of low-hanging fruit, this v2 removes compound_head() completely from Page{Active,Unevictable}. bloat-o-meter result before and after the series: add/remove: 0/0 grow/shrink: 6/92 up/down: 697/-7656 (-6959) Yu Zhao (3): mm: bypass compound_head() for PF_NO_TAIL when enforce=1 mm: use PF_NO_TAIL for PG_lru mm: use PF_ONLY_HEAD for PG_active and PG_unevictable fs/proc/task_mmu.c | 3 ++- include/linux/page-flags.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-)