Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1229521ybt; Thu, 9 Jul 2020 01:46:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytTAPPo7wY/IF1TjOoCm+wkz+Uuv3hBODH6QB6wzyyZwWPOB2DilYJVnb1NEYaXYv83S4K X-Received: by 2002:a17:907:9484:: with SMTP id dm4mr58368018ejc.56.1594284416687; Thu, 09 Jul 2020 01:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594284416; cv=none; d=google.com; s=arc-20160816; b=obX3s+BwmoaOm+T2eI8OKZHzaxCcmXo4/+NyLj3tAk7pvwQI45uNa9FUOlmhM8RsNy WMIHD3RnExfBWp+sN/6VYksyzDjRVI6/H2rnqdq6xGH60DdJ7Z2n4kVkzKGM3Xc03NEs 2c9Px3HWK/wqcHzmgEdq2fXCsQtWexUghqmbAAOguj2dE8hGFmAKb83HPZNOmvAfUcej qBwOi0SOrBb7i0b144JyzUp82TLpqB52tTrigp1VSEwgC0LEHm3job9GPPEI31pU3rJk d3A1VNI/Q+mvx34+DUbG4QKeWqZP4A3JcJkaP9LhWkMsZwTeCIfqCgiwnDRyAOyoCH5Q M4uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:dkim-signature :dkim-signature:date; bh=hjTJHow2R2XKL/tp30Tx1s7Zv1GQqNVD5CZB7vIOE/s=; b=HFVyN+RBGVKJR2dbZRblj3siBXYvGfvlfUCC29dRcvYZxY2sQ0qKLhO8McZp1Duqmk 1aOZQHjXstWjq0G5q35YdTX4sCzcdKQlHg0R5DGVadgfktrYzu99FXbDy/aDFGQjFkLh Ds5GmaMADnjbSibPzaSPRRh/y0v2YiuMfz6HIE6o8YWuxw983bI7ya0jc6yE3/kPXTxg 5zM9Jk4s+VmsqmC58PZjsmWC2QOkSkxBJvy4qTSpBONLxzRsd16Ld+N1dE8KOCxRtLbg TnUryv+9T65R1XrTrg1rQV5NMGMtl8XzjPwheIL3wc+wXuCn0XtTN1l0F6AnBZdohNS9 i84g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b="kcK/laqx"; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e header.b="S1qDs5C/"; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo14si1637845edb.112.2020.07.09.01.46.33; Thu, 09 Jul 2020 01:46:56 -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=fail header.i=@linutronix.de header.s=2020 header.b="kcK/laqx"; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e header.b="S1qDs5C/"; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726340AbgGIIqB (ORCPT + 99 others); Thu, 9 Jul 2020 04:46:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726465AbgGIIp7 (ORCPT ); Thu, 9 Jul 2020 04:45:59 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B733CC061A0B; Thu, 9 Jul 2020 01:45:59 -0700 (PDT) Date: Thu, 09 Jul 2020 08:45:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1594284358; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hjTJHow2R2XKL/tp30Tx1s7Zv1GQqNVD5CZB7vIOE/s=; b=kcK/laqx/M0C9cBFddVrS2wjjFbjKpMLce2ezvFvs1anLVwgvJCHZ2w5E+OdWCspbT7QEJ EznydsYqVU/wT38BTUsqdwSW+iRqGPzATpM9+PJU24D95ElJYLbXf6LPEi/ELDTTZWxMiO v4vBH3Zy//WeHXA3eSbjg4K5ZsHnBCfNeMQiVFfkrTXnkvA1FxWK3urmCy3yD5QXe8nYyz i17z+EK+I2O5oEsKlC8M7JKgforUeZUv0s2+29Px7l7+Hdc/uPuyMcl19dVs9IZnNHJGkv dOAhhokja4Hlg7tUaVNwO9kzD39eHxasmIqqc3mP/auPiTKP24rJYVcNdY2bFg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1594284358; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hjTJHow2R2XKL/tp30Tx1s7Zv1GQqNVD5CZB7vIOE/s=; b=S1qDs5C/hynlBnpgDM68zB1RDixP4rt5BqTEeE5vY4Fih6snVfcLNqOOTYn/4wOolYxXOH 8NifYeGUlqJpjNDQ== From: "tip-bot2 for Peter Zijlstra" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched, vmlinux.lds: Increase STRUCT_ALIGNMENT to 64 bytes for GCC-4.9 Cc: kernel test robot , "Peter Zijlstra (Intel)" , x86 , LKML In-Reply-To: <20200630144905.GX4817@hirez.programming.kicks-ass.net> References: <20200630144905.GX4817@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Message-ID: <159428435768.4006.17156231921502478446.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 85c2ce9104eb93517db2037699471c517e81f9b4 Gitweb: https://git.kernel.org/tip/85c2ce9104eb93517db2037699471c517e81f9b4 Author: Peter Zijlstra AuthorDate: Tue, 30 Jun 2020 16:49:05 +02:00 Committer: Peter Zijlstra CommitterDate: Wed, 08 Jul 2020 11:39:00 +02:00 sched, vmlinux.lds: Increase STRUCT_ALIGNMENT to 64 bytes for GCC-4.9 For some mysterious reason GCC-4.9 has a 64 byte section alignment for structures, all other GCC versions (and Clang) tested (including 4.8 and 5.0) are fine with the 32 bytes alignment. Getting this right is important for the new SCHED_DATA macro that creates an explicitly ordered array of 'struct sched_class' in the linker script and expect pointer arithmetic to work. Fixes: c3a340f7e7ea ("sched: Have sched_class_highest define by vmlinux.lds.h") Reported-by: kernel test robot Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200630144905.GX4817@hirez.programming.kicks-ass.net --- include/asm-generic/vmlinux.lds.h | 18 +++++++++++------- kernel/sched/sched.h | 3 ++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 66fb84c..3ceb4b7 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -109,6 +109,17 @@ #endif /* + * GCC 4.5 and later have a 32 bytes section alignment for structures. + * Except GCC 4.9, that feels the need to align on 64 bytes. + */ +#if __GNUC__ == 4 && __GNUC_MINOR__ == 9 +#define STRUCT_ALIGNMENT 64 +#else +#define STRUCT_ALIGNMENT 32 +#endif +#define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT) + +/* * The order of the sched class addresses are important, as they are * used to determine the order of the priority of each sched class in * relation to each other. @@ -123,13 +134,6 @@ *(__stop_sched_class) \ __end_sched_classes = .; -/* - * Align to a 32 byte boundary equal to the - * alignment gcc 4.5 uses for a struct - */ -#define STRUCT_ALIGNMENT 32 -#define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT) - /* The actual configuration determine if the init/exit sections * are handled as text/data or they can be discarded (which * often happens at runtime) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 5aa6661..9bef2dd 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -67,6 +67,7 @@ #include #include +#include #ifdef CONFIG_PARAVIRT # include @@ -1810,7 +1811,7 @@ struct sched_class { #ifdef CONFIG_FAIR_GROUP_SCHED void (*task_change_group)(struct task_struct *p, int type); #endif -} __aligned(32); /* STRUCT_ALIGN(), vmlinux.lds.h */ +} __aligned(STRUCT_ALIGNMENT); /* STRUCT_ALIGN(), vmlinux.lds.h */ static inline void put_prev_task(struct rq *rq, struct task_struct *prev) {