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: <ZJBHKTFRhsCzdJLe@arm.com>
Date:   Mon, 19 Jun 2023 13:16:41 +0100
From:   Catalin Marinas <catalin.marinas@....com>
To:     Stephen Rothwell <sfr@...b.auug.org.au>
Cc:     Vlastimil Babka <vbabka@...e.cz>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>
Subject: Re: linux-next: manual merge of the slab tree with the mm tree

On Mon, Jun 19, 2023 at 02:03:30PM +1000, Stephen Rothwell wrote:
> diff --cc mm/slab_common.c
> index 43c008165f56,90ecaface410..000000000000
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@@ -892,24 -876,17 +890,24 @@@ new_kmalloc_cache(int idx, enum kmalloc
>   		flags |= SLAB_CACHE_DMA;
>   	}
>   
>  +	if (minalign > ARCH_KMALLOC_MINALIGN) {
>  +		aligned_size = ALIGN(aligned_size, minalign);
>  +		aligned_idx = __kmalloc_index(aligned_size, false);
>  +	}
>  +
> + 	/*
> + 	 * If CONFIG_MEMCG_KMEM is enabled, disable cache merging for
> + 	 * KMALLOC_NORMAL caches.
> + 	 */
> + 	if (IS_ENABLED(CONFIG_MEMCG_KMEM) && (type == KMALLOC_NORMAL))
> + 		flags |= SLAB_NO_MERGE;
> + 
>  -	kmalloc_caches[type][idx] = create_kmalloc_cache(
>  -					kmalloc_info[idx].name[type],
>  -					kmalloc_info[idx].size, flags, 0,
>  -					kmalloc_info[idx].size);
>  +	if (!kmalloc_caches[type][aligned_idx])
>  +		kmalloc_caches[type][aligned_idx] = create_kmalloc_cache(
>  +					kmalloc_info[aligned_idx].name[type],
>  +					aligned_size, flags);
>  +	if (idx != aligned_idx)
>  +		kmalloc_caches[type][idx] = kmalloc_caches[type][aligned_idx];
> - 
> - 	/*
> - 	 * If CONFIG_MEMCG_KMEM is enabled, disable cache merging for
> - 	 * KMALLOC_NORMAL caches.
> - 	 */
> - 	if (IS_ENABLED(CONFIG_MEMCG_KMEM) && (type == KMALLOC_NORMAL))
> - 		kmalloc_caches[type][idx]->refcount = -1;
>   }
>   
>   /*

Thanks Stephen. The resolution looks fine to me.

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ