From patchwork Tue Feb 27 17:42:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13574205 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 D8870C5478C for ; Tue, 27 Feb 2024 17:43:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B22B36B00F0; Tue, 27 Feb 2024 12:43:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E07F6B00F7; Tue, 27 Feb 2024 12:43:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F1E3B6B00F6; Tue, 27 Feb 2024 12:43:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D24066B00E5 for ; Tue, 27 Feb 2024 12:43:04 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 77F3D1C0DCC for ; Tue, 27 Feb 2024 17:43:04 +0000 (UTC) X-FDA: 81838304688.03.2DF4790 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id A754E100012 for ; Tue, 27 Feb 2024 17:43:00 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=SzY+XFkr; spf=none (imf14.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709055782; a=rsa-sha256; cv=none; b=2UnI21JvN495mLUvOXUNZL8NSXgU6TXN6Rd16ydd/lwmmIXXSFBoCSz+a8DRShag2DiYVI 639x/q/0bjGl0qMf8Kjel5sFR8aToAHxzAgKLLiKpGvbICk1OSAhdLs4FC7DLU+FK+Blby 7ZvkjdcImxis2Qyc5LzJUTXi888x1oI= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=SzY+XFkr; spf=none (imf14.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=1709055782; 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=U2EQset2B1F0v5WlVxF1O6/RQfFktgSfImLNMKOn+UI=; b=Abq9r14wJk0ymGwSF1klpPyJZTL3lqpyL3r71fdBahcPlrQQE36FnrBgWkqInUaTCg9KyQ 2mERyftCw3waZVEJAimjdmo3sLBF59ao3BGZYAvI3duSnI6UMYK0m4lGrM4dx3HGfRRviB CaDiHqGVkzc7JH76kThADlUBbw2gqz4= 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=U2EQset2B1F0v5WlVxF1O6/RQfFktgSfImLNMKOn+UI=; b=SzY+XFkrbf1OmJxVqKyejogrQI Fa5PvlfPXr0eSyeB9H9YNOzgtRNCFkDt9Fz/ZLBgDYXCDMppG9L5+BEkzPFvB+wO6mqoOYON0Knw5 otrc8cMHXJI/8T6M2jcZQ0yWSTEdsor8A6HPSpzsZBcagoVj9x6twuWae5Gl3AuaGrlUPWAPNUeQy jl2hfRkkANfTWWp6lwYefQG//zzW+M4I1wTf2Q3LovcErS2+DwAmXtv5QMad9cZ0uhp/+W7eu3XYe f8QQ2D/X3Clgabhab/kzMJWd8a4CCMQ7zw2l6jkrlfql3Op0T9CHlMB+z6q17cd3vqZdgTCYuzgmd J57hyjnA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rf1Tn-00000002yro-14tX; Tue, 27 Feb 2024 17:42:59 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Ryan Roberts Subject: [PATCH v3 13/18] memcg: Remove mem_cgroup_uncharge_list() Date: Tue, 27 Feb 2024 17:42:47 +0000 Message-ID: <20240227174254.710559-14-willy@infradead.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227174254.710559-1-willy@infradead.org> References: <20240227174254.710559-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: A754E100012 X-Stat-Signature: imn1kknibux68ynqcc6fkmaq3cm55m5o X-Rspam-User: X-HE-Tag: 1709055780-635306 X-HE-Meta: U2FsdGVkX1+GwkTzv5MWPdNWok6UOqPmkmbE1uhJYKx54+LKIEoInlZukr/mhPi9rh0vM+HYLQMB1owG2yvTTAUHP9nRruqhVPdstPDIaUOmWcsW7qHsmIsyFu8V+t4yKenFN+xETCHlkEsHTtYCJrwrNCwyNJNOi6ofUrbG9rcC4IJIyv/tHSJmxH3dS57+eBbSQsGnC79PjEl+maoj346eII7PFrFk1HSLskSZlrqBostEW7oukXKQ1J/uJYOGTTTspvKHNaV8nJmLND8tN2kHsNduJUWTc2IijsMflFh6/0f4BVMFysH6aNujBbv8kJt8/CRKuY/kS/y6WX797Mvi7soIvFf5YM+gCBjnwSLMkKxEM68eyXJSoM50XNfN8BO0sLdHpkvM4U/K+aADxv5SKwClXLMGA1vux5vEbOxKFZioqFhLrjirJu9QgVSs7o+7W2XXFgEULrtN0t2X+op5hhoBXlFYHwIAjBhsizQNche/BZL/K/ATqZnWMZGVMUGQm/fEnE4FaZqPbptmRgddX6dNLHpfPTKzr55nKcBLxA1jlkmEMxOK9J/6ngLgjAh4nIAZWLFkBJkrhGuSrj81XqTc/McE2hGYSwKcs28bTT4igLUDO0Xxp1da6eT+8zX15yT7kxAmRApDwz5/m6moNHW5jPfQNNyfx2Bj6XZ0vsH3wAmc6SOPg6+yTbUXkMC+r/kZN3IKuQGIyahtnCcTzvblZrnrl+Gb3aHZAlvRTVJzYVBzCrZ9E64uTneB7oqlPsdbNESWJhYumSS1fbcUlUV1QFDSBn29IdYcMqF1EDb5SH2ueCwFuk/pGw+fj3K15RryyyTM5zY19h4TuZz/TOOMgxYpKJoAPzdTRGj9NORVOrC5Go6Y3WrwG6Vs0DEVKfUcfXx7muKDNoZMdjg8m4bUyTfYiYSCGv5rZOxPz1dalGcnqrTYpdtIgWOHOuuXSuCTxbD9lO3b8Kp +V7JO5/2 1jGDV1xOScSoT/RQDOOYcMs5YwNxrQJxE53rH2mev0YMuibW1eancd9dPmw1Rxuc4r8nR1ChzrvSMRTq5thH3IWrw7QAvTsfo0Q042QuplLVo9QLuyJ/6YLC5mNEyMKwN2jzwehimxDPEQSZvg39PbAO7+I1wnj477MKlrtGwk9O6AR/aVE5okpWOrLtvzwMZu4Q3yu7RclE/oqZN6bWRDbka7zlvvboIHHyvgF/Oi/ZCL4nKGzeSahzrA1U1/HRIc8o/c9zSiIFqxEYRVFGHpScNBRdglV/rrZpE 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 4be37c9a0759..22db1760e9bb 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;