From patchwork Tue Jun 25 00:58: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: 13710401 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 08530C3064D for ; Tue, 25 Jun 2024 00:59:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA82B6B0357; Mon, 24 Jun 2024 20:59:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C5A0F6B0358; Mon, 24 Jun 2024 20:59:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD4D36B0359; Mon, 24 Jun 2024 20:59:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8C1006B0357 for ; Mon, 24 Jun 2024 20:59:45 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 08ADEA38D4 for ; Tue, 25 Jun 2024 00:59:45 +0000 (UTC) X-FDA: 82267603530.11.C199F68 Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) by imf22.hostedemail.com (Postfix) with ESMTP id EE743C0006 for ; Tue, 25 Jun 2024 00:59:42 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Zz5Mz7eu; spf=pass (imf22.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.218.175.173 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=1719277164; 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=hnnziElivuQ/LCoNmnyRRYzwKafGd1VzRo+k4WxWNEA=; b=ZqHOKkfDGke2ucRwAttLoptMyS4V3RsH2iffAcfeICWQaYrWMk6s72NzorOsc3w/+NRIY5 CgfMU4+KSjGBfhQRlcqy9MTHRdLdWTIkNVqgFDXRULgzldEWLN8QhMjA9gnLZSFb1ukZgB n9ZP7DCqD0W0nhMg8tYtNewvzd6WZN0= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Zz5Mz7eu; spf=pass (imf22.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.218.175.173 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=1719277164; a=rsa-sha256; cv=none; b=E7m/LCasOzflgjKOlgwTASZW0RkKcU1JTlbOAxR/VeQefXJUbrRkXrxRko9IJ/uN+5oZjR n1L8KLxgWgoLBKfkmSFJ2DLpRntJRNC/RMnQb6+Ohn719ZAzkmf55QeF/3pRMXK3W6SZ0I soecVFp4s/Z4vt9KbATqEcqZAVZAXGQ= X-Envelope-To: akpm@linux-foundation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1719277181; 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=hnnziElivuQ/LCoNmnyRRYzwKafGd1VzRo+k4WxWNEA=; b=Zz5Mz7euqVmt7XORkaBlHGPy1k/atuJWJKdYE/ol1NG1b2dsF0yeJlI/cbm0Uxkz0ZqpZn pLewHnkD7xPEgvO0eWlj+ZwU0Gqm2DsLuhAD54EVH+gmRtJ+lvmB6Qm5PKalMHH1WgMkBw 5Z2h3LBBZWTLBVkhIT9tXB/VOGV2AtU= 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 07/14] mm: memcg: rename memcg_check_events() Date: Mon, 24 Jun 2024 17:58:59 -0700 Message-ID: <20240625005906.106920-8-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: EE743C0006 X-Stat-Signature: s3z1k7h4fk7phm5988fwoydoxn5rsckw X-Rspam-User: X-HE-Tag: 1719277182-939321 X-HE-Meta: U2FsdGVkX1/xJMXGGgWik+ZJRU6/plzFeVumurvjB9ueFtqxSho3Nx0clqOBJuKWmmN8tS7qNYBqLqBJHeiiz+JaflvfddKPpCgLC0a3o5Z2ACQBE+zofRl4Qr/81xmxqmCKoyx3JxTE3RgJiVCXVKR3nk/cZc5YMTBsk/W5Ty9ljhpwTF0SLon4LuDd1zwk5FahekILhF8abUcueguCzDS4nJXSht+JADCQZV81ENsFPPXDd/SnULmwijWjoEHzd7uloV9ysHbcIeCfqO0JlVwaFxnkf4aIuHNgtGWCSENrVedNCzKvpFewhYjuBX6f+Hi6NpTFcZD8Q5vXVHtpcs9eyu3hD2H8hHnce4ydpPek3IlW6OYGjOrXUrnqxp95mjekb2GPBz8YOPD8VHThoyX9/FVb1Z/ErWN2m1mcisbHgXShdENqNYQEPfDHsuNxjMkN180WzgUbvt7GiPswoVqrjMj24ARs1V8zm9g9ZORlHoUJwMEMIz5dReHPQkOlsQWGOWxfnf5+NXgG0ppbOrWRb2tdNr0B+YA7Zts7t2zG5VXaALq4rseIMxkLm6v77RG4wc5TPnd9WpnFhHnXmriXHW/uAEJKJuVeb0DxDlVXZchUfuSZRQPwpI+jR6lxhGQMejjMU+dqwQK5TIas5WMVuy1IM5IJQdnwP5xaxgVrgekMnEB49f5i6CvXbzZXDVOBztNQYlLgEXuWQuw2DrZwBCA5fcGpjjNVc7A9p09Cn7+e/Z8VXgmQhGM75fSXS59mKIwkMp3LYJhL50mHCQX7n5JiMYXKjVBsm3ypKYXxQG5r+t37V84WH2JbXoGOa/0+XLfm7qU6+tAGWV0QE+8Tv7Q0URg7NKPHtTqrtp7+9sP/EdhWxwZG31nNnsrN8xXkGwsJ5dcfCF4ymJhStygFzivOVEzdwYHEA5JXGefKbE7kMAyQ6zcNFc8aIxO97pBxi7Ne4IrOSSL5K9e Z5lbZsS+ UmJt+tq3fl9B5vSZF16EN40lk/iIo3OQq4IKI8DinAc5rjDXYA+iNrrxDpB/wrRzAKRnJ/TsOgp5X6jWvyiLBgI5AvHCmuJh0SyJxhlmQyPD3VH7xV8pq0VS6UwrsGWniF0cZXYwD+4nstbIzOcnJEeZjBXnZbbPAoAMH 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: Michal Hocko --- 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 4b2290ceace6..d7b5c4c14732 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 524a2c76ffc9..ef1b7037cbdc 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 bd4b26a73596..92fb72bbd494 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(); } @@ -5697,7 +5697,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 */ @@ -5836,7 +5836,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); } @@ -6104,7 +6104,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); }