diff mbox series

[v2,3/6] slub: Use folio APIs in free_large_kmalloc()

Message ID 20231228085748.1083901-4-willy@infradead.org (mailing list archive)
State New
Headers show
Series Remove some lruvec page accounting functions | expand

Commit Message

Matthew Wilcox Dec. 28, 2023, 8:57 a.m. UTC
Save a few calls to compound_head() by using the folio APIs
directly.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/slub.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Rientjes Dec. 28, 2023, 8:37 p.m. UTC | #1
On Thu, 28 Dec 2023, Matthew Wilcox (Oracle) wrote:

> Save a few calls to compound_head() by using the folio APIs
> directly.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Acked-by: David Rientjes <rientjes@google.com>
Vlastimil Babka Jan. 2, 2024, 11:10 a.m. UTC | #2
On 12/28/23 09:57, Matthew Wilcox (Oracle) wrote:
> Save a few calls to compound_head() by using the folio APIs
> directly.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Reviewed-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/slub.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 342545775df6..58b4936f2a29 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -4375,9 +4375,9 @@ static void free_large_kmalloc(struct folio *folio, void *object)
>  	kasan_kfree_large(object);
>  	kmsan_kfree_large(object);
>  
> -	mod_lruvec_page_state(folio_page(folio, 0), NR_SLAB_UNRECLAIMABLE_B,
> +	lruvec_stat_mod_folio(folio, NR_SLAB_UNRECLAIMABLE_B,
>  			      -(PAGE_SIZE << order));
> -	__free_pages(folio_page(folio, 0), order);
> +	folio_put(folio);
>  }
>  
>  /**
diff mbox series

Patch

diff --git a/mm/slub.c b/mm/slub.c
index 342545775df6..58b4936f2a29 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4375,9 +4375,9 @@  static void free_large_kmalloc(struct folio *folio, void *object)
 	kasan_kfree_large(object);
 	kmsan_kfree_large(object);
 
-	mod_lruvec_page_state(folio_page(folio, 0), NR_SLAB_UNRECLAIMABLE_B,
+	lruvec_stat_mod_folio(folio, NR_SLAB_UNRECLAIMABLE_B,
 			      -(PAGE_SIZE << order));
-	__free_pages(folio_page(folio, 0), order);
+	folio_put(folio);
 }
 
 /**