LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Michel Lespinasse <michel@lespinasse.org>
Cc: Mete Polat <metepolat2000@gmail.com>,
	Davidlohr Bueso <dbueso@suse.de>, Arnd Bergmann <arnd@arndb.de>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jesper Nilsson <jesper@jni.nu>,
	David Woodhouse <dwmw2@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	kernel-janitors@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] rbtree: remove unneeded explicit alignment in struct rb_node
Date: Fri, 6 Aug 2021 13:57:21 +0200	[thread overview]
Message-ID: <YQ0joVCrc0hTxRXK@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210806085245.GB14650@lespinasse.org>

On Fri, Aug 06, 2021 at 01:52:45AM -0700, Michel Lespinasse wrote:
> I think moving the color to a separate word would be costly, both in space
> (growing the struct rb_node) and in time. Feel free to try it, but I would
> expect the rbtree performance tests to regress significantly.
> 
> __rb_parent() could probably be modified - it only needs to mask one bit,
> I'm not sure why it masks two.
> 
> As to what would happen on 68k... hard to say, but I expect it should
> be fine (if the compiler cared for the structs to be aligned, it
> should do it on its own). Still, not sure how to test that either.

Somewhere, on the infinite length TODO list, I have an item to implement
threaded RB trees, which would need the LSB of the left and right words
too.

In general, the kernel is overflowing with code that (ab)uses the LSBs
of pointers and relies on at least natural alignment. There is
absolutely no point in fixing just this one instance.

  reply	other threads:[~2021-08-06 11:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 13:32 Lukas Bulwahn
2021-08-05 14:02 ` Arnd Bergmann
2021-08-05 14:14   ` Lukas Bulwahn
2021-08-05 15:02   ` Davidlohr Bueso
2021-08-05 15:10     ` Peter Zijlstra
2021-08-05 17:20     ` Mete Polat
2021-08-06  8:52       ` Michel Lespinasse
2021-08-06 11:57         ` Peter Zijlstra [this message]
2021-08-10 22:46   ` Jesper Nilsson

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=YQ0joVCrc0hTxRXK@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --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=lukas.bulwahn@gmail.com \
    --cc=metepolat2000@gmail.com \
    --cc=michel@lespinasse.org \
    --cc=mingo@kernel.org \
    --cc=rdunlap@infradead.org \
    --subject='Re: [PATCH] rbtree: remove unneeded explicit alignment in struct rb_node' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).