From: Mete Polat <metepolat2000@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Michel Lespinasse <michel@lespinasse.org>,
Davidlohr Bueso <dbueso@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
Jesper Nilsson <jesper@jni.nu>, Arnd Bergmann <arnd@arndb.de>,
David Woodhouse <dwmw2@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
kernel-janitors@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: [PATCH v2] rbtree: remove unneeded explicit alignment in struct rb_node
Date: Tue, 10 Aug 2021 21:15:39 +0200 [thread overview]
Message-ID: <YRLQW1JAlh0GqPVA@gmail.com> (raw)
In-Reply-To: <20210806174457.GA2184@worktop.programming.kicks-ass.net>
On Fri, Aug 06, 2021 at 07:44:57PM +0200, Peter Zijlstra wrote:
> On Fri, Aug 06, 2021 at 05:22:08PM +0200, Mete Polat wrote:
> > Commit e977145aeaad ("[RBTREE] Add explicit alignment to sizeof(long) for
> > struct rb_node.") adds an explicit alignment to the struct rb_node due to
> > some speciality of the CRIS architecture.
> >
> > The support for the CRIS architecture was removed with commit c690eddc2f3b
> > ("CRIS: Drop support for the CRIS port")
> >
> > So, remove this now unneeded explicit alignment in struct rb_node as well.
> >
> > This basically reverts commit e977145aeaad ("[RBTREE] Add explicit
> > alignment to sizeof(long) for struct rb_node.").
> >
> > The rbtree node color is stored in the LSB of '__rb_parent_color'.
> > Only mask the first bit in '__rb_parent()', otherwise it modifies the
> > node's parent address on m68k.
>
> I still don't believe for a second this will actually work. We rely on
> rcu_assign_pointer() and rcu_dereference() to work on the
> rb_{left,right} members, and I don't think any architecture can provide
> single copy atomic loads and stores that are not naturally aligned (eg.
> when they straddle a cache or page boundary).
>
I guess I am misunderstanding something here, but isn't that then a
problem that all rcu pointers in any struct would face, independent of
an 'aligned' struct attribute? As long as allocators do not place a
small struct as rb_node over page boundaries and the rcu pointers itself
are aligned we should be fine, aren't we? I am not sure if any of the
SL*B allocators is doing that though.
next prev parent reply other threads:[~2021-08-10 19:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-06 15:22 [PATCH v2] rbtree: remove unneeded explicit alignment in struct rb_node Mete Polat
2021-08-06 17:44 ` Peter Zijlstra
2021-08-10 19:15 ` Mete Polat [this message]
2021-08-09 12:25 ` Geert Uytterhoeven
2021-08-10 19:39 ` Mete Polat
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=YRLQW1JAlh0GqPVA@gmail.com \
--to=metepolat2000@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=dbueso@suse.de \
--cc=dwmw2@infradead.org \
--cc=geert@linux-m68k.org \
--cc=jesper@jni.nu \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=lukas.bulwahn@gmail.com \
--cc=michel@lespinasse.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rdunlap@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 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.