Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3855881rwe; Mon, 29 Aug 2022 23:02:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR6pzVCiPTsmxbP2aiIzmg4BkJCPARxuwPiIUzSG5SStCK6N4zohHSo4Y/6a4OpPMBL8q64f X-Received: by 2002:a63:87c7:0:b0:42c:5517:ac8b with SMTP id i190-20020a6387c7000000b0042c5517ac8bmr4587871pge.111.1661839338836; Mon, 29 Aug 2022 23:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661839338; cv=none; d=google.com; s=arc-20160816; b=g3Y9OnfVqcmT2mcdGRTVMITwn1HITtCqHM6u+ZIfdUKbOIcKNKTarZQ9dUCVsLvEtm AFvnhCOkJZu+SidFrnh4g1zAe/mEP4MO2iH2GUYrHbZnshhYObv72CMYe1qZq1itAt7j VYJPKG+4965sdCBnK3VnaAPLY5C8O0c/5fl3tzpUaa0tOe2VM8dcxcJyfj7rBnxGmFQr mkLGSi2koGwYY92EBUjBmsWbQSr2f4/Xms1fXYRDfBY1R41T/uDVq6fR7ZjCgl9A3Ghj cDKP/DZ/lyWp61/rGzkvRO5xPelL4KBZoXposXWCQmSk9k/DWQneuKfQBYncyXtx66te eeXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=qUSrr+Dj5JEyxXLU0zu9XCionGxLBWlgtmoR99MFjhQ=; b=gdd0aLhlZ/D52CBHZoER0q8iEbm75Cq3WrwFa19knsz914rMkySI5Z/dvx5y2XXN3S b+LKOa3YrlMQGX3HQyJvgAdVHsCusD3Sx1oHrYMuHdasaJ0JS2AMmLbkWdiXqKStxitw /qxqftjFdaMZ6N/GqLWzHoa8aCBEQg0Tl1TQ7eRd6jHOwWsc9mW2UmCmjnqlWdMk/S3K LWdJucx6RUEs8wYwM8pt0DyEmVxDR12BQ0mOzhnRMZze5J7qMbQFSaimM9n0Pk3my4Hc ERikrsoZmzlgbrl8ZdfxqSPL7c7M3KDl10jAOGgCSFW5hYu2RvbszGxEOaZNG+6i1NkD vyMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FjZ0kPOa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a17090332c700b00161739962ffsi6125874plr.163.2022.08.29.23.02.08; Mon, 29 Aug 2022 23:02:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FjZ0kPOa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229447AbiH3GAI (ORCPT + 99 others); Tue, 30 Aug 2022 02:00:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiH3GAH (ORCPT ); Tue, 30 Aug 2022 02:00:07 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACE4312D15; Mon, 29 Aug 2022 23:00:06 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id v5so3891834plo.9; Mon, 29 Aug 2022 23:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:from:to:cc; bh=qUSrr+Dj5JEyxXLU0zu9XCionGxLBWlgtmoR99MFjhQ=; b=FjZ0kPOazz55wM/uQwXnHAUHofevmUyS/fY5Hz9pws04EQKglg986u+lddR1MBRc9G JhOVc1ONM6hZeGw2sGMV8DtQCGEPaPSGYJlAE3j2M9fRp2J3R53+q3V4/ZLUfQk904XT 0BA1sw4kr4vqPw4k02HrQD6uldwsF7nVrYd7e9NMkOr/e3zEC67KEAKtT44+xc9mUIxc glCfCRac7UFvijpundB+UUlCZwIAuNLfu+MRin/B7JuwhHAhnEu/5Wptuq9lmQfCdfH6 nEv5wN1UV6Opd14YB/YIvNr9vvUZobL0C6Ozo8qY6k0eQ/7g/2n7LwYub6AXvivgh11d BiYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=qUSrr+Dj5JEyxXLU0zu9XCionGxLBWlgtmoR99MFjhQ=; b=FtKh+XgdM+fXLunjgGvilnUcUkjvG5utlUZ7l/SJcSqorXvKuve9dCxgCyJofG72mW ze2iI3z/n14ut9mpkIsE9km5nH5vp9a/PBwPCmFVSMEGW0KaWbczzya7pgz6jFv0NodU 0artty4eWR2ofuFz36wN19gOfWAjLGfSBxgdLxJ/Ag6xgWkoyw50sAZS4u60tPB6E/6q 98JzJQkApOj5rNOmKFrRzxdB74ZixE5QlgcPueqYKzRTqqZMSO4ZcuO2Ju74rpPMX+so 1A0mofxio6UsDUEie+6MvlqNE1dIGlA+ifL5ftm3nvyd908+U5LI/0K1LeZBrMNzT3m2 VD3w== X-Gm-Message-State: ACgBeo3uWdg5lj6vfUcLNanUlkQZUUFBRjwqXlDkT7ME5/zCB1avga7d YYYWI/wTLzrDpVHeXs/3co/ot3Gn0eyJkeGb X-Received: by 2002:a17:90a:d149:b0:1fb:6dfb:1fb8 with SMTP id t9-20020a17090ad14900b001fb6dfb1fb8mr21573583pjw.25.1661839205472; Mon, 29 Aug 2022 23:00:05 -0700 (PDT) Received: from KASONG-MB0.tencent.com ([103.7.29.31]) by smtp.gmail.com with ESMTPSA id m24-20020a17090b069800b001fd962747d4sm5311546pjz.30.2022.08.29.23.00.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Aug 2022 23:00:04 -0700 (PDT) From: Kairui Song To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , linux-kernel@vger.kernel.org, Kairui Song Subject: [PATCH 0/2] mm: memcontrol: cleanup and optimize for accounting params Date: Tue, 30 Aug 2022 13:59:47 +0800 Message-Id: <20220830055949.12640-1-ryncsn@gmail.com> X-Mailer: git-send-email 2.35.2 Reply-To: Kairui Song MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kairui Song Patch 1/2 changes the behavior of kmem accounting a bit, making it either globally enabled or globally disabled by boot params and no longer affected by the creation of the first non-root cgroup. This might be a bit arguable though. Patch 2/2 optimizes some hot paths by making cgroup_memory_noswap a static key, benchmark shows swap paths now have a ~4% lower overhead. Kairui Song (2): mm: memcontrol: remove mem_cgroup_kmem_disabled mm: memcontrol: make cgroup_memory_noswap a static key include/linux/memcontrol.h | 8 +------ mm/memcontrol.c | 45 +++++++++++++++++++++++--------------- mm/percpu.c | 2 +- mm/slab_common.c | 2 +- 4 files changed, 30 insertions(+), 27 deletions(-) -- 2.35.2