From patchwork Tue Jun 25 00:59:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 13710403 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 134D5C2BD09 for ; Tue, 25 Jun 2024 01:00:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A3A8C6B035A; Mon, 24 Jun 2024 20:59:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 996EB6B035E; Mon, 24 Jun 2024 20:59:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 79C876B035F; Mon, 24 Jun 2024 20:59:49 -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 5BFB76B035A for ; Mon, 24 Jun 2024 20:59:49 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 15FBA1A1586 for ; Tue, 25 Jun 2024 00:59:49 +0000 (UTC) X-FDA: 82267603698.08.A3D371F Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) by imf04.hostedemail.com (Postfix) with ESMTP id E465440013 for ; Tue, 25 Jun 2024 00:59:46 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=eV89MCas; spf=pass (imf04.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=1719277176; 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=fbzH39LFdgO7g4Zh8QO5WwcNo4wg+o7OIMv0JFj+P7c=; b=Ls5TxD5m02xPkzJT0JSQDa7sonrjfnsNz/Mi6EJROMO54B+ChGxLA3m/ba2kYbl1Oq7sDQ loZk4FFyhMB1z4QkM/bdG4fmbAm2Lf8qIfzOxtOwyTAgE76zEgQzhHKgINGy5059VcvgDs jBNYz1IM6p0hh2AOJdXbRs/RkZsp0kI= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=eV89MCas; spf=pass (imf04.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=1719277176; a=rsa-sha256; cv=none; b=0Nmqmi6HEM1xH5kfyb0VWzXiryT4fe0ek5EiBTmvosTI6UhsrJVoo6rsSsE7Y11v33TFxI cqyRbejUYOO5IJcDCYvnJ7yhM6SSUzT2pPhhQwTSBF25l+XxCIXR8Pw0z1qPIHhX4DC3Jd vYbCQINLTvUEzpqgmiRm02qF2yUb2PI= X-Envelope-To: akpm@linux-foundation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1719277185; 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=fbzH39LFdgO7g4Zh8QO5WwcNo4wg+o7OIMv0JFj+P7c=; b=eV89MCast7EgJhdesN7qSvQtr85YMmOO0k2w6ijFUtydlNQ78AauHRfRhUjsPEeOfbC5Gx dtcK/V9nKa9SNmF/5FFvf0Xxi6O7J2yw96sE17lemuK/TV1CjppWoMQQb/mE6M7L50bNMj 8VHqifkS/V/BI3Pm3oEoZbviAukkS9Q= 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 09/14] mm: memcg: rename memcg_oom_recover() Date: Mon, 24 Jun 2024 17:59:01 -0700 Message-ID: <20240625005906.106920-10-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: hh4ughr9wfdmx7ypjfgs8bte53jqea6m X-Rspam-User: X-Rspamd-Queue-Id: E465440013 X-Rspamd-Server: rspam02 X-HE-Tag: 1719277186-466499 X-HE-Meta: U2FsdGVkX18GMwXfASD3TzKdT2bKtRtS4sFjZc2tzEOk+BgjKAQ4GPKwor+j6CNsPLVxX/9t7ui+LYEHtDKdAzD5DwtK0kF5dHce6WIRJNYhHZZ1IlLL1KP6cpVC4482S6D+eSGtBPOc0tg/1TI28Tpq0JfC2MrIXF3i4VITkwg+ZxGOyq3Um45npsyL/C1dXx/00aG0IFmWzkGquduWgGjW4I70iknX4Hf07Quje6jxZHjrqGFM1i+luhOZrDszvn4M6UoKkTIQ52eN3rWF+oH+8Ztr9VAbZQfrbYxUOY8dJzyYCjkLa4epKqvwufqVSeDUUBUOm2B6YxFelPFo2C2sGzXZTUJLteihauRhRWdEm+LrrkX5QITmaI9gak0attfckuDR+K296VocR+MiVP7RFfvrvSlw302X1V3alha0gJcfvIMAw8MT6vSZSskm/7Y6AJIsYhSITDTF5oA3jFsU0x8JYMuLfYOqP5cHp2Og7BxRNiNQ9wO9BIrcEUAGtc0EV7MWgdY6YLVZFIWjK5bN4Vg7s63PW5VaQKbss9z+/zHGFHgAvPH6Lemau3rXMaBMjw8+rahYk4Rts00qnIT9V8D7a28nGefHajxG8Z5UJOv+7XHuzc6mvrz6OwMLt2JP6y1g6/bi09ZxqVgz7cgKNJ52Z6uL0p77+fVFEvSRl68FO703Njw6I37BVsNCC27nSiOAh+xR3KG+dLaYQz/+HyvtBjaciGgKpCkglBTMUYbZqvEg8hiUR7zINeoZ3P7zGzDsOnnPzFhs4EeoNEC2teIG86XqUWOc37b9d2lL7ETOVooeXVEF73vweoe51Wh+NQOMNe12Ujak36NJDlFgLJrZtRBUY7qnAGkvQZiHc4xkDfpgiWDHAfAwXfO21wof58uyDIWozdmFv92W+NkEyufvDlrRzCenKPnZ1s1WyCWdoajZGUwx7sxZkUMUTupnrEe4e3wGf/wdNP7 T2q7BNNV +vGpTY1KC4B3RHUNSUjlN4+99NAqkJEK2IR3YtPzCniMkrfByLEaf8uo3a34rJwePrKOZyqmzZQFV71Uu+tdckQwO/ZBhPraPbjNGWcQbJ1V6u/t8V3geuqzBbqqy0BC3MB5J6e6NJsyrDaQkiSfGCpNQwRz2ntXI+GI7 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_oom_recover() into memcg1_oom_recover() for consistency with other memory cgroup v1-related functions. Move the declaration in mm/memcontrol-v1.h to be nearby other memcg v1 oom handling functions. Signed-off-by: Roman Gushchin Acked-by: Michal Hocko --- mm/memcontrol-v1.c | 6 +++--- mm/memcontrol-v1.h | 2 +- mm/memcontrol.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 253d49d5fb12..1d5608ee1606 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -1090,8 +1090,8 @@ static void __mem_cgroup_clear_mc(void) mc.moved_swap = 0; } - memcg_oom_recover(from); - memcg_oom_recover(to); + memcg1_oom_recover(from); + memcg1_oom_recover(to); wake_up_all(&mc.waitq); } @@ -2067,7 +2067,7 @@ static int memcg_oom_wake_function(wait_queue_entry_t *wait, return autoremove_wake_function(wait, mode, sync, arg); } -void memcg_oom_recover(struct mem_cgroup *memcg) +void memcg1_oom_recover(struct mem_cgroup *memcg) { /* * For the following lockless ->under_oom test, the only required diff --git a/mm/memcontrol-v1.h b/mm/memcontrol-v1.h index 3de956b2422f..972c493a8ae3 100644 --- a/mm/memcontrol-v1.h +++ b/mm/memcontrol-v1.h @@ -13,7 +13,6 @@ static inline void memcg1_soft_limit_reset(struct mem_cgroup *memcg) void mem_cgroup_charge_statistics(struct mem_cgroup *memcg, int nr_pages); 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); @@ -92,5 +91,6 @@ ssize_t memcg_write_event_control(struct kernfs_open_file *of, bool memcg1_oom_prepare(struct mem_cgroup *memcg, bool *locked); void memcg1_oom_finish(struct mem_cgroup *memcg, bool locked); +void memcg1_oom_recover(struct mem_cgroup *memcg); #endif /* __MM_MEMCONTROL_V1_H */ diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 8abd364ac837..37e0af5b26f3 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3167,7 +3167,7 @@ static int mem_cgroup_resize_max(struct mem_cgroup *memcg, } while (true); if (!ret && enlarge) - memcg_oom_recover(memcg); + memcg1_oom_recover(memcg); return ret; } @@ -3752,7 +3752,7 @@ static int mem_cgroup_oom_control_write(struct cgroup_subsys_state *css, WRITE_ONCE(memcg->oom_kill_disable, val); if (!val) - memcg_oom_recover(memcg); + memcg1_oom_recover(memcg); return 0; } @@ -5479,7 +5479,7 @@ static void uncharge_batch(const struct uncharge_gather *ug) page_counter_uncharge(&ug->memcg->memsw, ug->nr_memory); if (ug->nr_kmem) memcg_account_kmem(ug->memcg, -ug->nr_kmem); - memcg_oom_recover(ug->memcg); + memcg1_oom_recover(ug->memcg); } local_irq_save(flags);