From patchwork Tue May 28 20:20: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: 13677353 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 A03D6C25B7E for ; Tue, 28 May 2024 20:21:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C62016B00A0; Tue, 28 May 2024 16:21:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C0D6F6B00A1; Tue, 28 May 2024 16:21:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8AEC6B00A2; Tue, 28 May 2024 16:21:45 -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 80AFD6B00A0 for ; Tue, 28 May 2024 16:21:45 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 37C9F160353 for ; Tue, 28 May 2024 20:21:45 +0000 (UTC) X-FDA: 82168925370.07.D4DA953 Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) by imf26.hostedemail.com (Postfix) with ESMTP id 1E884140004 for ; Tue, 28 May 2024 20:21:42 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=uEf6u+5H; spf=pass (imf26.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.172 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=1716927703; a=rsa-sha256; cv=none; b=avsbS4Kf5xO8yZr+utr5fmhR5pYaE56+yZG8beMWaUOn96ZPEEVYEB3eMYxDz71ph/WsC1 lgO+jX7sVJxfhokR1+8Zq5My4x+Ow9JVvNm0int2W2FT72v8eyD2JxQzvfSKTiRHo79qNJ cG8vuoGbWfaRKOBzGA2GyLZgHyiVnRM= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=uEf6u+5H; spf=pass (imf26.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.172 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=1716927703; 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=Eun9LANYNIu6WRYBzr/NUdVevzuva5x/1L5dxfrGADE=; b=LnTyjQLD7QWe2hO3/O69MJ6cBnpttotWNxaWEDVsHGS0Hh/x63z/3L9vY81eHa9Y0s1+re nvj3AF2uXPvU/oAMaOW4imyqTxSCXFyMXfNCEtbQ8OrOECaf7Ume2H3KLGnvPyBb7BrWn3 Thrw6F7qbwCv+pykQn2ufenMGcdDcII= X-Envelope-To: akpm@linux-foundation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716927701; 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=Eun9LANYNIu6WRYBzr/NUdVevzuva5x/1L5dxfrGADE=; b=uEf6u+5H2ptxKxJYJqPeQz4DfDY15c2qmOVY/ZbMWk4dE+M1nT/rRUA2ZEqtnnY+ri68h9 8aCs3D9eu74QEehioHZpRj37oa8wtOZTqdd3cDCg5sEnFhEEZwrVmVy9GE3VycxnUsYFHn FziRkd0mj5l+N0Zocgl/JWyUTsjDvfc= X-Envelope-To: muchun.song@linux.dev X-Envelope-To: hannes@cmpxchg.org X-Envelope-To: mhocko@kernel.org X-Envelope-To: shakeel.butt@linux.dev X-Envelope-To: willy@infradead.org X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.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: Muchun Song , Johannes Weiner , Michal Hocko , Shakeel Butt , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Roman Gushchin Subject: [PATCH v1 05/14] mm: memcg: rename charge move-related functions Date: Tue, 28 May 2024 13:20:57 -0700 Message-ID: <20240528202101.3099300-6-roman.gushchin@linux.dev> In-Reply-To: <20240528202101.3099300-1-roman.gushchin@linux.dev> References: <20240528202101.3099300-1-roman.gushchin@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 1E884140004 X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: 56fu73cp5w1c1gh8971qdcnx6cad5jdz X-HE-Tag: 1716927702-705052 X-HE-Meta: U2FsdGVkX1+Q7+V32xkBjAuT8+gQYUxdMTr23JTOY207dwGfFsTyZ9/t8Qmq1cInJQIsobUCEnxQi+l+nRGAC6dyhDLZRW7uU3y+P4a7iOKutcqxxYVQIq+kcAVcIGxijKsIx4vm4h2YbHy6riNwIKRB7xALGBeNrzc7oGCJOkqzAFLr43hWCVzB4Qs/Rddb5oOmMQWNix+eYvmOIxhj2+P9DHNUZDYUesjoyE/Ti0S49rHcADSRxAtLK0Kbw12OZJzSGeAXpCNzXWvClcItdF4/fzOGTm3k0REGa9jA7zpxL7WUHFxyqqQ9IAFCXGhjUqIZU7+jAuAbZgZrZYJhAQLYP/CcLd+KESxlK4XRCNPC9o1B1D3g7J249p1InQ4lf0XB75iVEVLrJ4w5EUS0DUTO0sDbeil3P7aMDBwVO+3+VHFn7Cw8RsjGtrvTClMINY6liVfDzE8F06Nb7zdgXeJ/oH3Ic4xRyAB8Udbxm+hv6mn72LyZa3vbXoUa01zaQ5/ADSyG/Tdmk27g0Zszs8gRUuJzLK7fAZgYVuVhV5SSDCUM2LB8LCYmXKJ3i0EhkBjU2hvwrMLDOlAWv777lWOs/KS7LJcnNAQBMfb4hFG5tgAHkUFh4eFBaNr3voJujH593X1uVxzxc2SYCx7UoglunroayM1cJIIRF9iquma9jOIjp78e1hPOq03WDvy71FfWrXxAZQuxIP9zdDM1xeB16jAA7WoXiajudwbzxtEgryHVC9xdVrbf3tV5msCdUd6nvkB1GK5NjeBaYeUPqFCQccMObyJH3AIHLnchAbiNn0dalp0QrPrKnKrUp7GySyeNBOM1a7sSbGBGwZz1/Xf01MH7t8id/3H8vG960T5tOkObD/Y9b/s6sBCjh5HvrZ9A4EM2HHD88RLaXUI7czxNieAL2fNpNcqC2v+DckKKsBFTcnmWMiDDHJdIAIxbqvkspcjpamNR3eXrMSz s85JuU2b ls/g1N6mMyXSmpgeL1T57ImhWqv6HRmRG3FLg99OIZFSCQ2zfJ5eE8R587Mym8tD9eYLlVQBOfdFmu+8= 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: Shakeel Butt --- mm/memcontrol-v1.c | 8 ++++---- mm/memcontrol-v1.h | 8 ++++---- mm/memcontrol.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index f4c8bec5ae1b8..f3ea01a17eea9 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(); diff --git a/mm/memcontrol-v1.h b/mm/memcontrol-v1.h index 55e7c4f90c399..d377c0be9880b 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 ba538ab0a80ad..b983cb6d1d228 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--) @@ -6032,12 +6032,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,