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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e20542ca-3150-e281-b677-f6f6532d8181@suse.cz>
Date:   Wed, 11 Oct 2023 15:31:50 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Catalin Marinas <catalin.marinas@....com>
Cc:     linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, Mark Rutland <mark.rutland@....com>,
        Peter Collingbourne <pcc@...gle.com>,
        Petr Tesarik <petr.tesarik.ext@...wei.com>
Subject: Re: [RESEND PATCH] mm: slab: Do not create kmalloc caches smaller
 than arch_slab_minalign()

On 10/9/23 13:20, Catalin Marinas wrote:
>> >  mm/slab_common.c | 7 +++++--
>> >  1 file changed, 5 insertions(+), 2 deletions(-)
>> > 
>> > diff --git a/mm/slab_common.c b/mm/slab_common.c
>> > index cd71f9581e67..8b45922ed295 100644
>> > --- a/mm/slab_common.c
>> > +++ b/mm/slab_common.c
>> > @@ -895,10 +895,13 @@ void __init setup_kmalloc_cache_index_table(void)
>> >  
>> >  static unsigned int __kmalloc_minalign(void)
>> >  {
>> > +	unsigned int minalign = dma_get_cache_alignment();
>> > +
>> >  	if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC) &&
>> >  	    is_swiotlb_allocated())
>> > -		return ARCH_KMALLOC_MINALIGN;
>> > -	return dma_get_cache_alignment();
>> > +		minalign = ARCH_KMALLOC_MINALIGN;
>> > +
>> > +	return ALIGN(minalign, arch_slab_minalign());
>> 
>> Could it be max() instead of ALIGN()? It would be more obvious, at least to
>> me :)
> 
> Yeah, max() would do since they are all a power of two. Do you want me
> to repost?

No need, picked up and changed locally. Thanks!


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ