Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp900278lqo; Wed, 8 May 2024 20:42:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUunTiNh6Yiw/UrBxr8ACxiAYm0K/5JxbyX0qTvuSZgbZivRHZ5zuqVNGeRdHfmf7NU3Wxmbw/XUK2i4HNwNsWRHWn0F6H5KS9tqotLHg== X-Google-Smtp-Source: AGHT+IE8tzCK+j59ElQsF/kU9cg6y7wVVkksjpfQDMEN2SywtIuDM6jJUec+q7pzGxeGoy9eEM0S X-Received: by 2002:a05:6a00:6205:b0:6f3:ee60:54bd with SMTP id d2e1a72fcca58-6f49c21113fmr4526890b3a.8.1715226149935; Wed, 08 May 2024 20:42:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715226149; cv=pass; d=google.com; s=arc-20160816; b=hArQQc8adLtXCAhl8NV9d90DGZnkcIaLOB/gm7cooEBudJYrDZGT1CNgJfNycdvA+0 bM7XeNqNY3tqEFo8DXZxjjjr7QWPzTfWaVwI2JHAUah/RbDSyY3z3tdZmntpqraYFJlK dPA0Jj8JQaJ2mo4kgaFx0mbBLzCGJvmbVftwgjo/Wabi6DiVO1mDuhQ63zKOsp5hXu6B pxsdIiuI6QvFKbUJplycRfcb1Gx7QSALWsCcP82wjsi9GQh59/esqRvUUX7H9EQTNYpd o3S/PB+TDM+NYFz/tmuA3nZwRpK8tene1Q0xt7hj1tRxQ+f7T2fqTWE6nkopoN+68k2+ C5Sg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rKLnjSMYW0rtryZBKZNGvNcP75p9Czb+/CvNXoeOoAw=; fh=QUOYkrhvYyk//ZoGwHdb2m1c7vfsqYd5CGnq47wy3QU=; b=XQz5YxxOj9oSGymcTVniYRo4GBaKW3S4UmTOzmUVhSxgIDGd3JITpyaKj1FGEPF0uz qTKVx512Za7DeUnJpcBJVhiN2Vlje3ofm7v6tHDCj6CBCe8fgSU8zYG96k3ddjPnO851 SLdNqY9T3GiLZ6iyIFZP97eQUgyMDT9JCwmDtCFnedEPU4Ga5R5Ad2nOT0P3yZ3nGm/3 r+Yx99FkLpZC4zKWCWQT4AnzGs+Q+m07hJWaiAs+aiU5SNW3DlScIfuIJ6RUFRnpjwbt tYvXmZE7tAljuMTZTwGRV/rNReExCdYdN+Y3DxCk8fIwd5NdKjpylPJERJmerB0FW4+q VLYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=C9I4kRw8; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-174099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174099-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6341153061fsi514619a12.481.2024.05.08.20.42.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 20:42:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=C9I4kRw8; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-174099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174099-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7B7B3B223F3 for ; Thu, 9 May 2024 03:42:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D245C148302; Thu, 9 May 2024 03:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="C9I4kRw8" Received: from out-175.mta1.migadu.com (out-175.mta1.migadu.com [95.215.58.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FC4ED26D for ; Thu, 9 May 2024 03:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715226137; cv=none; b=VBtffYJQEB4muBUoQS/rDQNUp941QmLYBdYcEyu1YnqHpupWBFf7PSQKc7AmCNp6HkY+r+sPoYDhkRRk9Xe8c8PMnUwuLo9mK2TgAiEMP7H0msSFU2EGkX3yCkCJwVb/6hcGpWJAtuWve5XuBP7VghEUtQmRe4wXX/0n42dNLGA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715226137; c=relaxed/simple; bh=XbA4R/OJ/QKmeYyGMLZ4INzajwfxLTjdWKYR/SsggFM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GQQFkPQGhOcOLsQvHZsHqY13wDChxesy9Nb3Bp22bAcOyyJWGtY+TxRDVzzl2dKg8nxNFAd8Q9bdxzlGBPXoShWWZJEPpQeVMMw7EYzu4hrVb2BlxRZnxXL/U6Ac6BiLjE7p09KpV/6hzcSdv35LTjcZUKL4p6dNVmpWl8QxByc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=C9I4kRw8; arc=none smtp.client-ip=95.215.58.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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 + -- 2.43.2