From patchwork Tue May 28 20:20:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 13677355 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 9E5B7C25B7C for ; Tue, 28 May 2024 20:21:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2002A6B00A3; Tue, 28 May 2024 16:21:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 15E786B00A4; Tue, 28 May 2024 16:21:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF9B76B00A5; Tue, 28 May 2024 16:21:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C572C6B00A3 for ; Tue, 28 May 2024 16:21:49 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 80D9D14046E for ; Tue, 28 May 2024 20:21:49 +0000 (UTC) X-FDA: 82168925538.23.FCD4732 Received: from out-175.mta1.migadu.com (out-175.mta1.migadu.com [95.215.58.175]) by imf30.hostedemail.com (Postfix) with ESMTP id 6D38880009 for ; Tue, 28 May 2024 20:21:47 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=LVdjxeY3; spf=pass (imf30.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.175 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=1716927707; 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=iHmz/4j1k+x1JyR1DIx1IjyudPVgo21HIVNpr+GFlhs=; b=WJ/83iZHYDORUhGAbrhuOoZtzcNl0oYYF29WKpAVcZU12/ceg2sQpGmeuXvuzoeeI5Bz0g O77lMEz/7mJUgytePg4ON++8CNBNNaYU0VpbLa9/dj/m1KAh7gG8q42IiIJLjMXReSFrIw YcMAeZn+5kU3IaEN9ntPy3o6sqOZ3yU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716927707; a=rsa-sha256; cv=none; b=8jAyFGKzPf0BwQ/7MZcE89ItGrypAnjlgqwMVo3Dvy1gi/s6tsZOgJyqt7F+BRNCM+QouJ mrkXPLsreT5hNL8XOOgQ/t8NrL8xQosXi/qNbpuq2QCSQL/DW+MZaDi5wZQxc5zAH93CsI zmtTxx7bNN+RxqYTNXRlx33A0XUkvFo= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=LVdjxeY3; spf=pass (imf30.hostedemail.com: domain of roman.gushchin@linux.dev designates 95.215.58.175 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Envelope-To: akpm@linux-foundation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716927706; 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=iHmz/4j1k+x1JyR1DIx1IjyudPVgo21HIVNpr+GFlhs=; b=LVdjxeY3LUib37ppAfCHlYVPf/yApIN0kLiPB4FhEQDPrNz936dNx1FmhJTTlzA/+vt2ZN aNsexft76Fo9VCdnuUG+U5S0qohsfoHgSdvCO/XXJNh02mdFVF9Dne0aDA6WrkIjiCpDnL PQGCwOvl7qqurpkyKBNvI3YnND5IhW8= 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 07/14] mm: memcg: rename memcg_check_events() Date: Tue, 28 May 2024 13:20:59 -0700 Message-ID: <20240528202101.3099300-8-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-Server: rspam03 X-Rspamd-Queue-Id: 6D38880009 X-Rspam-User: X-Stat-Signature: tpjuj594sswyftz49uc9hk6eqj7hqexi X-HE-Tag: 1716927707-78141 X-HE-Meta: U2FsdGVkX1/Ai4BChHU8S4CY0uF01Za4hiluECAdtPoVa0OctD87LDJMrCOfEUQq9xHLRO9TCU+fAGOCQ8d30tb5mAgRiSCZbQWfo6XJYABMeUhzRlkUkDN5yScLwe6slAVcrWvtVaByw5mmIQOsgQuC/dWz1LKYCMjFy1Tgep9MrMGODyHH2VygAUDHRyDCIXe8xwJ0ug8J64r8zCEwVWmSGgxKkhdIo/4usrNghSsQSVer0LuqV3NB+aFs4C9LiEsFNBmq2ikPow9Bckm75YAm7wsWG44Tur8W7sqehlPwXFZrJ8ZwZj5HEBEGV6eDJfcvcjo0mmi4IxHBYBfd8ijc9j16U5UTcg/Ykji1rCgsHWvpAda4bcoo82rQSToXr9U00ek8UphM4tE7vjpq+MbjaXC9E3XULfLibA+xu7UeSzd/xKOsB+CzIz5dR66qD6M8Z0OPq6UJ278vxEq1Pcq65ste5NT3RzJu7kklCbER2IUOZAXSHzRxZc3TOB9DnJLlrAEwqOvb9Q/yYPQQuymG4Zl4FWW2WTaTluZSEdq67AwRIISw17IU/Tinv4VdRhOn8jUYr/t3dsCT//VCO29yEm8/KPOvqYRVTpkw559SQqCMoxZ88e04w2akNt+LiAtlHr6kEn4pdj6xDfMYHstegDZmIDjcYY69+zoibQg9RViZcv5mq1+uJLSQT3034btURM3yS9kWjZyOnamnYQLp/prGQw6UUYBwNc+Gp2Giw4AlStA/o9F15lOlHhFgLTzQqF9tq+/StDkZwU8q1dYSHALy9p5p5d/U/DE6J1lX3G3b8BFxyZw5zdXZzSZhmUXgskS28z5fujmUS5/qGNLky1sjTMwX+ttJpKyr2XKmrM6VC60S73tvSzWa38u44MGoEgQXmLX8cmmRqu6EY0XbEDd5878QF8fcOBEXJhHl43fVrDaYnz2wO0UInCGwo9Ghb+Hu+P0mQaOzj6B Mx4zXe6K F2J24dp/rxHRrmi1yQ9TEM9057zpmz21DxoI1W9dOuXQZybJ5qiLfqtATWc3lVkEK4v0J2jA8/jiKaDCa6kIK10rT38VOIpYUyxtyDUQCUinGfrRWefTxK19IZQ== 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 memcg_check_events() into memcg1_check_events() for consistency with other cgroup v1-specific functions. Signed-off-by: Roman Gushchin Acked-by: Shakeel Butt --- mm/memcontrol-v1.c | 6 +++--- mm/memcontrol-v1.h | 2 +- mm/memcontrol.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index c47ffb6105931..8b8c2c9516349 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -835,9 +835,9 @@ static int mem_cgroup_move_account(struct folio *folio, local_irq_disable(); mem_cgroup_charge_statistics(to, nr_pages); - memcg_check_events(to, nid); + memcg1_check_events(to, nid); mem_cgroup_charge_statistics(from, -nr_pages); - memcg_check_events(from, nid); + memcg1_check_events(from, nid); local_irq_enable(); out: return ret; @@ -1424,7 +1424,7 @@ static void mem_cgroup_threshold(struct mem_cgroup *memcg) * Check events in order. * */ -void memcg_check_events(struct mem_cgroup *memcg, int nid) +void memcg1_check_events(struct mem_cgroup *memcg, int nid) { if (IS_ENABLED(CONFIG_PREEMPT_RT)) return; diff --git a/mm/memcontrol-v1.h b/mm/memcontrol-v1.h index 524a2c76ffc97..ef1b7037cbdcc 100644 --- a/mm/memcontrol-v1.h +++ b/mm/memcontrol-v1.h @@ -12,7 +12,7 @@ static inline void memcg1_soft_limit_reset(struct mem_cgroup *memcg) } void mem_cgroup_charge_statistics(struct mem_cgroup *memcg, int nr_pages); -void memcg_check_events(struct mem_cgroup *memcg, int nid); +void memcg1_check_events(struct mem_cgroup *memcg, int nid); void memcg_oom_recover(struct mem_cgroup *memcg); int try_charge_memcg(struct mem_cgroup *memcg, gfp_t gfp_mask, unsigned int nr_pages); diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6bc9009bee517..c14b1b01bcf53 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2632,7 +2632,7 @@ void mem_cgroup_commit_charge(struct folio *folio, struct mem_cgroup *memcg) local_irq_disable(); mem_cgroup_charge_statistics(memcg, folio_nr_pages(folio)); - memcg_check_events(memcg, folio_nid(folio)); + memcg1_check_events(memcg, folio_nid(folio)); local_irq_enable(); } @@ -5699,7 +5699,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) local_irq_save(flags); __count_memcg_events(ug->memcg, PGPGOUT, ug->pgpgout); __this_cpu_add(ug->memcg->vmstats_percpu->nr_page_events, ug->nr_memory); - memcg_check_events(ug->memcg, ug->nid); + memcg1_check_events(ug->memcg, ug->nid); local_irq_restore(flags); /* drop reference from uncharge_folio */ @@ -5839,7 +5839,7 @@ void mem_cgroup_replace_folio(struct folio *old, struct folio *new) local_irq_save(flags); mem_cgroup_charge_statistics(memcg, nr_pages); - memcg_check_events(memcg, folio_nid(new)); + memcg1_check_events(memcg, folio_nid(new)); local_irq_restore(flags); } @@ -6106,7 +6106,7 @@ void mem_cgroup_swapout(struct folio *folio, swp_entry_t entry) memcg_stats_lock(); mem_cgroup_charge_statistics(memcg, -nr_entries); memcg_stats_unlock(); - memcg_check_events(memcg, folio_nid(folio)); + memcg1_check_events(memcg, folio_nid(folio)); css_put(&memcg->css); }