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: 13125266 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 441A0C61DA4 for ; Thu, 2 Feb 2023 04:35:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 77F136B0071; Wed, 1 Feb 2023 23:35:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 72F9C6B0072; Wed, 1 Feb 2023 23:35:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F7C16B0073; Wed, 1 Feb 2023 23:35:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4F7166B0071 for ; Wed, 1 Feb 2023 23:35:34 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 2D8EBA0A6D for ; Thu, 2 Feb 2023 04:35:34 +0000 (UTC) X-FDA: 80421088188.09.9FD9E7F Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf03.hostedemail.com (Postfix) with ESMTP id E9C0720005 for ; Thu, 2 Feb 2023 04:35:30 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf03.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675312531; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references; bh=9zftTJyo+H9K1r6E5yAXCXs7UTciLw39EYmR8nDDyRo=; b=kj2e2P8qCrrziXbYv9afVIERI8LN+T62Y5qgCxAESQb/vWk0Th4tXef8BHao5DjFwhiBqj 8/hbitO9GQ2wFTfD++YnkNEIq4LRG5qbTCdPTfQoDRNATxpai6uJFIOUdkmQhXwRwrbhEF iSdLSEkrsvgE/ZqHpSmlap9tN2eNtTg= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf03.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675312531; a=rsa-sha256; cv=none; b=rSm+amAc7J9PNLcDMXC/bTmtlkcklOkTGdp0oToacIroe4Of+8T37kJ9rP79hGDsMGFn0N HZb7gEAgcP0GjjLkiL1tXJTCbQ6AdUd2W4frgvDC60Bv6vo4S1ytk8njLBHSXOOQbZdK9m AV9oqnoKma4KNrfsjHaPKyoEPHSoSnc= 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-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E9C0720005 X-Stat-Signature: tbugazpo7urh4oqcw89m1pnz55muasmx X-Rspam-User: X-HE-Tag: 1675312530-465937 X-HE-Meta: U2FsdGVkX1+7sTmPGAGCsgj9fYYS8vdePbxCW8Q6rJ8zryFMCPvPZ7BuP9q+UnNbwpcDNbAK8bQ29747az2hYfKN857vbxrN/QMdIdhFMR/gN4DwtAneekdJ4lF7Y5voLc8b8zOQj84ievu/fAPO2kimU5QlnbU24JoZm7GVOpvBraScUQnd+Sdcflr72YbemvKmXaTpdNLBzSTMpH3iMJctjXA9wmmkO/QnxJ0e9xW3fLlBDmK2crBq3F2UyfncqVkg1udWT8TxKHiKqUot+kRTTS08HP7+MFqDYBz9yemsF8C4xaoTDq1lMO/YuwIb8QdwO97FrCsY/16fGwfJlJtkCWZzK9HFJeGONP1+JZkoKX45xWWAbdyAuRFYQNPOCz29O10iY4vRtPGu5A9FwKSPy9EKajrXu+k1xwrfHyUZ6M2lRcofwLY+zV/crIJcu6+LEAel1f26WPcUoNzoh4vrfG2s6vdzMlU3Z/zLulaDD0LqaSAxFELKi7TABi30kybg9otCHrqC5mP9Y8LaeRrKRnTFx1butPsO0reEJr0sLV95DQfIdpTO2E8ghKQQLA5nCc7lwEWiE+VLCY6vZ+R0dwZXitWYJgteqjDMwPCwtUnSIzhR2HVlVrkTEEUjo3x26sHIejMaUQsPrN1Rf0uZHs06nStzqa9ITozdYPuU9jCWMgVu29IXP0vsNgtNGQYm8p3/CueBgX0eXrpasvCQCrUf4f0LlEp5ioXPA1BtvBEacOyUPD5/LxBPj/bHsyiRRdMwzdmRSHICjEzQ/9UOxYIsYWG0dNvB53q8fHMNv1mF7vXen0vmzMWtPl43K+WWwETZmg91GU0QQKSaMlOiRxlBXnF6IeyYzsxnn6eUk9uusLm8o+4s/E4zofIPzOp8shWj5WACBt/Ppg8wkv/sVwPicgMaj99ZjIJtsbCGhExsV5DMb9mfO+B40Cr8nj23oa1v31UUZYptXLG 2gsXBBpH Ekjvy6HgN7ujfmRpHVtddEuV1CamX4sdBlUSbHz6t5d1/3j5tzNigrrKxvuvuIWsG0go4hsFuGyHKSV36XW95gTAhp2A6oaffgdaFWJa/lGi13W6Q5hC7DGr1BD+pIwkrlwOur86aCjtLAqHLtkHp8OXVcPSggpPttplqme6kUXmw/ECrC8WeausiKxT5GWzaEx0z+m+Sp+9vI0jb9rh2XAtcIpOwc+kG+2WSFTEtddSK0m9/2y2F8KrEjF7e83DxLvXId1J1yOVkz96ziIBpB9GXXjaejsghz2p+ZIJodVoYmUE2HO70svzlHOjNvKhus5WBo6fn/d/bbSQl7+rmLKJopXgFrxjtgnkr4VgY9eFYlcbkNqPrIKjQCQ== 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: 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,