lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Jul 2021 14:17:49 +0200
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     Vlastimil Babka <vbabka@...e.cz>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Christoph Lameter <cl@...ux.com>,
        David Rientjes <rientjes@...gle.com>,
        Pekka Enberg <penberg@...nel.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Jann Horn <jannh@...gle.com>
Subject: Re: [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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ