From patchwork Thu Jan 9 17:27:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 11326205 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 1CF361395 for ; Thu, 9 Jan 2020 17:28:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DE27A20838 for ; Thu, 9 Jan 2020 17:28:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="KQnPmDwb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE27A20838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none 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 5A15A8E0008; Thu, 9 Jan 2020 12:28:28 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 555858E0005; Thu, 9 Jan 2020 12:28:28 -0500 (EST) 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 3069A8E000A; Thu, 9 Jan 2020 12:28:28 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id 0811E8E0008 for ; Thu, 9 Jan 2020 12:28:28 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id A90E64DB7 for ; Thu, 9 Jan 2020 17:28:27 +0000 (UTC) X-FDA: 76358779854.07.shop05_8401c66f75902 X-Spam-Summary: 2,0,0,4c72460445a5c7b9,d41d8cd98f00b204,prvs=82770afb69=guro@fb.com,::akpm@linux-foundation.org:mhocko@kernel.org:hannes@cmpxchg.org:shakeelb@google.com:vdavydov.dev@gmail.com:linux-kernel@vger.kernel.org:kernel-team@fb.com:guro@fb.com,RULES_HIT:41:69:142:355:379:541:968:973:988:989:1260:1261:1277:1313:1314:1345:1437:1516:1518:1534:1541:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2731:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3872:4605:5007:6261:6653:10004:10400:11026:11658:11914:12043:12296:12297:12438:12679:12683:12895:13069:13311:13357:14096:14097:14394:14721:21080:21451:21627:30034:30054:30064,0,RBL:67.231.153.30:@fb.com:.lbl8.mailshell.net-62.12.0.100 64.201.201.201,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:29,LUA_SUMMARY:none X-HE-Tag: shop05_8401c66f75902 X-Filterd-Recvd-Size: 4373 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Thu, 9 Jan 2020 17:28:27 +0000 (UTC) Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.42/8.16.0.42) with SMTP id 009HQLXJ016266 for ; Thu, 9 Jan 2020 09:28:26 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=KF+G+5MGSSib1j/y16MoaGVIL2x224fhh1Xrxl1wcBY=; b=KQnPmDwbLfhDBLXNEa5tidPjixsL3mnuvchCjmWjfVZ/BpF1bzNXWkfkol/tRDDw9bLI LbUtHH1sNAyC/O/xao+8ICOxvCi2qfh83BSZ2dbx9Gn2QbObIsQABjAURj7JSTYGX8Fc l6sq610ugdCxJc6vfUgwX4Qq+rf2+pZRt+w= Received: from mail.thefacebook.com ([163.114.132.120]) by m0089730.ppops.net with ESMTP id 2xdh776xre-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 09 Jan 2020 09:28:26 -0800 Received: from intmgw001.41.prn1.facebook.com (2620:10d:c085:208::11) by mail.thefacebook.com (2620:10d:c085:21d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Thu, 9 Jan 2020 09:28:23 -0800 Received: by devvm2643.prn2.facebook.com (Postfix, from userid 111017) id 728CE1D2DC5D4; Thu, 9 Jan 2020 09:28:18 -0800 (PST) Smtp-Origin-Hostprefix: devvm From: Roman Gushchin Smtp-Origin-Hostname: devvm2643.prn2.facebook.com To: , Andrew Morton CC: Michal Hocko , Johannes Weiner , Shakeel Butt , Vladimir Davydov , , , Roman Gushchin Smtp-Origin-Cluster: prn2c23 Subject: [PATCH 0/7] mm: memcg: kmem API cleanup Date: Thu, 9 Jan 2020 09:27:38 -0800 Message-ID: <20200109172745.285585-1-guro@fb.com> X-Mailer: git-send-email 2.17.1 X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-09_03:2020-01-09,2020-01-09 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 malwarescore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 mlxscore=0 priorityscore=1501 impostorscore=0 adultscore=0 spamscore=0 clxscore=1015 mlxlogscore=585 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001090143 X-FB-Internal: deliver 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: This patchset aims to clean up the kernel memory charging API. It doesn't bring any functional changes, just removes unused arguments, duplicate definitions, renames some functions and fixes some comments. Currently it's not obvious which functions are most basic (memcg_kmem_(un)charge_memcg()) and which are based on them (memcg_kmem_(un)charge()). The patchset renames these functions and removes unused arguments: TL;DR: was: memcg_kmem_charge_memcg(page, gfp, order, memcg) memcg_kmem_uncharge_memcg(memcg, nr_pages) memcg_kmem_charge(page, gfp, order) memcg_kmem_uncharge(page, order) now: memcg_kmem_charge(memcg, gfp, nr_pages) memcg_kmem_uncharge(memcg, nr_pages) memcg_kmem_charge_page(page, gfp, order) memcg_kmem_uncharge_page(page, order) Roman Gushchin (7): mm: kmem: remove duplicate definitions of __memcg_kmem_(un)charge() mm: kmem: cleanup (__)memcg_kmem_charge_memcg() arguments mm: kmem: cleanup memcg_kmem_uncharge_memcg() arguments mm: kmem: rename memcg_kmem_(un)charge() into memcg_kmem_(un)charge_page() mm: kmem: switch to nr_pages in (__)memcg_kmem_charge_memcg() mm: memcg/slab: cache page number in memcg_(un)charge_slab() mm: kmem: rename (__)memcg_kmem_(un)charge_memcg() to __memcg_kmem_(un)charge() fs/pipe.c | 2 +- include/linux/memcontrol.h | 46 ++++++++++++++------------------ kernel/fork.c | 9 ++++--- mm/memcontrol.c | 54 ++++++++++++++++++-------------------- mm/page_alloc.c | 4 +-- mm/slab.h | 22 +++++++++------- 6 files changed, 65 insertions(+), 72 deletions(-)