From patchwork Thu May 9 03:41:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 13659409 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 AE6F7C10F1A for ; Thu, 9 May 2024 03:42:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 151726B0085; Wed, 8 May 2024 23:42:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 133C46B008A; Wed, 8 May 2024 23:42:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0160A6B0088; Wed, 8 May 2024 23:42:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D65316B0083 for ; Wed, 8 May 2024 23:42:16 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 68FD91C14FC for ; Thu, 9 May 2024 03:42:16 +0000 (UTC) X-FDA: 82097459472.25.2BF06DD Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) by imf16.hostedemail.com (Postfix) with ESMTP id 136E018000B for ; Thu, 9 May 2024 03:42:12 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=C9I4kRw8; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf16.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.187 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715226134; 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:in-reply-to:references:references:dkim-signature; bh=rKLnjSMYW0rtryZBKZNGvNcP75p9Czb+/CvNXoeOoAw=; b=OoHisBsDuUQkgc8Oqv0fqqE5wYyF/Fz+apo/aoWG3CdX30+jNFi2EoZIyJfPJC9evFFYun W/g+12WIg6QNuqWw2RNiMWHv4lw+WfCKUPTt3dhQtOEciDSn6c+di826/D+32ZgKEhsThN +iqjtHOxlONQQwWrPX4fd5zQlEPfDdw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715226134; a=rsa-sha256; cv=none; b=rVljej9APaFzLBhoxxAnosCpxlfb93XRkJe3ef2TMFB914I5j68iAeC2Y4abkzzH5gXAbB SdPRqAVNcbrPET05+lZQA9sg40RqyacHxXaq9PjxLinGIL/egHMq5VYw58IGuAbFZxKrjj 63Y0lt76eb9Pp/Jad8tG++mrWIVGOC0= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=C9I4kRw8; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf16.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.187 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715226131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rKLnjSMYW0rtryZBKZNGvNcP75p9Czb+/CvNXoeOoAw=; b=C9I4kRw8fb5UDp4pkzGRA9H3dZUtxqRmgP11T3RHqa8y3PoFuD/D9efJmQPHvyF/6rFi1f v7DvUV/c+DXZQPcbHtZL4P2IUSG7Nz1hbvfhvC+ERpvVgHD5GChL9h3uzRPnWdYLlU3v/V bqVXOv6tZwCWPqg9o0Og5NQnUZ/i53g= From: Roman Gushchin To: Andrew Morton Cc: Muchun Song , Johannes Weiner , Michal Hocko , Shakeel Butt , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Roman Gushchin Subject: [PATCH rfc 1/9] mm: memcg: introduce memcontrol-v1.c Date: Wed, 8 May 2024 20:41:30 -0700 Message-ID: <20240509034138.2207186-2-roman.gushchin@linux.dev> In-Reply-To: <20240509034138.2207186-1-roman.gushchin@linux.dev> References: <20240509034138.2207186-1-roman.gushchin@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 136E018000B X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: oit9gmgg8k1akbcwu38h99i6mht4kzc7 X-HE-Tag: 1715226132-444351 X-HE-Meta: U2FsdGVkX19jcPdVs3crpS5qe5FzWI5sRPhlriQmNf0Wkvlkn0s3HHzxcuPhlzaSNH10GjjiXu3RawuuU2HmCflzIXVTOhqurEHma52Uwf4S+0hfDLjV4Ur/6KDVC8/u70J/4R4q09RvHs61xUgbDtzmGs6VSjIZk1SmLMLZE94hyq6vunPrQKi1wMuyRMBWhNO5GYiQykD/YDitmwUw6qEvhambHTJ0DwtnSkDaOTLpZgGE8Gv87SFjzbdo0H42fJ77Mw84x1T8q+Lsry2OZZRPE+6dtncE9twH3wAi1VfDzyDqw/JfPcJQvNrHORySqtrWI+EHkDpF53QY9TQFIl05nnQtSxw51S9t1gEeVCTAIj+7SPN+lSWCoow3GlsVLE+ZLN2xSH2LjAqvpy1lXJ5jq+pndBe2IKvhcMu8YXHT+TjK9fdcHFP7fo+UwaAzsgDqcg6CSNefEXZX2K0efENCOmtOeehWD+lK7ocehjK5KxydZgvGVYppBBrSLmzByQdbeFzg1LsekLdtaaO8oJgezlLNaZnUFPQ5MOdHHn2tDYYloQplSOieMkJhavZP/xoj7DdtT03fsJScGp18s3rlPqLCplea1Tv7ztEvthNEBh9F01TkZDXBl2nwDx5p8WTsxmf59FrQPfAOEK8MtNqXsHpCiILKhZnCMtFH2gpurRW9EzXKAj6nyrohWPjPT5jsgtRxyLNC0v5kesh+2SFNGCkhDDbWJiTg13kDTadUcbquV85qUpJh3Gp4jRkJo4+hQjRfQ5/bX9Y8VpSvU3pK3JrP/CTDqg7AElFQRBoM/UbZajcDp2ePGzKlnt30wXlc4qi/7CLRoHFS62uS7OK2IAFdYRJW37l512iWWzlteXsOCBDzHNMaZfRpeW1p77VRziyn0YbuhwnbubndTe3znuCkJ10rVboinz6VDH63V2pGmDjg27L7BRInUED4e76Ra+7KaLe86G6q7fh u830MudJ ZafdkapScRT5huyXgZtALDhsEdkyAv6Egb/cmDW1yi31fnL8YG95UNdh7cf1BJp9HpwJSjCYevwqqzP0= 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: List-Subscribe: List-Unsubscribe: This patch introduces the mm/memcontrol-v1.c source file which will be used for all legacy (cgroup v1) memory cgroup code. As of now, let's compile it if CONFIG_MEMCG is set, similar to mm/memcontrol.c. Later on it can be switched to use a separate config option, so that the legacy code won't be compiled if not required. Signed-off-by: Roman Gushchin --- mm/Makefile | 3 ++- mm/memcontrol-v1.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 mm/memcontrol-v1.c diff --git a/mm/Makefile b/mm/Makefile index 25da205becdd..c717a3ee612e 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -26,6 +26,7 @@ KCOV_INSTRUMENT_page_alloc.o := n KCOV_INSTRUMENT_debug-pagealloc.o := n KCOV_INSTRUMENT_kmemleak.o := n KCOV_INSTRUMENT_memcontrol.o := n +KCOV_INSTRUMENT_memcontrol-v1.o := n KCOV_INSTRUMENT_mmzone.o := n KCOV_INSTRUMENT_vmstat.o := n KCOV_INSTRUMENT_failslab.o := n @@ -95,7 +96,7 @@ obj-$(CONFIG_NUMA) += memory-tiers.o obj-$(CONFIG_DEVICE_MIGRATION) += migrate_device.o obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o khugepaged.o obj-$(CONFIG_PAGE_COUNTER) += page_counter.o -obj-$(CONFIG_MEMCG) += memcontrol.o vmpressure.o +obj-$(CONFIG_MEMCG) += memcontrol.o memcontrol-v1.o vmpressure.o ifdef CONFIG_SWAP obj-$(CONFIG_MEMCG) += swap_cgroup.o endif diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c new file mode 100644 index 000000000000..4bc66fc244c0 --- /dev/null +++ b/mm/memcontrol-v1.c @@ -0,0 +1,2 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +