From patchwork Tue Oct 13 15:35:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 11835853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6BF2A752 for ; Tue, 13 Oct 2020 18:11:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5AEAE251DF for ; Tue, 13 Oct 2020 15:36:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bytedance-com.20150623.gappssmtp.com header.i=@bytedance-com.20150623.gappssmtp.com header.b="VkeuT8BU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AEAE251DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 612C86B006E; Tue, 13 Oct 2020 11:36:35 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5C2336B0070; Tue, 13 Oct 2020 11:36:35 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B1046B0071; Tue, 13 Oct 2020 11:36:35 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0193.hostedemail.com [216.40.44.193]) by kanga.kvack.org (Postfix) with ESMTP id 3FF9F6B006E for ; Tue, 13 Oct 2020 11:36:35 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 02D061EF1 for ; Tue, 13 Oct 2020 15:36:34 +0000 (UTC) X-FDA: 77367304350.01.trees36_1a1424527204 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id C68AA10046D5A for ; Tue, 13 Oct 2020 15:36:34 +0000 (UTC) X-Spam-Summary: 1,0,0,b22fec229d90dc4b,d41d8cd98f00b204,songmuchun@bytedance.com,,RULES_HIT:41:69:355:379:541:800:960:966:968:973:988:989:1260:1311:1314:1345:1437:1515:1535:1542:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2559:2562:2731:2890:3138:3139:3140:3141:3142:3354:3865:3866:3867:3870:3871:3872:4042:4250:4321:4385:4605:5007:6261:6653:6737:7875:9592:10004:11026:11473:11658:11914:12043:12048:12114:12296:12297:12438:12517:12519:12555:12895:12986:13161:13229:13894:14093:14096:14181:14394:14721:21080:21444:21450:21451:21627:21740:21795:21990:30001:30051:30054,0,RBL:209.85.216.66:@bytedance.com:.lbl8.mailshell.net-62.2.0.100 66.100.201.201;04y8jx8owscr4yc433wibq7b8ryaropuzwqzzk4zhst78y9z47ybhuhd6txx7c7.uaj1w1pa8nze3z3jscy3mq5nrk6hsund9it7shuobecpt6mqh6ibgx7prrt1ua7.4-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:16,LUA_SUMMARY:none X-HE-Tag: trees36_1a1424527204 X-Filterd-Recvd-Size: 5957 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Tue, 13 Oct 2020 15:36:34 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id a17so65270pju.1 for ; Tue, 13 Oct 2020 08:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5Ox95qvJhDnil9bz6yooXTHbNTLkLwItEwWWK2Vi73M=; b=VkeuT8BUzhjPjsJacswMkrJ0NijklYP+nB3jOT+GvqiI3jx9FYGbjzyvaOrykMOTF2 nSwhF1EkJx4O34zdFgah/jIOv21/bjPnc+z3Khu3mqLcLmHy7NPih0fmH00mB3syuP9D Kt9lm9OYx6UjIAyofJRA/M9Shp6L24sqIM1P9YbzIEW3opjnQZ3aIxUCL0Z3dTuphIjz OsS5rI3XCbb+Dwx4D5qkxAfyNEO/8ZN5z+1fmfy2vB8UYG8+zCOsN7u9N65nDZfk4JBQ MupQAZg3r9b28VEDDcm7XOnGPmt9tz8zLckQGUGSUVNoWyMcs1BL+0x5u2YJTOG0zo60 OLXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5Ox95qvJhDnil9bz6yooXTHbNTLkLwItEwWWK2Vi73M=; b=bfx0iikD9+vv+jmJekruD3yClZH7kwKaplsOo3dBQjtL3Yi84C2DGeSMqblJraH4do H25B5wNVBwoOD/l8/hcV2wfYDG0rVKWkmU+uSGG0uWT7Ud7EjUuF07g9Bmzw/DEPs4sC 7tKwkzsF4Nx86SWoh/Q0H5cwPmZiNtiO7okgo8Xevd3RcY/oAbiWLQ6OHDvvz9k9KtKu mz+IORLdN9AP01vcwb65lfzRbB/XuI4/EdMIWBDzZK7UOkZu/Nzj78Ev0khDy2eb/zVj mgvH0eEWuk363pSYel+fhjlZJH4PdX2o1/JFnTDE+6tIN/9h3snHe9lXXAcM3wjccL2p r51Q== X-Gm-Message-State: AOAM533xeRFFyvFZWwU0WDCfz3XK0XhuHhYJforfEc9E0Ykq/7LDzE+N LCgrlm/DSPY3tCIhnI7WzpzJ8w== X-Google-Smtp-Source: ABdhPJx8AJmn2NrpVgs33N+C6pPbGr20NVTb5i0f0/DACBLUktB2tjoItgXyeq3rsE7kjeb0EXkS2w== X-Received: by 2002:a17:90a:f617:: with SMTP id bw23mr278783pjb.95.1602603391282; Tue, 13 Oct 2020 08:36:31 -0700 (PDT) Received: from localhost.localdomain ([103.136.221.66]) by smtp.gmail.com with ESMTPSA id y124sm14083pfy.28.2020.10.13.08.36.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2020 08:36:30 -0700 (PDT) From: Muchun Song To: hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, akpm@linux-foundation.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, shakeelb@google.com, guro@fb.com, vbabka@suse.cz, laoar.shao@gmail.com, songmuchun@bytedance.com, chris@chrisdown.name Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH] mm: memcontrol: Remove unused mod_memcg_obj_state() Date: Tue, 13 Oct 2020 23:35:04 +0800 Message-Id: <20201013153504.92602-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.005717, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Since commit: 991e7673859e ("mm: memcontrol: account kernel stack per node") There is no user of the mod_memcg_obj_state(). This patch just remove it. Also rework type of the idx parameter of the mod_objcg_state() from int to enum node_stat_item. Signed-off-by: Muchun Song Acked-by: Roman Gushchin Acked-by: David Rientjes Reviewed-by: Shakeel Butt --- include/linux/memcontrol.h | 6 ------ mm/memcontrol.c | 11 ----------- mm/slab.h | 4 ++-- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index a1395b584947..d7e339bf72dc 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -795,8 +795,6 @@ void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, int val); void __mod_lruvec_slab_state(void *p, enum node_stat_item idx, int val); -void mod_memcg_obj_state(void *p, int idx, int val); - static inline void mod_lruvec_slab_state(void *p, enum node_stat_item idx, int val) { @@ -1245,10 +1243,6 @@ static inline void mod_lruvec_slab_state(void *p, enum node_stat_item idx, mod_node_page_state(page_pgdat(page), idx, val); } -static inline void mod_memcg_obj_state(void *p, int idx, int val) -{ -} - static inline unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, gfp_t gfp_mask, diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2124ded698b2..1337775b04f3 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -885,17 +885,6 @@ void __mod_lruvec_slab_state(void *p, enum node_stat_item idx, int val) rcu_read_unlock(); } -void mod_memcg_obj_state(void *p, int idx, int val) -{ - struct mem_cgroup *memcg; - - rcu_read_lock(); - memcg = mem_cgroup_from_obj(p); - if (memcg) - mod_memcg_state(memcg, idx, val); - rcu_read_unlock(); -} - /** * __count_memcg_events - account VM events in a cgroup * @memcg: the memory cgroup diff --git a/mm/slab.h b/mm/slab.h index 4a24e1702923..725a0bb8b317 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -204,7 +204,7 @@ ssize_t slabinfo_write(struct file *file, const char __user *buffer, void __kmem_cache_free_bulk(struct kmem_cache *, size_t, void **); int __kmem_cache_alloc_bulk(struct kmem_cache *, gfp_t, size_t, void **); -static inline int cache_vmstat_idx(struct kmem_cache *s) +static inline enum node_stat_item cache_vmstat_idx(struct kmem_cache *s) { return (s->flags & SLAB_RECLAIM_ACCOUNT) ? NR_SLAB_RECLAIMABLE_B : NR_SLAB_UNRECLAIMABLE_B; @@ -294,7 +294,7 @@ static inline struct obj_cgroup *memcg_slab_pre_alloc_hook(struct kmem_cache *s, static inline void mod_objcg_state(struct obj_cgroup *objcg, struct pglist_data *pgdat, - int idx, int nr) + enum node_stat_item idx, int nr) { struct mem_cgroup *memcg; struct lruvec *lruvec;