From patchwork Thu Aug 15 05:04:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 13764401 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 A183DC52D7F for ; Thu, 15 Aug 2024 05:05:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 352936B0098; Thu, 15 Aug 2024 01:05:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B1706B0099; Thu, 15 Aug 2024 01:05:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 153806B009A; Thu, 15 Aug 2024 01:05:38 -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 E96E76B0098 for ; Thu, 15 Aug 2024 01:05:37 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 793391C4D3A for ; Thu, 15 Aug 2024 05:05:37 +0000 (UTC) X-FDA: 82453291914.19.07CF4BE Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) by imf02.hostedemail.com (Postfix) with ESMTP id 96FA280023 for ; Thu, 15 Aug 2024 05:05:35 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=OMht0cRZ; spf=pass (imf02.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.183 as permitted sender) smtp.mailfrom=shakeel.butt@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=1723698278; 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=oBl+yNWVDTrBvPczXHA6yxAB2QIqH+IAeny01+DfM7g=; b=t7AZkBz8/oJPBevwaeg+l7hZd4Zm6GFbve9bby/hGaP/MaKcwoiQEBJ22CAVtsG6H9f3+R xFSFGpnKamXGSnxxTMu9190UtjG5fSGC4j1Ba4UAAEoiGzAFg+w0k0VHiL01n1cMasnOXM FqLHJxQpp12G0/Z5nCa2PsB4iqLwxq8= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=OMht0cRZ; spf=pass (imf02.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.183 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723698278; a=rsa-sha256; cv=none; b=x8pAHU+FSTmP0ibZnkm3Yis22BpRNVEjtc2P9zu63uyzp0Hi5J3XqtzfF0Jv5PG94nkG5R yZ3n9CpjbDnOAhz+QJOKU8xyR5fnlcxcKYoluMmkQ/CEXiMbjc0nRHpryubfGPPxRJuS7W MSw4V8oEclibHuGqOzy4Vq/psRZ6Syc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1723698334; 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=oBl+yNWVDTrBvPczXHA6yxAB2QIqH+IAeny01+DfM7g=; b=OMht0cRZt5CcDvh+ZY+LOgDLFGiDcR3YmhPy5UbQyi0DzGomb5EhU8GsdkP452q20TOv1z t+sdwOObMDH8uPitMzDC/boZ97f+rQ5TZcmRIq9RbN3yTFNZ5QEIEpHnAt2hD1ZbzSVGBv 4U5zzA23HbLNZpDzNDuvZZfoaBgON4I= From: Shakeel Butt To: Andrew Morton Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , "T . J . Mercier" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Meta kernel team , cgroups@vger.kernel.org Subject: [PATCH 5/7] memcg: make v1 only functions static Date: Wed, 14 Aug 2024 22:04:51 -0700 Message-ID: <20240815050453.1298138-6-shakeel.butt@linux.dev> In-Reply-To: <20240815050453.1298138-1-shakeel.butt@linux.dev> References: <20240815050453.1298138-1-shakeel.butt@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Stat-Signature: kn3d9gbyiirhae8rf77hhjdbke3npoxg X-Rspam-User: X-Rspamd-Queue-Id: 96FA280023 X-Rspamd-Server: rspam02 X-HE-Tag: 1723698335-437507 X-HE-Meta: U2FsdGVkX19CV45IWVwdPp7i41bwFNU1zC4D4stAOB4yX1b4WpZw/GYb7YDwTm4ckt24H3Hx8hIcd1cuhYsNGKH+sGASm3TW7ErBsTKY0DCBnV1HKtlFYWYLSe1WwBKN5KmXLbVFdt1T//L/92Z8VwNQjr39wR5A2ikMEkxNmPCMOF46lIjmJTDFDQmMdJwAnmxzJTpzol5Cc1uA2gnTrURxStGCplflqYwa1QdIXoQx0KD4PvB+yPxaVBZcKXmuL8X9qJZDbm31QvHrclG6XfzKaf5CmHlMYDwJ3sE6gad8iiN/vDsCFvSFhs8PA6/PpvZzhswqbY5b70CZWPiuzw3h0cK+nOKlKMxyhftJwm4XWTS2pOcmxtPMHD3WV1qRV4cz0xaTJ8b7MzTEULgPbmo3Ilxu3kLZp3gl5yyUZP6TrgCdPkmTtYOpQB0hNsXr3ZkQ1B253khMLcXEYBkymBMot1T6cu6JFJdMiz3BAQ306NeOXCS5qnge5AMN1VGrvAJSLcGyK0jvx51UfV+yNpuPkhr2QY3pPv3LehxUHpYX4brymF9AE6oDmPDtyIhf0PUZdeZ9t/tqOWUaqbjQZV7DcE3k+oTf9mJl1lzq0Uq8vFSkW7kDi6fdOzbIwFyV7h2ObK4qrcuxCQ5jr/jjngtoX9iw67QOKje4TzJaw5Qk0S+wRr0l+vCpcYV4dZUt2Oofw6DQ+yE//OsFtFg7eatXmd6+k3t2rKM/xnMRAafX+xTCpG/q7ZVhGHqPDyca0oZZRgV/0MxyJh14TSgx+HHwbm7IwxaEZ8FQad+ua+J7B4vLiRvKJV4aI3OyY4HfAUz7nnSIEj0sDNhBTaV5VRPba6VGXIIp91aqh9NVnncSGP8oomnSTxhPEa8FFFxI/54HI5uR2Ba36RXzEYM0kTKqBOBoodHmWq72CHPhd7BHzuTC97+9KbbdykO+MlEfJGgX/w1VOTas3Qb9MaR a6WpD3bK aYQ2s/Qh4iQeOO2Czj8CHZ3SSlQZawNtMy9fpgvnijk0QMm3wBDjfCsC1gTuqfFgyc9eN8q9tmJ4YTLSxeVjxKg8ENczViKK+1O1RjyvrTVkXffQy211GdGfy8w== 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: The functions memcg1_charge_statistics() and memcg1_check_events() are never used outside of v1 source file. So, make them static. Signed-off-by: Shakeel Butt --- mm/memcontrol-v1.c | 7 +++++-- mm/memcontrol-v1.h | 6 ------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index ffb7246b3f35..0589d08c1599 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -742,6 +742,9 @@ static struct page *mc_handle_file_pte(struct vm_area_struct *vma, return folio_file_page(folio, index); } +static void memcg1_check_events(struct mem_cgroup *memcg, int nid); +static void memcg1_charge_statistics(struct mem_cgroup *memcg, int nr_pages); + /** * mem_cgroup_move_account - move account of the folio * @folio: The folio. @@ -1439,7 +1442,7 @@ static void mem_cgroup_threshold(struct mem_cgroup *memcg) } } -void memcg1_charge_statistics(struct mem_cgroup *memcg, int nr_pages) +static void memcg1_charge_statistics(struct mem_cgroup *memcg, int nr_pages) { /* pagein of a big page is an event. So, ignore page size */ if (nr_pages > 0) @@ -1484,7 +1487,7 @@ static bool memcg1_event_ratelimit(struct mem_cgroup *memcg, * Check events in order. * */ -void memcg1_check_events(struct mem_cgroup *memcg, int nid) +static 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 376d021a2bf4..0a9f3f9c2362 100644 --- a/mm/memcontrol-v1.h +++ b/mm/memcontrol-v1.h @@ -115,9 +115,6 @@ 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); -void memcg1_charge_statistics(struct mem_cgroup *memcg, int nr_pages); -void memcg1_check_events(struct mem_cgroup *memcg, int nid); - void memcg1_commit_charge(struct folio *folio, struct mem_cgroup *memcg); void memcg1_swapout(struct folio *folio, struct mem_cgroup *memcg); void memcg1_uncharge_batch(struct mem_cgroup *memcg, unsigned long pgpgout, @@ -152,9 +149,6 @@ static inline bool memcg1_oom_prepare(struct mem_cgroup *memcg, bool *locked) { static inline void memcg1_oom_finish(struct mem_cgroup *memcg, bool locked) {} static inline void memcg1_oom_recover(struct mem_cgroup *memcg) {} -static inline void memcg1_charge_statistics(struct mem_cgroup *memcg, int nr_pages) {} -static inline void memcg1_check_events(struct mem_cgroup *memcg, int nid) {} - static inline void memcg1_commit_charge(struct folio *folio, struct mem_cgroup *memcg) {}