From: Matthew Wilcox <willy@infradead.org>
To: Ke Sun <sunke@kylinos.cn>
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 04:17:42 +0000 [thread overview]
Message-ID: <ZymcZgS4IHxIcaq1@casper.infradead.org> (raw)
In-Reply-To: <CALpAb9PmHx=5he7rmFWHEryGwmt9BAvehwmSzFwNEWuC9wjCtQ@mail.gmail.com>
On Tue, Nov 05, 2024 at 10:21:00AM +0800, Ke Sun wrote:
> > 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))
You're looking right at your bug, and you don't see it.
next prev parent reply other threads:[~2024-11-05 4:17 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
2024-11-05 4:17 ` Matthew Wilcox [this message]
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=ZymcZgS4IHxIcaq1@casper.infradead.org \
--to=willy@infradead.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=maple-tree@lists.infradead.org \
--cc=sunke@kylinos.cn \
/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