From patchwork Fri Aug 25 13:59:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13365793 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 AB04AC3DA6F for ; Fri, 25 Aug 2023 13:59:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FFBD2800BD; Fri, 25 Aug 2023 09:59:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 137EF8E0015; Fri, 25 Aug 2023 09:59:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 04F512800BD; Fri, 25 Aug 2023 09:59:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DFECC8E0015 for ; Fri, 25 Aug 2023 09:59:25 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BC260406CA for ; Fri, 25 Aug 2023 13:59:25 +0000 (UTC) X-FDA: 81162784290.16.AD018C1 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf12.hostedemail.com (Postfix) with ESMTP id 099594000B for ; Fri, 25 Aug 2023 13:59:23 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=rIaUdkDs; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692971964; 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=6RVMpXkIv2GEOH3GCQLoyi5Dw3649Q70CypM6RwLya8=; b=XvUGDrmYeL3YWJXE4VL2uXFrFRiqYsoVlXmuVnNC3KX5ABXqhLbERYT4grHCgQTQ+ulStO TTJXp6fpwh3Sm0C81ykWTFccF+BLgmj0flhoCfAxxHWqB/9IZTnep6Q2KSWHSDDdQHWTw9 0tGQzhz3Nn9j4DohF6v6FRwwjX1JvkM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692971964; a=rsa-sha256; cv=none; b=k6FPW3XQu115YPjwutmHhcs+s2rQMf3yGrVnLs8J4+3PRyq1ilOe8tZAzdXgdawSnh5IHi 1UjrbvNa5IbC9W8t93+p8Axzes60mkcgqirp6Kz1K8ihZnWUAT08PUn8TJ98zRCu/LdBrM kjRmtlR0gU4sanq2bqHYVbgdEOq1DLo= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=rIaUdkDs; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=6RVMpXkIv2GEOH3GCQLoyi5Dw3649Q70CypM6RwLya8=; b=rIaUdkDsipTHUWrd20cosBqepZ Pj6RialE1H5fxXcjwZRSB22u4V4AnFjXyNMS2A8ozN1ZJI40f8iLnCVa0Z85ewwc4nwny27FEWYHO npIkOV/TRmNscymXwKLuMZBfhHN1rd4nwzMYXa4tWQt7SbdZrQSCqH9A249ds/1GYv6gGb5wmn2wp Imarje4oFYZGxaXKklXZW+oca0qkBBa8xt4GGozdZdcldkqyJ6cSeMyOmBSuMVBmnVcrKyKR5V7Vr itoI2S/ZiXpS9Oq4FUyG/N/LQE+6E+QAUEs1SkVIkNnYd79y0e2YJ1s7to0f/pSNmCcPQgIY5LaFQ 5TpNNZCg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qZXLO-00HTRP-Dc; Fri, 25 Aug 2023 13:59:22 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [RFC PATCH 13/14] memcg: Remove mem_cgroup_uncharge_list() Date: Fri, 25 Aug 2023 14:59:17 +0100 Message-Id: <20230825135918.4164671-14-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230825135918.4164671-1-willy@infradead.org> References: <20230825135918.4164671-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 099594000B X-Rspam-User: X-Stat-Signature: z1q31po1ef9jtr5dsxxr3dkyddhta63f X-Rspamd-Server: rspam03 X-HE-Tag: 1692971963-153913 X-HE-Meta: U2FsdGVkX19MlTMdwjpE9zEaNVMkIg4G1gfQiDPI9BVA7lwFnLKtKdfcN7x6WzzANL1YWvL7OHazJ4UVwSsbhb6HwrI5Zzvapel5r3EcLsO6S9YrbuIJG9836pe7r9zMNRSpvQG4O2jaZqe0XrQD20AvT8UmqQ1P2euTiC3+f6r2M5SPfk+NK/QZs5zr5E9x/WkaxQTpa9wcVp099i8pqpUVkqXfkPZGewGLcaPDh8tBJn7qRIsRQq2LkU0+LM04GKr4y5D3ld/R9iL4zWMsr9WeZsJPBAhVJhI8SZKWzyuCkEiARhxCtMZLapGHSojc6JFxk05lZco5s4H2Ma6vLh11Z+9VqA2qQlCtveA4TYg4jm7bwqFESm8DXQMwRNvnuNui5QFDuprUqnMkafVvEex+qzB4sjw3SZ9KpGFD1oJQL0UhgcHMio6LS7n+BdyEEJrL4NDXuMGA1gsRq0fEnj0U53/98Qf7arM6u2cyxkRYlo4Im6pvbq+mIyxRSmqyphcgFV7nsc73iaPwaHAxC/52M6O1ZGnJhO+WIF7UgGA7F543auxLBH7d58ZpvC+nl+t9XWr6CXROYaPkzqgz5UJJs+Od5vnYsVkJ7zqdEQ1Ix3znLgG/xbNWKIacnw1+KzpoF/mKXoQRk+yxhkttoJDWTTr+rWgY9UJNePwbyyW2itTuXq6S/0CkyUtgiBJgB1arVWAnlUy3MRqM5gfXneOgLU5+ceZFzHyOabJwFErfZfi+fvx7y7VWCzma29an0EM9wH7dGjXu6uHhdh3o2NlqzwU2GPUXmZXYYUiJWSNzdlIDmec+uW4VSuM3TV7dolMmziffPFCI97TsjcrU5nQ2Rb2EC/mNMs/0kwyWSEpVrMHouDTh/GRT9F4Q3iHM9OmDzxdg21qzmdoDkgQuVbKY+O0w1ONt3MUBOFIYuKtnykCefpwijaXKN5RBkoaLu+qroC15v/9xiBT3vYs AEj7SQ3k MYh0gZki3tVHMjNOankHmJB5NiAxVpllLmDlyzMaui7/y8qmccNgru/5BGc/aViaxm+9E2RvASPdwQ3wA57VdN+GgVmybPnwgShaj0sstqf6sfbUVS27ehc66TC5vyLiB0fkC2CoZFydDirxR0fUSED3bZJb61+lIlgk3JPCrmHFFm6AYoRpXBHIJytMbPIBIqQ/Y+M7TTF4h684dS6+j2fqov7ZDcpmRTNyg 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: 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 44d3e459d16f..2b3966ff85f2 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -705,14 +705,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) { @@ -1277,10 +1269,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 a0fb008afa23..c89265bd9ce6 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -7172,25 +7172,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;