From: Ke Sun <sunke@kylinos.cn>
To: Matthew Wilcox <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
maple-tree@lists.infradead.org, linux-mm@kvack.org
Subject: Re: [PATCH] maple_tree: use KMEM_CACHE to create maple_node caches
Date: Tue, 5 Nov 2024 10:21:00 +0800 [thread overview]
Message-ID: <CALpAb9PmHx=5he7rmFWHEryGwmt9BAvehwmSzFwNEWuC9wjCtQ@mail.gmail.com> (raw)
In-Reply-To: <ZyjLpXKx5qcLYQ3S@casper.infradead.org>
[-- Attachment #1: Type: text/plain, Size: 1202 bytes --]
Matthew Wilcox <willy@infradead.org> 于2024年11月4日周一 21:27写道:
> On Mon, Nov 04, 2024 at 02:16:17PM +0800, Ke Sun wrote:
> > Use the KMEM_CACHE() macro instead of kmem_cache_create() to simplify
> > the creation of SLAB caches.
>
> Did you even test this? It is REQUIRED that maple_node be aligned to
>
I have tests on an ARM64 QEMU VM and enabled some Maple Tree debugging
configs:
CONFIG_DEBUG_VM_MAPLE_TREE=y
CONFIG_DEBUG_MAPLE_TREE=y
CONFIG_TEST_MAPLE_TREE=y
The results show:
[ 1.434017][ T1] TEST STARTING
[ 1.434017][ T1]
[ 78.257756][ T1] maple_tree: 172860522 of 172860522 tests passed
[ 78.271770][ T1] atomic64_test: passed
> its size (eg 256 bytes) as the bottom bits of pointers to nodes are used
> for other purposes. KMEM_CACHE() does not give us this guarantee.
>
The code comments of kmem_cache say: 'The alignment of the struct
determines object alignment.'
#define KMEM_CACHE(__struct, __flags) \
__kmem_cache_create_args(#__struct, sizeof(struct __struct), \
&(struct kmem_cache_args) { \
.align = __alignof__(struct __struct), \
}, (__flags))
>
> NACK.
>
>
[-- Attachment #2: Type: text/html, Size: 2053 bytes --]
next prev parent reply other threads:[~2024-11-05 2:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 6:16 Ke Sun
2024-11-04 13:27 ` Matthew Wilcox
2024-11-05 2:21 ` Ke Sun [this message]
2024-11-05 4:17 ` Matthew Wilcox
2024-11-05 2:34 ` kernel test robot
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='CALpAb9PmHx=5he7rmFWHEryGwmt9BAvehwmSzFwNEWuC9wjCtQ@mail.gmail.com' \
--to=sunke@kylinos.cn \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=maple-tree@lists.infradead.org \
--cc=willy@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox