From patchwork Thu Feb 2 04:32:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 51669 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp37283wrn; Wed, 1 Feb 2023 20:44:48 -0800 (PST) X-Google-Smtp-Source: AK7set+mz8URcpfMR9t+nWKJ+dlVyPquOj9n8F4C4VMi5MVxyB81NPhFOuUmMHGdx306uISR/DnB X-Received: by 2002:a05:6a20:3d90:b0:be:a7f8:78a6 with SMTP id s16-20020a056a203d9000b000bea7f878a6mr6602019pzi.42.1675313088249; Wed, 01 Feb 2023 20:44:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675313088; cv=none; d=google.com; s=arc-20160816; b=NsDWN+4z1UvyECH8lU5DPEvMunSHYpCicVf8vHF+PJiIobF9MbQ6gEAWvfekV3cblc TOl/5fqqHOPoCgn0wqbqlcwOAxQq9aQ+Pm8qw4fbh9WkV8VJTBFDOrQBWXbvEW9nop2C ARpZDt0PvA1wA1M+FXxCWNdoAco4qkTWEjjH48qjhzMRh8UpsGNl0SIbwltEDf7JfO37 OMRmWr64kjc7iJUJogEJl7SXXuMoO/FeCmdfYFR/QQv9n6TyC2UG5PtS777mj7B4Q0Sz r53rebCmhkX/N+UGnVfkkOWI/h1Rtx25MX15By/WE/NDWgfecLYWLFc4h8MIHPU5wqCX 1PJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from; bh=9zftTJyo+H9K1r6E5yAXCXs7UTciLw39EYmR8nDDyRo=; b=RTwyPBam54b+fWlnmcyFIcKcplyfgGncmxgjS9aFCsx4Sv/pjWsynovMQera3QNavy 0fQm73OnrCYnfVljZqyNOtCP5vo0oEIy8LcAkQ+5DugFLbVK8MShDU6vJRh5iB1RVZz3 gJSRKGrRz7apLh+Da/p0ifvf2sNud62IIkwos9MDADyQmMMm3nrvq9kcq/Kp0I9ueanH ayDm7K/LDrL5TARowPdmhDVsPmMZP69mPMuy4U9tZf+wf4HSww9uycXzD3zRtkFRVyF7 XplexnVCK+8+NS1omZ+zW0wSsauRLEJpgXxhuuDlOXtwii0t1VddyOxT59+9swadab2w 3Tcg== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 13-20020a170902c14d00b00194c90ca330si21251385plj.335.2023.02.01.20.44.36; Wed, 01 Feb 2023 20:44:48 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230372AbjBBEdZ (ORCPT + 99 others); Wed, 1 Feb 2023 23:33:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbjBBEdX (ORCPT ); Wed, 1 Feb 2023 23:33:23 -0500 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16338577D9 for ; Wed, 1 Feb 2023 20:33:19 -0800 (PST) Received: from SHSend.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by SHSQR01.spreadtrum.com with ESMTP id 3124XE5W017671; Thu, 2 Feb 2023 12:33:14 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from bj03382pcu.spreadtrum.com (10.0.74.65) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 2 Feb 2023 12:33:10 +0800 From: "zhaoyang.huang" To: Andrew Morton , Johannes Weiner , Peter Zijlstra , Michal Hocko , Roman Gushchin , Shakeel Butt , , , , Zhaoyang Huang , Subject: [PATCH] mm: introduce entrance for root_mem_cgroup's current Date: Thu, 2 Feb 2023 12:32:57 +0800 Message-ID: <1675312377-4782-1-git-send-email-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.0.74.65] X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 3124XE5W017671 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756693096625286881?= X-GMAIL-MSGID: =?utf-8?q?1756693096625286881?= From: Zhaoyang Huang Introducing memory.root_current for the memory charges on root_mem_cgroup. Signed-off-by: Zhaoyang Huang --- mm/memcontrol.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ab457f0..158d4232 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6681,6 +6681,11 @@ static ssize_t memory_reclaim(struct kernfs_open_file *of, char *buf, static struct cftype memory_files[] = { { + .name = "root_current", + .flags = CFTYPE_ONLY_ON_ROOT, + .read_u64 = memory_current_read, + }, + { .name = "current", .flags = CFTYPE_NOT_ON_ROOT, .read_u64 = memory_current_read,