From patchwork Tue Jul 7 17:36:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 11649449 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 9528292A for ; Tue, 7 Jul 2020 17:36:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 613D5207BB for ; Tue, 7 Jul 2020 17:36:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="XdJChonl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 613D5207BB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=fb.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9C8516B0071; Tue, 7 Jul 2020 13:36:26 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 99FEE6B0087; Tue, 7 Jul 2020 13:36:26 -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 7A9156B0089; Tue, 7 Jul 2020 13:36:26 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id 548BF6B0071 for ; Tue, 7 Jul 2020 13:36:26 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 207412DFD for ; Tue, 7 Jul 2020 17:36:26 +0000 (UTC) X-FDA: 77011983972.13.hope02_5e07e8126eb6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id E38A618140B70 for ; Tue, 7 Jul 2020 17:36:25 +0000 (UTC) X-Spam-Summary: 1,0,0,17190a5437fe61ff,d41d8cd98f00b204,prvs=4457d3df13=guro@fb.com,,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1261:1277:1311:1313:1314:1345:1359:1437:1513:1515:1516:1518:1521:1535:1542:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2559:2562:2731:3138:3139:3140:3141:3142:3352:3865:3867:3868:3870:4321:4385:4605:5007:6261:6653:8957:10004:10400:10450:10455:11026:11473:11658:11914:12043:12114:12296:12297:12438:12555:12895:12986:14096:14097:14181:14394:14721:19904:19999:21080:21450:21627:21990:30030:30054:30064,0,RBL:67.231.145.42:@fb.com:.lbl8.mailshell.net-64.201.201.201 62.12.0.100;04yrsj7yng88ezmx1bui8s7szxo6iocct3npbtao9bn1nh3bxud41c5o457gfqq.1ajyugatq1naq1dnubb9hh3pw3aa78ht5z5p191zr6xar518hd8483nuwbihzae.1-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:23,LUA_SUMMARY:none X-HE-Tag: hope02_5e07e8126eb6 X-Filterd-Recvd-Size: 5763 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2020 17:36:25 +0000 (UTC) Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 067HK1sb022471 for ; Tue, 7 Jul 2020 10:36:24 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=XFTvKzVN4yKF1jCi+0agAdaSmwFbXYmEbeT5A5QL0a4=; b=XdJChonlVQC8wITptAaEByLhYCQXaphboQEghXg5bLhOKgr1liRFi+oAU1NSgTNA3Dzt XbNW0Mh2zi6bvmQnAd01ea0Hq7uH6h/o2A+teJ1HpgOsngx3kt6yx0m0GTzSvv+czPQ/ LTyrBH2kgikiCtMRnyAxACt0ZYKtIdhljm8= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 3239r9jyaf-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 07 Jul 2020 10:36:24 -0700 Received: from intmgw002.41.prn1.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::e) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 7 Jul 2020 10:36:22 -0700 Received: by devvm1096.prn0.facebook.com (Postfix, from userid 111017) id 508C4CDE8D5; Tue, 7 Jul 2020 10:36:17 -0700 (PDT) Smtp-Origin-Hostprefix: devvm From: Roman Gushchin Smtp-Origin-Hostname: devvm1096.prn0.facebook.com To: Andrew Morton CC: Johannes Weiner , Michal Hocko , Shakeel Butt , , Vlastimil Babka , , , Roman Gushchin Smtp-Origin-Cluster: prn0c01 Subject: [PATCH 2/3] mm: slab: rename (un)charge_slab_page() to (un)account_slab_page() Date: Tue, 7 Jul 2020 10:36:11 -0700 Message-ID: <20200707173612.124425-2-guro@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200707173612.124425-1-guro@fb.com> References: <20200707173612.124425-1-guro@fb.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-07_09:2020-07-07,2020-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 suspectscore=2 impostorscore=0 adultscore=0 phishscore=0 mlxlogscore=870 clxscore=1015 priorityscore=1501 lowpriorityscore=0 spamscore=0 malwarescore=0 mlxscore=0 cotscore=-2147483648 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007070120 X-FB-Internal: deliver X-Rspamd-Queue-Id: E38A618140B70 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000068, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: charge_slab_page() and uncharge_slab_page() are not related anymore to memcg charging and uncharging. In order to make their names less confusing, let's rename them to account_slab_page() and unaccount_slab_page() respectively. Signed-off-by: Roman Gushchin Reviewed-by: Shakeel Butt Acked-by: Vlastimil Babka --- mm/slab.c | 4 ++-- mm/slab.h | 8 ++++---- mm/slub.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index fafd46877504..300adfb67245 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1379,7 +1379,7 @@ static struct page *kmem_getpages(struct kmem_cache *cachep, gfp_t flags, return NULL; } - charge_slab_page(page, cachep->gfporder, cachep); + account_slab_page(page, cachep->gfporder, cachep); __SetPageSlab(page); /* Record if ALLOC_NO_WATERMARKS was set when allocating the slab */ if (sk_memalloc_socks() && page_is_pfmemalloc(page)) @@ -1403,7 +1403,7 @@ static void kmem_freepages(struct kmem_cache *cachep, struct page *page) if (current->reclaim_state) current->reclaim_state->reclaimed_slab += 1 << order; - uncharge_slab_page(page, order, cachep); + unaccount_slab_page(page, order, cachep); __free_pages(page, order); } diff --git a/mm/slab.h b/mm/slab.h index 704a65713f81..72ff7cd933db 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -440,15 +440,15 @@ static inline struct kmem_cache *virt_to_cache(const void *obj) return page->slab_cache; } -static __always_inline void charge_slab_page(struct page *page, int order, - struct kmem_cache *s) +static __always_inline void account_slab_page(struct page *page, int order, + struct kmem_cache *s) { mod_node_page_state(page_pgdat(page), cache_vmstat_idx(s), PAGE_SIZE << order); } -static __always_inline void uncharge_slab_page(struct page *page, int order, - struct kmem_cache *s) +static __always_inline void unaccount_slab_page(struct page *page, int order, + struct kmem_cache *s) { if (memcg_kmem_enabled()) memcg_free_page_obj_cgroups(page); diff --git a/mm/slub.c b/mm/slub.c index d9b33a935e58..5cffd3fd440b 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1621,7 +1621,7 @@ static inline struct page *alloc_slab_page(struct kmem_cache *s, page = __alloc_pages_node(node, flags, order); if (page) - charge_slab_page(page, order, s); + account_slab_page(page, order, s); return page; } @@ -1844,7 +1844,7 @@ static void __free_slab(struct kmem_cache *s, struct page *page) page->mapping = NULL; if (current->reclaim_state) current->reclaim_state->reclaimed_slab += pages; - uncharge_slab_page(page, order, s); + unaccount_slab_page(page, order, s); __free_pages(page, order); }