Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3980492pxt; Tue, 10 Aug 2021 16:36:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJWpQAqQEvOp4UW7TDYrkCZDqesOpzRinMxLQ3+dUHExWYezWtSoe30WsV2u9QIlSkpAbB X-Received: by 2002:a17:906:584b:: with SMTP id h11mr880591ejs.209.1628638573721; Tue, 10 Aug 2021 16:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628638573; cv=none; d=google.com; s=arc-20160816; b=gYwmAf7RUtLQmXmRp5/KdsgGu9WSQSCaBgyq85dAqYSfZV0IULB3a326jKq8X0FJqL PAD3jDr1lnvI5i8ENSeUJBTKdU6NoFmVIpOMu8tnMjdLEqzz1QpX3YB6SvP3821U6vuD 6LceyebliTB8oM5PUz5X7TLsBEN1lTVzt/V1v9gRvKmkIav9wGS7ldZEuBPRXSZ6h61a KLl7CfC57SqJASMDPKq1274rQ03a/LyNg+H3b84MqiR01KvNwprNM8c7oE6G3gsseBAH uhsMC9uW/eZJg+6tlPyc78cS/OAcrJU5FywO7NAPzp0QT6URzqgU7gdiEVkY9pQGRQVw ccXQ== 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; bh=QFM1EsDD5+q1woXQ7Yy8oBsQ3iNtISPVdE0+YHcrUrw=; b=JRd7WDToz+L+C8HXs9UlUwzbwuGQAa6vWQdFQ5sitfNy081tpSf2OU9BOHyd7tYU8x TTdF7XTuemEKNfcAx1nyG3i/BWNFmr2GINLrtU0HV5N+rVl6g+qXbvJaFfaX5EwWw1PS 1Ot9t/F4fJAIyn+aitiAWInw9O3IBs9CsCw4Xybad4jkQhRq2/yEAKgVu3+4jXhM08F0 UmeqAsOe5CWbMkEKZky4Y431JmrjLzCEIA4/pXFoA7DgJXJtXP2Li/gp0ZHBk2X1sM/z oMAFJTDSC0HaQuQruK6iaodFe6DOUno9/fFpiqs66587gmtX/Yz6dPg9Sq+1jmTbwwmq Dn9A== ARC-Authentication-Results: i=1; mx.google.com; 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 m10si17081376eji.294.2021.08.10.16.35.49; Tue, 10 Aug 2021 16:36:13 -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; 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 S235456AbhHJXdr (ORCPT + 99 others); Tue, 10 Aug 2021 19:33:47 -0400 Received: from mailout.comhem.se ([82.99.18.63]:44506 "EHLO mailout.comhem.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233570AbhHJXdq (ORCPT ); Tue, 10 Aug 2021 19:33:46 -0400 X-Greylist: delayed 531 seconds by postgrey-1.27 at vger.kernel.org; Tue, 10 Aug 2021 19:33:46 EDT Received: from mail.jni.nu (c188-150-64-249.bredband.tele2.se [188.150.64.249]) by mailout.comhem.se (Postfix) with ESMTPS id 51C2644030C for ; Tue, 10 Aug 2021 23:24:32 +0000 (UTC) Received: by mail.jni.nu (Postfix, from userid 1000) id 1181C2D608CC; Wed, 11 Aug 2021 00:46:11 +0200 (CEST) Date: Wed, 11 Aug 2021 00:46:11 +0200 From: Jesper Nilsson To: Arnd Bergmann Cc: Lukas Bulwahn , Michel Lespinasse , Davidlohr Bueso , Andrew Morton , Mete Polat , Jesper Nilsson , David Woodhouse , Ingo Molnar , Peter Zijlstra , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 05, 2021 at 04:02:22PM +0200, Arnd Bergmann wrote: > On Thu, Aug 5, 2021 at 3:32 PM Lukas Bulwahn 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."). > > > > Reported-by: Randy Dunlap > > Reported-by: Mete Polat > > Signed-off-by: Lukas Bulwahn > > --- > > applies cleanly on next-20210804, but only x86 compile-checked. > > > > Michel, Davidlohr, Jesper, David, please ack. > > > > Mete, you might want to re-run your RBT test suite for this change. > > > > Andrew, once acked, please pick this minor cleanup into your tree. > > Do you know why it needed the extra alignment on cris at the time? The problem for CRIS was that the architecture always had packed structs (there was no way to avoid it in GCC) and CRIS could all data on any byte boundary. That was ok for normal pointers in structs, all pointers would be allocated inside the same page and it didn't matter that they were aligned on odd byte addresses for the CPU (except for being a little slower) However, when the lowest bits were used as flags, that would clash on CRIS since all bits were valid and possible address bits, so any sub-struct in a struct might be aligned on an odd address, and using the pointer to the sub-struct would inadvertently set the flag bits. That's why just adding a forced alignment on the sub-struct fixed the problem, since the compiler would respect such alignments, and thus leave the lower bits free for trickery. > The revert would appear to change the alignment to 16 bits instead > of 32 bits on m68k as well (not 8 bits as on cris), but I don't know if that > can cause problems there. > > Arnd /^JN - Jesper Nilsson -- Jesper Nilsson -- jesper_at_jni.nu