diff mbox series

[08/10] slub: Remove use of page->flags

Message ID 20240326171045.410737-9-willy@infradead.org (mailing list archive)
State New
Headers show
Series Various page->flags cleanups | expand

Commit Message

Matthew Wilcox March 26, 2024, 5:10 p.m. UTC
Use slub->__page_flags instead.  We can also remove the assertion that
it's not a tail page as struct slab never points to a tail page.

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

Comments

David Hildenbrand April 4, 2024, 6:29 p.m. UTC | #1
On 26.03.24 18:10, Matthew Wilcox (Oracle) wrote:
> Use slub->__page_flags instead.  We can also remove the assertion that
> it's not a tail page as struct slab never points to a tail page.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>   mm/slub.c | 10 ++--------
>   1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index ceee8d76e1a9..1500546a9b68 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -616,18 +616,12 @@ slub_set_cpu_partial(struct kmem_cache *s, unsigned int nr_objects)
>    */
>   static __always_inline void slab_lock(struct slab *slab)
>   {
> -	struct page *page = slab_page(slab);
> -
> -	VM_BUG_ON_PAGE(PageTail(page), page);
> -	bit_spin_lock(PG_locked, &page->flags);
> +	bit_spin_lock(PG_locked, &slab->__page_flags);
>   }
>   
>   static __always_inline void slab_unlock(struct slab *slab)
>   {
> -	struct page *page = slab_page(slab);
> -
> -	VM_BUG_ON_PAGE(PageTail(page), page);
> -	bit_spin_unlock(PG_locked, &page->flags);
> +	bit_spin_unlock(PG_locked, &slab->__page_flags);
>   }
>   
>   static inline bool

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/slub.c b/mm/slub.c
index ceee8d76e1a9..1500546a9b68 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -616,18 +616,12 @@  slub_set_cpu_partial(struct kmem_cache *s, unsigned int nr_objects)
  */
 static __always_inline void slab_lock(struct slab *slab)
 {
-	struct page *page = slab_page(slab);
-
-	VM_BUG_ON_PAGE(PageTail(page), page);
-	bit_spin_lock(PG_locked, &page->flags);
+	bit_spin_lock(PG_locked, &slab->__page_flags);
 }
 
 static __always_inline void slab_unlock(struct slab *slab)
 {
-	struct page *page = slab_page(slab);
-
-	VM_BUG_ON_PAGE(PageTail(page), page);
-	bit_spin_unlock(PG_locked, &page->flags);
+	bit_spin_unlock(PG_locked, &slab->__page_flags);
 }
 
 static inline bool