Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp599251pxt; Fri, 6 Aug 2021 09:09:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKap2dExG9DKNRpl/P/MSqf/NmddLLhldS98pAdaQFMZG3jIYkpuWRYcAEkh9ZxCyeQIoU X-Received: by 2002:a05:6e02:6c1:: with SMTP id p1mr38521ils.292.1628266194600; Fri, 06 Aug 2021 09:09:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628266194; cv=none; d=google.com; s=arc-20160816; b=qPnpV0F/zVdhGk2+4gFskiJvszdV771swm23HXmxspg9wNqc+DcoPHm9h5bVFr3alk FjZw37VjKETDP16DoFqBI26opRo/SnZCWOYm4qanWTWW8a3vA1iq3BGokmv5/qvyHzxY 7uMyIf15nXb1yaRgQiW7L5O9l6TatZGSpPW1QnSuV0CYm5eq/ZoEnpJjIaIGBMNFbOt2 jUwT7fSoNrD+w9Wd4ifolBr+0qRXUYYj9IAFou/ob40OV9j5EstV7jcwrGtCDHEiUlFF vnC9mtWaMKyCRCAPglIVrNbZNlNg6hDK7z8ntZ3bmYo52jVg6la9FiTpHdmgM0V5ZRCE BqeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GTrZgcQBlZ0LVEw7tZM1GzfrNVvDF1A9jOYPKV5T1co=; b=BguXzxM+UWqdRlUw6xQWdBoAWGN8qMRXG7f6KOPJl+3tcZS0UHiAtQ04JGpl772sZC REurwk9TJAdgcKKF7SEoIAtQmgQFIhQtadYsNUdd/kvomXj2wCkCaz36Jbo17VFrEqan XXGcO2RrU/u8c4yaGdf6QzM8FOwgBufq/3GG9m3VbHqS9ia8KvMQfcV0iWr6Qb898nAq INeHA44eYyvwMcS5wwLJRqLpCUlO+YRgaAa/fKt4SCJYBRFkv7l+Xk8e/WEPvnZM4uXw 9r9XUqpWJz+yPc1WmzChMcjMLetiVzD8X/TJSLYaowb5YiO00FR3gmxtt/DMcoVcW3UY vFaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=akN2yaj8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u2si9826132jah.8.2021.08.06.09.09.40; Fri, 06 Aug 2021 09:09:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=akN2yaj8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245755AbhHFL5x (ORCPT + 99 others); Fri, 6 Aug 2021 07:57:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbhHFL5w (ORCPT ); Fri, 6 Aug 2021 07:57:52 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B434C061798; Fri, 6 Aug 2021 04:57:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=GTrZgcQBlZ0LVEw7tZM1GzfrNVvDF1A9jOYPKV5T1co=; b=akN2yaj8Ns/RZ4oltMMVdxaS4T WjKJ7Mcrzr2knc0QO9b3cCsKs/gsErwqco94GhO47SEZbplYDNLhPnw+nxGa7HVLiwIWdrfrmai/C NHmonw2kBwweLrT/u0k3cqtAw9DqAOlfg3gL5n5eSMd+oao2+Tyhe5rYjWJkw1iHEafcz/VfVBuNg KzjfvOaEd7E/qRKFzKaufc5q62e+3pfLQFC2/74PR2tzbCjyzvjYo4qyUC08/CX3Rp0SbXrIh5a5o dk0/tgP2u5V6hhnbcr8bdfOM4IWP7NyyLOeI0jhf2BJuQqwbEF+RY7J7zsbWAjMBZhzzEz+oYJL+P k7AIIAvw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mByTc-006MJU-75; Fri, 06 Aug 2021 11:57:24 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 816C630003A; Fri, 6 Aug 2021 13:57:21 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 298E520292D1B; Fri, 6 Aug 2021 13:57:21 +0200 (CEST) Date: Fri, 6 Aug 2021 13:57:21 +0200 From: Peter Zijlstra To: Michel Lespinasse Cc: Mete Polat , Davidlohr Bueso , Arnd Bergmann , Lukas Bulwahn , Andrew Morton , Jesper Nilsson , David Woodhouse , Ingo Molnar , Randy Dunlap , kernel-janitors@vger.kernel.org, Linux Kernel Mailing List , Geert Uytterhoeven Subject: Re: [PATCH] rbtree: remove unneeded explicit alignment in struct rb_node Message-ID: References: <20210805133213.700-1-lukas.bulwahn@gmail.com> <50ad4c8b848bd371b4b42959167ef03d@suse.de> <20210806085245.GB14650@lespinasse.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210806085245.GB14650@lespinasse.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.