From patchwork Tue Jun 25 00:58:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 13710397 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 6459FC3064D for ; Tue, 25 Jun 2024 00:59:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B974F6B0350; Mon, 24 Jun 2024 20:59:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AFBB26B0351; Mon, 24 Jun 2024 20:59:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 923376B0353; Mon, 24 Jun 2024 20:59:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 71AB46B0350 for ; Mon, 24 Jun 2024 20:59:37 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 196991614C9 for ; Tue, 25 Jun 2024 00:59:37 +0000 (UTC) X-FDA: 82267603194.21.A48FDDF Received: from out-176.mta0.migadu.com (out-176.mta0.migadu.com [91.218.175.176]) by imf08.hostedemail.com (Postfix) with ESMTP id C90B4160016 for ; Tue, 25 Jun 2024 00:59:34 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=vC47+CqM; spf=pass (imf08.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.218.175.176 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=1719277167; a=rsa-sha256; cv=none; b=zlPb42l9JZjOQ/caaTioEA0luqTrXocBNVquHeUBXgoNiEouXyw4a44eytXfv8CDykLUhG L+Rtfe51ZalGkjtbDsLgzljF92qU8DFfjsbaYQ3qTeSps28FwVhhZCO7g3AKLGS3dRqsvc bC366s9Auk3JtpjAE2jrfl4PdKDsA9c= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=vC47+CqM; spf=pass (imf08.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.218.175.176 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=1719277167; 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=jqHMldr5yb8EHMopv4QA8bs9iV164cfr+gO2HUVb6OI=; b=yRNiC5rs3sq3VogbB5VqNI4LLlY5RXHLEH32emaFPSBs08kz/nP0HSbgnvqdOhIV17twFY xfttOB+2s44MMwQrIchhe2D22gKA4cUKzNruprWUfSAMFZiS8ZM3cUASenamnEpWYknoZv 18cYlh2cMeRW9IXz3i9sZIksLs2pbxE= X-Envelope-To: akpm@linux-foundation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1719277173; 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=jqHMldr5yb8EHMopv4QA8bs9iV164cfr+gO2HUVb6OI=; b=vC47+CqMGWRzP59I6JXMOgvoaLbgn6Avaqr2H6e/hxJishCg/ejeMxkMXhSHpjUjIptXFO LFVdS25i0wSGT3zri597XOuNN81MUCYX5Yb7NzyvW3ye0M4dADWj+tGmjFyCUAN5oPQFgE 8zmBGd0hMknLsB9MyuQU7jNjIDMmrdA= 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 03/14] mm: memcg: rename soft limit reclaim-related functions Date: Mon, 24 Jun 2024 17:58:55 -0700 Message-ID: <20240625005906.106920-4-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-Stat-Signature: hex1gffagyk89us8ktxnbyf8s8y3eyec X-Rspamd-Queue-Id: C90B4160016 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1719277174-541185 X-HE-Meta: U2FsdGVkX1/JFK7MY8quX2Wu2vxv+bJ2oEF9DExwQhfozPXgUZsVaBTBONqYSn4RyFPBis89jXVCCUd4xHsJeHXSRL/YFOkO1in7F63haRmaWOkUQNqxUNTBCzUKQl+j3bJPUreav8xU8sgM+QO/m8T66SptB2BryZRzqJ5e7aulvtS7I2gt2f/4/Ua8+E0PXfwdLHqEYXJX3enEhICDvHDB4NbHG5dbufw+vQCWlQ1qIBt9OVSjCHS9kHJXGMAYHsHCV8EqKoKfHZeOw7b+v8ZQPNOySHiTkC6RUcvtIU++Lfc4+ioLWq4V257P4b3dWlszLI4PhBuJQ+Y4R77ts8Hvqr2JvKwUsZLD2itDFUh5s6W/tffGPfzduIX6f4gIEa5nL8Wlm3l4/8jrywjiiigA+sxU6gSaOfvNcRe5wDsZEl1yC++B0UDktvvoXYNRH/7aSJKjLCzDvIB6qUqrjIybt3/DqMR3+qHFrW9TcGOauWq4XmlxetCebWA9Yl74gMjD90gH6GBnDrVvAreE368ByByr0FoieD3iZNjdVJRVSyGDvx01PQLLxi1or6D6sDNkUFTgE7Y3t5DPOdOA3xdQOAMLxXhhZuL1Ru4AnngmIlcjPI/YU3gQAL/zBX3k18brj6er/d7a7l3upa5KFzH5LEhNXK9yzGl4IzEJi+ZmWThfSTlXyvZ5MP6aNg8+2Yi/dOCNX5nOvLdCPNZrVSwzpfGBMItqXy5Er3eyIVqZexU1KJ/UOkxq6RP470MiJ3VwuyDC2tIbFMq6p8HfevksRlp5G+2lpRtAK8xBy0NIncI8cldjcNV5ANxdWJMEEcmB3qI+d44G/DHYKnfNlQ4mDKEpF10kBpejc2yTVYQj34g7LIOFi7SczUFYJoms1i5IUgAQxx+pz/M+kbm+QZeTS1PSGN1udgv7rLP3dCMUHg18i9+k5mMI814Ys4NRQuY6NrNRrokUYRi++Hi r3VmTAfy VWbGxCFXVlR/KplchALyNRjfXbErHdEhuw0ictwiHoPLrojtStqQNbYUGT4q1aFXyJLBrCLF2lc+K4SSf7tkih1SRRg3fxF1Gow6h3Q47mioOqJF+HMG5TRI0Ow== 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 softlimit reclaim to have memcg1_ prefix. Signed-off-by: Roman Gushchin Acked-by: Michal Hocko --- include/linux/memcontrol.h | 12 ++++++------ mm/memcontrol-v1.c | 6 +++--- mm/memcontrol-v1.h | 4 ++-- mm/memcontrol.c | 4 ++-- mm/vmscan.c | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 7403dd5926eb..83c8327455d8 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1121,9 +1121,9 @@ static inline void memcg_memory_event_mm(struct mm_struct *mm, void split_page_memcg(struct page *head, int old_order, int new_order); -unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, - gfp_t gfp_mask, - unsigned long *total_scanned); +unsigned long memcg1_soft_limit_reclaim(pg_data_t *pgdat, int order, + gfp_t gfp_mask, + unsigned long *total_scanned); #else /* CONFIG_MEMCG */ @@ -1572,9 +1572,9 @@ static inline void split_page_memcg(struct page *head, int old_order, int new_or } static inline -unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, - gfp_t gfp_mask, - unsigned long *total_scanned) +unsigned long memcg1_soft_limit_reclaim(pg_data_t *pgdat, int order, + gfp_t gfp_mask, + unsigned long *total_scanned) { return 0; } diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 2ccb8406fa84..68e2f1a718d3 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -100,7 +100,7 @@ static unsigned long soft_limit_excess(struct mem_cgroup *memcg) return excess; } -void mem_cgroup_update_tree(struct mem_cgroup *memcg, int nid) +void memcg1_update_tree(struct mem_cgroup *memcg, int nid) { unsigned long excess; struct mem_cgroup_per_node *mz; @@ -143,7 +143,7 @@ void mem_cgroup_update_tree(struct mem_cgroup *memcg, int nid) } } -void mem_cgroup_remove_from_trees(struct mem_cgroup *memcg) +void memcg1_remove_from_trees(struct mem_cgroup *memcg) { struct mem_cgroup_tree_per_node *mctz; struct mem_cgroup_per_node *mz; @@ -243,7 +243,7 @@ static int mem_cgroup_soft_reclaim(struct mem_cgroup *root_memcg, return total; } -unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, +unsigned long memcg1_soft_limit_reclaim(pg_data_t *pgdat, int order, gfp_t gfp_mask, unsigned long *total_scanned) { diff --git a/mm/memcontrol-v1.h b/mm/memcontrol-v1.h index 4da6fa561c6d..e37bc7e8d955 100644 --- a/mm/memcontrol-v1.h +++ b/mm/memcontrol-v1.h @@ -3,8 +3,8 @@ #ifndef __MM_MEMCONTROL_V1_H #define __MM_MEMCONTROL_V1_H -void mem_cgroup_update_tree(struct mem_cgroup *memcg, int nid); -void mem_cgroup_remove_from_trees(struct mem_cgroup *memcg); +void memcg1_update_tree(struct mem_cgroup *memcg, int nid); +void memcg1_remove_from_trees(struct mem_cgroup *memcg); static inline void memcg1_soft_limit_reset(struct mem_cgroup *memcg) { diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 003e944f34ea..3479e1af12d5 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1012,7 +1012,7 @@ static void memcg_check_events(struct mem_cgroup *memcg, int nid) MEM_CGROUP_TARGET_SOFTLIMIT); mem_cgroup_threshold(memcg); if (unlikely(do_softlimit)) - mem_cgroup_update_tree(memcg, nid); + memcg1_update_tree(memcg, nid); } } @@ -5610,7 +5610,7 @@ static void mem_cgroup_css_free(struct cgroup_subsys_state *css) vmpressure_cleanup(&memcg->vmpressure); cancel_work_sync(&memcg->high_work); - mem_cgroup_remove_from_trees(memcg); + memcg1_remove_from_trees(memcg); free_shrinker_info(memcg); mem_cgroup_free(memcg); } diff --git a/mm/vmscan.c b/mm/vmscan.c index 900bad16e506..3d4c681c6d40 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -6186,9 +6186,9 @@ static void shrink_zones(struct zonelist *zonelist, struct scan_control *sc) * and balancing, not for a memcg's limit. */ nr_soft_scanned = 0; - nr_soft_reclaimed = mem_cgroup_soft_limit_reclaim(zone->zone_pgdat, - sc->order, sc->gfp_mask, - &nr_soft_scanned); + nr_soft_reclaimed = memcg1_soft_limit_reclaim(zone->zone_pgdat, + sc->order, sc->gfp_mask, + &nr_soft_scanned); sc->nr_reclaimed += nr_soft_reclaimed; sc->nr_scanned += nr_soft_scanned; /* need some check for avoid more shrink_zone() */ @@ -6952,8 +6952,8 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int highest_zoneidx) /* Call soft limit reclaim before calling shrink_node. */ sc.nr_scanned = 0; nr_soft_scanned = 0; - nr_soft_reclaimed = mem_cgroup_soft_limit_reclaim(pgdat, sc.order, - sc.gfp_mask, &nr_soft_scanned); + nr_soft_reclaimed = memcg1_soft_limit_reclaim(pgdat, sc.order, + sc.gfp_mask, &nr_soft_scanned); sc.nr_reclaimed += nr_soft_reclaimed; /*