From patchwork Sat Feb 17 02:25:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13561202 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 6B44FC48260 for ; Sat, 17 Feb 2024 02:25:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 164B76B0093; Fri, 16 Feb 2024 21:25:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E6E56B0098; Fri, 16 Feb 2024 21:25:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA4676B009C; Fri, 16 Feb 2024 21:25:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D26AA6B0096 for ; Fri, 16 Feb 2024 21:25:53 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 97670140122 for ; Sat, 17 Feb 2024 02:25:53 +0000 (UTC) X-FDA: 81799705386.11.07CE7E4 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP id 02FC31C0006 for ; Sat, 17 Feb 2024 02:25:50 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=CLqvUfSV; dmarc=none; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708136752; 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=3y483NAn04LDI+CHl8S2xioP/KCmHcMseUB+d705X/I=; b=7iKdPfKYl9ArSdiG77AzjmTZ80tYFRXtMvHhEm0oDst45Lmdfi7QL53UJnJ3dNqpo/PyQY YgfvzaL9LgDnS7EtfzZts6o15aqTuOePOlE3XJrmlhcqIkg2xciEPoO2lpYq4+NUuEBmp5 32IQq07W3sl80MGRfiaGQrDrQ/1TRa8= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=CLqvUfSV; dmarc=none; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708136752; a=rsa-sha256; cv=none; b=oLNMroW6T1GGvVc/qJhR4jpuYNYQncaehDJVTVEv9CwLqmHj8tJctFYBe/w7qFpyoiabou 87uZKJTFle447A1B04Tj2zzyJLauBmIJrmxJtQb24PxSW9ItjxPi1Gaq5AkghM/G9ON1WR 1x0tXtD1NgUWpJnXEVCEkVuvOUMX6SE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=3y483NAn04LDI+CHl8S2xioP/KCmHcMseUB+d705X/I=; b=CLqvUfSVkzJ4Ut0h/YIba8YDeg 1XiVh/YyeslGmLtHC5uaUAYDwWT8C+3F1LdbFx2+tl1fL9oBL2g/JLL8rccWsiJGAzUzvjdot5o9h 7XjdKGWvNLRGtyk+EiRkyg9KzyW/6L76fAhmQ5Z+qkQ5cY9iVdZIvvWIm6/IAbwgeIrwJiXPnLJpw u6Nivo1xnB439PwCSi9A1uJYpCMoHvRJ9SxiB4fyXnAqzIqxOOLaEyLGIpktPSrApXuqw5GvLFJfN KS9lxz8vd7qSrkRUx0UFryWdSuiCVh7OThGE/lgUftpNokH2wBYUdnfCbNB7uAKRjaXFCXt+yrIio hhiqHK9w==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbAOj-00000006HDq-26Gf; Sat, 17 Feb 2024 02:25:49 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Ryan Roberts Subject: [PATCH v2 13/18] memcg: Remove mem_cgroup_uncharge_list() Date: Sat, 17 Feb 2024 02:25:39 +0000 Message-ID: <20240217022546.1496101-14-willy@infradead.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240217022546.1496101-1-willy@infradead.org> References: <20240217022546.1496101-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 02FC31C0006 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: jzyh9iqsf718a3pnz1psbussm5apmfrc X-HE-Tag: 1708136750-6983 X-HE-Meta: U2FsdGVkX19aeaKSHWKiMGRPMonL6Ut+zGbq8qbRBBBf1hL5nU5wDx+JnTJyVJIQQQeEYcduJyP43PfRzdvYCWOKV/zCRbtlVKVhywjGbhKrfIkGVqQ5FRx6nTOGEAH45NvOI6gexfKFJ0MTaYIBdtkYjioaDJKBt88ymaYQi2Yyx8pQi8Jb8PxLBlDku3aNsrMpa59VJUvX3aOanUyNl//klKBHYEOlsHRel4Eu3tF1iSkkoaXAEK8vgDQTf9CZPcPybSV14RKMFziL4OcDje2FfJbZm/k4LfMF0VQ6ItDq2+/0YPfE9w0+p5mBVejSXFEzr+n4hSnDRwj8wDyagRzxyR4oMoudN2NiEdy5uX4LcOGQO+/Knyd0hxdKaN7uQpAayWNjpcimuSIYLHrEatYC5MFp5B8U8g6N+iEAxmqR/e62Fo/5nNcZ1LvTPBpzbr37nquh2rUi7ESYQ+hhdSOnLA5wNIxIZKJ5VGkLP8gOQ6LgsDwrHNuQ4oIYHVI7Jc4GuEHQBNGeuF6v+paEMCQyW6frn2FHZIGMYavThlpFh5PDAkay9ceni80KM9IYxo31TtHdsVqNqI1cgEoQWJ0NVClGV05Ibs697vGxQvmvVwcEx7nDRMzUwEEmBZHYawwgeridoLDTCcl8z3u4us46rm0PknS4tYEx7Wy3G4hirbv7PiIN4Wec8Unl7EXzkYV+3NsZWGgo1A6BptRBfKfEyV0tnPMzGavbm65fRpp1zwYe1Hp43Uzn8jAsk83sbe2TtL2iiX7OQk4Ro9TLY9fNVZ4yEs5cE8/UMslZYA9cBmvvhi5eumqFLBwe6Tle8YiqRlTMhrzXnAa8yPQtEwHsVdqAalXbsEsxdpmsbKY6sZYLWhIJ2gQT48OI/Cv9xnWFcYoied1Qb1veXLK1UWebp77pCva9Z/wtgGv/M4Muz2CzGlIgAElhRqPZFbPl8Syqb3IzDuwUmnsAG7K 19bFEtSI 3bqXXhJXZGYAxfd3Q/n2iWzeqhXGh0ICImMMUOV9BnKFx2lvaNgHVHeISvZBOr40BrMhRF1HvLB/PC8h2tNnUiKL324nyOL+Zbm0v4YGJRksG1lG9jrcZahWBs6CBnGSsFK+45GtIoWfkmtPKktlWnuz7r4/oz0vRa9/I/UHTh0STKSQhdyRKZ0kxm0U6Bm9kHUwKSiNMsDRgiDQrNwEmraD27lhxzjyezcFQfX6onI4tzn0I8gdDiuQCUuj0CyoC6F9kH1YbxZXdrYMVLXrgahCXIrdOwdr4dc+c 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: All users have been converted to mem_cgroup_uncharge_folios() so we can remove this API. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Ryan Roberts --- include/linux/memcontrol.h | 12 ------------ mm/memcontrol.c | 19 ------------------- 2 files changed, 31 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 8a0e8972a3d3..6ed0c54a3773 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -713,14 +713,6 @@ static inline void mem_cgroup_uncharge(struct folio *folio) __mem_cgroup_uncharge(folio); } -void __mem_cgroup_uncharge_list(struct list_head *page_list); -static inline void mem_cgroup_uncharge_list(struct list_head *page_list) -{ - if (mem_cgroup_disabled()) - return; - __mem_cgroup_uncharge_list(page_list); -} - void __mem_cgroup_uncharge_folios(struct folio_batch *folios); static inline void mem_cgroup_uncharge_folios(struct folio_batch *folios) { @@ -1301,10 +1293,6 @@ static inline void mem_cgroup_uncharge(struct folio *folio) { } -static inline void mem_cgroup_uncharge_list(struct list_head *page_list) -{ -} - static inline void mem_cgroup_uncharge_folios(struct folio_batch *folios) { } diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 0499d7838224..d45b9f322a92 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -7546,25 +7546,6 @@ void __mem_cgroup_uncharge(struct folio *folio) uncharge_batch(&ug); } -/** - * __mem_cgroup_uncharge_list - uncharge a list of page - * @page_list: list of pages to uncharge - * - * Uncharge a list of pages previously charged with - * __mem_cgroup_charge(). - */ -void __mem_cgroup_uncharge_list(struct list_head *page_list) -{ - struct uncharge_gather ug; - struct folio *folio; - - uncharge_gather_clear(&ug); - list_for_each_entry(folio, page_list, lru) - uncharge_folio(folio, &ug); - if (ug.memcg) - uncharge_batch(&ug); -} - void __mem_cgroup_uncharge_folios(struct folio_batch *folios) { struct uncharge_gather ug;