Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp877369pxt; Fri, 6 Aug 2021 16:41:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdnIgnCvIqVHIqwoexi3XBy9VzQ23L8HikQTCVgsO/D0b1urpDMO8H/c/isoQO56zMAXzs X-Received: by 2002:a05:6402:22e9:: with SMTP id dn9mr16341288edb.218.1628293303485; Fri, 06 Aug 2021 16:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628293303; cv=none; d=google.com; s=arc-20160816; b=t7wqZ56IbVGkCWaEISh02Xwif6Lw/ki/PnFP1PLBSmIxrMfFvMG0vvtgyEkdlomBjt X04JJqbQ9umbRFxzQFIQxnOuLs/Bu1VrgCUA0FMgt4mhWF97qwQzktvQU6r0x1/ILh7V I+GjGHhNsOGXkjc/6KUrvsBhO/jX7XK0iyR26m661lxvRE4KA9w76bCwmvHd+T6JpVvs iAvQni9D/G9w8kAm8yJb8mWDZlU5nbVrsf7TS2zGi7ZKbrziKDQebbM/6aiUtAw34vZg C8EhfNXlvx3SLOISEx5hProz93N8G0/6yTWq4xvhzmhgjFoqYjA7WbvH7Z/FAINmdIXG k6FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=4hP5EFCo5371tB5JgIut0p+iw6oHDNxFxSxtkYd2mP0=; b=PmFIzCBjoPyVI/EUoFsb69gFXtB9WQX2tks9hwMTushcBCbIN8qO6VNddBnctANAcy XojtNeQCeOgXGmuXVnX59ufzb3kWJS7HXXY2kvLFRNyi74T4GXWe1i4LEhB9RFYvCn51 coxnKct2D4bad6wNJIYKgY1ZTi+sXP5GSYrk0mpaFeeyBPRONW1m3w8LGhxFHfJHKSJZ FvgML77jyhhjnmjBi/Sd9jb4UQfDl6Lms33PmygbFYZyJLNf8gVOAHf1wOY1XFPifzwF BAkAd3qKqm9qsvwTG4Sr+21TXB8GBDkatEbyDMU4MhIsuLwq5ZSmt+Wqb34kLueVqT7G cHJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UlZnp+lf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k15si9417654eds.12.2021.08.06.16.41.20; Fri, 06 Aug 2021 16:41:43 -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=@gmail.com header.s=20161025 header.b=UlZnp+lf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244624AbhHFPXg (ORCPT + 99 others); Fri, 6 Aug 2021 11:23:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244667AbhHFPXK (ORCPT ); Fri, 6 Aug 2021 11:23:10 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27FE4C061371; Fri, 6 Aug 2021 08:22:13 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id o7-20020a05600c5107b0290257f956e02dso9257660wms.1; Fri, 06 Aug 2021 08:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=4hP5EFCo5371tB5JgIut0p+iw6oHDNxFxSxtkYd2mP0=; b=UlZnp+lfGGHy4+bRfTqLgXqKXdnc10XVCiL8ICCsf/cLMkFpA+1EnYD4wH2bXHsT57 nSPdgVl5vcK4nyZebLWtFu2pfRxBPZZrOyNiKngJg6+rwOWNZ2Ve25BBKjJqMMzkTUSL QZ6EHsC26K2A3lpaCm+zmWviONfIoHfXsYQvRZ1+Cx3mdwfbeA9Kc/Sb8U/VIysVlntz dFPivCDGq5yYzdnvOu+GiKf8G2wo5r/Dpl5lQmOs96oG1uF+y7VSI/ZSaR9GCBWvbHSp o6t+ngaestGl7RoeSUBgcUiuNB5CTxZ6sdLJRqHCAHbc/l7W0tbxkfRSctz6HrXNNrgI rc6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=4hP5EFCo5371tB5JgIut0p+iw6oHDNxFxSxtkYd2mP0=; b=fdW2movEq/hKlRXVxN7D+Lw6uHK9WYqVimcB/ocZMf87XDb6t0hdx2tXeTmr4ia0Zo 1+psQmPrsZ6jmFGG6Bz7BKpnMtlyBYOWKXqQ7y+yRtb8Imhp6kzCSaJaQ9jARCti6VFa najC1ivlbEAgczIEN+8lqvGdcNKVPg51Up9bzZwwq8UKCp5yb/XidV5vqhtY9nnyAuFs tcOWJkSr7DOK5cPHlkAIYKz8Ae2AyTwKefCjJbW/aljYsmsHxnlKohEioEYf4j9OcI7M LrnvDr5GegTpZbWHesP7kqWV608JTaTwPJMwmGLX7FQHuF5vHwZUX/6XRW0kRx4N0kx3 jlsw== X-Gm-Message-State: AOAM530MKHLd1+0GIK6g40KY0hcoqhTq5l6hteOA4RhXb2rK68BY2SFE yYIIcB2t6z4Zr5I436w40TWSFUmXdyuLCaZD X-Received: by 2002:a1c:208e:: with SMTP id g136mr20873244wmg.142.1628263331754; Fri, 06 Aug 2021 08:22:11 -0700 (PDT) Received: from precision (aftr-62-216-202-158.dynamic.mnet-online.de. [62.216.202.158]) by smtp.gmail.com with ESMTPSA id h14sm9844922wrp.55.2021.08.06.08.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 08:22:11 -0700 (PDT) Date: Fri, 6 Aug 2021 17:22:08 +0200 From: Mete Polat To: Michel Lespinasse , Davidlohr Bueso , Andrew Morton , Lukas Bulwahn , Peter Zijlstra Cc: Jesper Nilsson , Arnd Bergmann , David Woodhouse , Ingo Molnar , Randy Dunlap , Geert Uytterhoeven , kernel-janitors@vger.kernel.org, Linux Kernel Mailing List , linux-m68k Subject: [PATCH v2] rbtree: remove unneeded explicit alignment in struct rb_node Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Reported-by: Randy Dunlap Reported-by: Mete Polat Signed-off-by: Lukas Bulwahn Signed-off-by: Mete Polat --- I have tested it on x86, but not on m68k. Can you ack that Geert? include/linux/rbtree.h | 3 +-- include/linux/rbtree_augmented.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index d31ecaf4fdd3..e9390be1ba67 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h @@ -25,8 +25,7 @@ struct rb_node { unsigned long __rb_parent_color; struct rb_node *rb_right; struct rb_node *rb_left; -} __attribute__((aligned(sizeof(long)))); - /* The alignment might seem pointless, but allegedly CRIS needs it */ +}; struct rb_root { struct rb_node *rb_node; diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h index d1c53e9d8c75..94b6a0f4499e 100644 --- a/include/linux/rbtree_augmented.h +++ b/include/linux/rbtree_augmented.h @@ -145,7 +145,7 @@ RB_DECLARE_CALLBACKS(RBSTATIC, RBNAME, \ #define RB_RED 0 #define RB_BLACK 1 -#define __rb_parent(pc) ((struct rb_node *)(pc & ~3)) +#define __rb_parent(pc) ((struct rb_node *)(pc & ~1)) #define __rb_color(pc) ((pc) & 1) #define __rb_is_black(pc) __rb_color(pc) -- 2.32.0