diff mbox series

[RFC,13/14] memcg: Remove mem_cgroup_uncharge_list()

Message ID 20230825135918.4164671-14-willy@infradead.org (mailing list archive)
State New
Headers show
Series Rearrange batched folio freeing | expand

Commit Message

Matthew Wilcox Aug. 25, 2023, 1:59 p.m. UTC
All users have been converted to mem_cgroup_uncharge_folios() so
we can remove this API.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/memcontrol.h | 12 ------------
 mm/memcontrol.c            | 19 -------------------
 2 files changed, 31 deletions(-)

Comments

Ryan Roberts Aug. 31, 2023, 6:26 p.m. UTC | #1
On 25/08/2023 14:59, Matthew Wilcox (Oracle) wrote:
> All users have been converted to mem_cgroup_uncharge_folios() so
> we can remove this API.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>

> ---
>  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;
diff mbox series

Patch

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;