From patchwork Tue Jun 25 00:58:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 13710399 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 D3F44C30659 for ; Tue, 25 Jun 2024 00:59:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A13EE6B0353; Mon, 24 Jun 2024 20:59:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99C296B0356; Mon, 24 Jun 2024 20:59:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 727EB6B0355; Mon, 24 Jun 2024 20:59:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4EF6E6B0353 for ; Mon, 24 Jun 2024 20:59:41 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0C648C14D3 for ; Tue, 25 Jun 2024 00:59:41 +0000 (UTC) X-FDA: 82267603362.25.15D7523 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) by imf27.hostedemail.com (Postfix) with ESMTP id 065C440004 for ; Tue, 25 Jun 2024 00:59:38 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=SFL+k+TQ; spf=pass (imf27.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.218.175.188 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719277160; 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=v/tf3lBw3jG/rT7MJZGDLV/4uYe72LY+pJRmiKuAdfM=; b=hT6OUlhjYQmnOsbXvIWzjbnVzlmDxCZ25UUVP+4Ab5GfRiSZIkY4CFaVRzoRHVv969Zv5l cmlXH+IZH87vLpKVzEHnfFORHtYlju6XUIF0737VN3smXmodCSISACPGCczS+i/d4VBKhU PvGAn53k9jTfjXXDxfT7ybGK1wppSEY= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=SFL+k+TQ; spf=pass (imf27.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.218.175.188 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719277160; a=rsa-sha256; cv=none; b=fNLkFubE3AlJ3fl9iodpi8qEfr3OytnS0PYhlYDFgT3jaqigrRDnMNCl4NJxA9Z+lfSc0G AZBMLFxPknWLxxmCuW9XCt1PcOrUCBg/Wnv/BHJ4MJu8tCXJw9fsgVMqDm2qV0ggeRuXV6 77YKzYMTZ/0Wlh3CMO1ebnR6epFjUTo= X-Envelope-To: akpm@linux-foundation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1719277177; 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=v/tf3lBw3jG/rT7MJZGDLV/4uYe72LY+pJRmiKuAdfM=; b=SFL+k+TQiNlRjgoH6x50pq3n0QiBjYIdOlFT3DK3/1aCGerHYnl1GSqWHiUELtnGjVl6cf EHBcQ4kFu/PRip99CGJsa6MpFTpsdvUA9eQKJSLiBJ56N+W0FFhsvBi6fisG0L48+JrNBH AoKWwYioVwfLl56ihuUsHU1AN4cR280= X-Envelope-To: hannes@cmpxchg.org X-Envelope-To: mhocko@kernel.org X-Envelope-To: shakeel.butt@linux.dev X-Envelope-To: muchun.song@linux.dev X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: cgroups@vger.kernel.org X-Envelope-To: linux-mm@kvack.org X-Envelope-To: roman.gushchin@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Andrew Morton Cc: Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Roman Gushchin Subject: [PATCH v2 05/14] mm: memcg: rename charge move-related functions Date: Mon, 24 Jun 2024 17:58:57 -0700 Message-ID: <20240625005906.106920-6-roman.gushchin@linux.dev> In-Reply-To: <20240625005906.106920-1-roman.gushchin@linux.dev> References: <20240625005906.106920-1-roman.gushchin@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 065C440004 X-Stat-Signature: qym3dik9drwpzu6wdybxxxqm9d9xshpg X-Rspam-User: X-HE-Tag: 1719277178-64412 X-HE-Meta: U2FsdGVkX1+H0AWMbuY5D37UEV84FSLBV8rZoYKrR8hp2Ig1TgHArwJxLJZTNllzjIMTuUjbwYa9rhAXg8WEaq25LmXpyYk15m0GnulThKpoA25ePP2KBSIQo43OREZY3i1mRtq/HZWeufqhj7ijaJ7jPl+DZhkYQe7/c+oGyQP/Z3g8IihOURJnkTKF6+5IoE7FZNd7kyQ0+YYSfwVx8Dzf4NWmciCNKA0vniT7sZP8fx0cG2JiPZyani7b8VOpi8l93Z6VynyGcBjPHEZdYANW3Xi/05aq2NRf81zMgCRZo/zfIvKtCIsoU7ybeI9Qgl2BbYkf1yKk7VnRaI0BLw3IbAtW0A3JkgJiydBrSeG1x4/M5YKkKo6vv6yN7/cmmeuIBbnDOwceDg2AKYwVQaK0CO9D95kbAh8fEYADF0M2pPimaMXLm0uUBtw+u6QWO7uq0nsBj8hyU/lgqB+8i6O1a+Woyf7HtDgNGjTih7UhMtjYi73npNfSuIsjRED3DGNaW0tvrDuT+Xh2gnaXnYiEtvgtU643n27vfoXIFv/YDYCjI9coOpAUPln+zptkRSjsniR+9S2FJ+SAPYRbmxCT8tddST1+5swKNfQ2hENWfZNdE1jdBGo5v2clp+yZ7GzuEU62hoTc0MfIv89+3RE9PRLGD7ms2Q+JM8JDKKjSVZNeyiGdymq36yqfum8JZPTxlLKmPAGP8BHZoDwb4Jw96oyh2eZMq3gCGCIYR+RiK8Ht3a4mDFuDbQ49Czruj/UOWwI7tUav4abAAO6uVrCtpL2dynFI6wa98qCCwXIbnA5nypZZGoUXe1FbO+zHjoMz1HrGW/2ePKIeYuBmCy3hGb6h4hw3QqkR3ti0UL7z3uvs2dh+vAxxtnIe5JOFbUgqxNBw/a4tQLMkrcPsX0tUENpP0pftcBy3m2ZvNtvUkXOI8klESz8nzK7FD7GpiZlaPjicYV3RprfFk6C zetmGjfh VEpddA6BRb78tClqxDgZ5HZl2CKnOpIbPcdLzrHjVUmGw2LpjPM4MTqWnPzysSiHWQJu+SF8+PGhcQqL9cZva/0wLMAnHXD4dLPhWSGHSWtMAr9w= 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: Rename exported function related to the charge move to have the memcg1_ prefix. Signed-off-by: Roman Gushchin Acked-by: Michal Hocko --- mm/memcontrol-v1.c | 14 +++++++------- mm/memcontrol-v1.h | 8 ++++---- mm/memcontrol.c | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index f4c8bec5ae1b..c25e038ac874 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -384,7 +384,7 @@ static bool mem_cgroup_under_move(struct mem_cgroup *memcg) return ret; } -bool mem_cgroup_wait_acct_move(struct mem_cgroup *memcg) +bool memcg1_wait_acct_move(struct mem_cgroup *memcg) { if (mc.moving_task && current != mc.moving_task) { if (mem_cgroup_under_move(memcg)) { @@ -1056,7 +1056,7 @@ static void mem_cgroup_clear_mc(void) mmput(mm); } -int mem_cgroup_can_attach(struct cgroup_taskset *tset) +int memcg1_can_attach(struct cgroup_taskset *tset) { struct cgroup_subsys_state *css; struct mem_cgroup *memcg = NULL; /* unneeded init to make gcc happy */ @@ -1126,7 +1126,7 @@ int mem_cgroup_can_attach(struct cgroup_taskset *tset) return ret; } -void mem_cgroup_cancel_attach(struct cgroup_taskset *tset) +void memcg1_cancel_attach(struct cgroup_taskset *tset) { if (mc.to) mem_cgroup_clear_mc(); @@ -1285,7 +1285,7 @@ static void mem_cgroup_move_charge(void) atomic_dec(&mc.from->moving_account); } -void mem_cgroup_move_task(void) +void memcg1_move_task(void) { if (mc.to) { mem_cgroup_move_charge(); @@ -1294,14 +1294,14 @@ void mem_cgroup_move_task(void) } #else /* !CONFIG_MMU */ -static int mem_cgroup_can_attach(struct cgroup_taskset *tset) +int memcg1_can_attach(struct cgroup_taskset *tset) { return 0; } -static void mem_cgroup_cancel_attach(struct cgroup_taskset *tset) +void memcg1_cancel_attach(struct cgroup_taskset *tset) { } -static void mem_cgroup_move_task(void) +void memcg1_move_task(void) { } #endif diff --git a/mm/memcontrol-v1.h b/mm/memcontrol-v1.h index 55e7c4f90c39..d377c0be9880 100644 --- a/mm/memcontrol-v1.h +++ b/mm/memcontrol-v1.h @@ -29,11 +29,11 @@ static inline int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n); void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n); -bool mem_cgroup_wait_acct_move(struct mem_cgroup *memcg); +bool memcg1_wait_acct_move(struct mem_cgroup *memcg); struct cgroup_taskset; -int mem_cgroup_can_attach(struct cgroup_taskset *tset); -void mem_cgroup_cancel_attach(struct cgroup_taskset *tset); -void mem_cgroup_move_task(void); +int memcg1_can_attach(struct cgroup_taskset *tset); +void memcg1_cancel_attach(struct cgroup_taskset *tset); +void memcg1_move_task(void); struct cftype; u64 mem_cgroup_move_charge_read(struct cgroup_subsys_state *css, diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3332c89cae2e..da2c0fa0de1b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2582,7 +2582,7 @@ int try_charge_memcg(struct mem_cgroup *memcg, gfp_t gfp_mask, * At task move, charge accounts can be doubly counted. So, it's * better to wait until the end of task_move if something is going on. */ - if (mem_cgroup_wait_acct_move(mem_over_limit)) + if (memcg1_wait_acct_move(mem_over_limit)) goto retry; if (nr_retries--) @@ -6030,12 +6030,12 @@ struct cgroup_subsys memory_cgrp_subsys = { .css_free = mem_cgroup_css_free, .css_reset = mem_cgroup_css_reset, .css_rstat_flush = mem_cgroup_css_rstat_flush, - .can_attach = mem_cgroup_can_attach, + .can_attach = memcg1_can_attach, #if defined(CONFIG_LRU_GEN) || defined(CONFIG_MEMCG_KMEM) .attach = mem_cgroup_attach, #endif - .cancel_attach = mem_cgroup_cancel_attach, - .post_attach = mem_cgroup_move_task, + .cancel_attach = memcg1_cancel_attach, + .post_attach = memcg1_move_task, #ifdef CONFIG_MEMCG_KMEM .fork = mem_cgroup_fork, .exit = mem_cgroup_exit,