lkml.org 
[lkml]   [2021]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v2 31/34] mm, slub: optionally save/restore irqs in slab_[un]lock()/
On 2021-06-09 13:39:00 [+0200], Vlastimil Babka wrote:
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -353,18 +353,35 @@ static inline unsigned int oo_objects(struct kmem_cache_order_objects x)
> /*
> * Per slab locking using the pagelock
> */
> -static __always_inline void slab_lock(struct page *page)
> +static __always_inline void
> +__slab_lock(struct page *page, unsigned long *flags, bool disable_irqs)
> {
> VM_BUG_ON_PAGE(PageTail(page), page);
> + if (disable_irqs)
> + local_irq_save(*flags);
> bit_spin_lock(PG_locked, &page->flags);
> }
>
> -static __always_inline void slab_unlock(struct page *page)
> +static __always_inline void
> +__slab_unlock(struct page *page, unsigned long *flags, bool disable_irqs)
> {
> VM_BUG_ON_PAGE(PageTail(page), page);
> + if (disable_irqs)
> + local_irq_restore(*flags);
> __bit_spin_unlock(PG_locked, &page->flags);
> }

You should first unlock then enable IRQs.

Sebastian

\
 
 \ /
  Last update: 2021-07-02 14:19    [W:0.405 / U:1.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site