From: Catalin Marinas <catalin.marinas@arm.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: manual merge of the slab tree with the mm tree
Date: Mon, 19 Jun 2023 13:16:41 +0100 [thread overview]
Message-ID: <ZJBHKTFRhsCzdJLe@arm.com> (raw)
In-Reply-To: <20230619140330.28437ac3@canb.auug.org.au>
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
next prev parent reply other threads:[~2023-06-19 12:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-19 4:03 linux-next: manual merge of the slab tree with the mm tree Stephen Rothwell
2023-06-19 12:16 ` Catalin Marinas [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-12-16 4:27 Stephen Rothwell
2025-01-22 3:18 ` Stephen Rothwell
2024-01-02 4:34 Stephen Rothwell
2024-01-02 4:02 Stephen Rothwell
2023-12-21 6:34 Stephen Rothwell
2023-11-27 1:29 Stephen Rothwell
2023-04-05 4:08 Stephen Rothwell
2023-04-05 4:10 ` Yosry Ahmed
2023-03-17 1:44 Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZJBHKTFRhsCzdJLe@arm.com \
--to=catalin.marinas@arm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.