From patchwork Mon Nov 14 11:43:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 19752 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2098142wru; Mon, 14 Nov 2022 03:49:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf6by5Y9OD0/oNcoxs1hLOabuj/bC+MFT0vstNusjPSbIMGLPcr/LX6YIrrgzkTR601cE4oJ X-Received: by 2002:a17:907:6f1a:b0:78d:981a:d997 with SMTP id sy26-20020a1709076f1a00b0078d981ad997mr10345858ejc.654.1668426553324; Mon, 14 Nov 2022 03:49:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668426553; cv=none; d=google.com; s=arc-20160816; b=J9x+VHOUmZQjbDsaDeNOsZBfhyH+nQscIh0pDDSeb78zGHI/wRt5Tnm1iXyiNjlxzb h1wKMj5V2KPHJLVwl0sbsj7Ypn7+8SUOaOq4X2t7PRV4aMGGAQpkdyEc4rYKbNnrKdTE 8/CScEq13zFez66nkCblosmEbWP9zD7+Vcrd7C1QkU/SbtD/0OobD+gAKTJsegwTX4M8 cVNKNPB3xRii7mbdjH84O4I7q9AoW+KMNEy9h7IFuPUMdrAmYpBa1ky/GrMQf2CMs5jA 95v1vjmDTowPUCJ6DCBfDjxMHrLbdfDzP3cZnDeie5ABsQYQpz4maRTX15HLzUJb+Ydq Pcvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Jmytq3Y5nAaTdo4BP0g+AwwvXUZln/vIi6AVZ9nX/Dc=; b=tCndZwNFNROT4aRwf7298I4GWvGiRL5KJKD+P8s9oT/Cg5663UpS4K8sI6JWS5t7U3 66cOra/XStaaWJxryvMb3rTxDPZ/J8TJYht5omymxYu8C3enkXE3Qsb9ZsZnVPz839dY MqMg/a2IsMM5uToGqEnbof1WDxwqCbUaFeac20yHZhFx1a8kmh8lBImKlP4M4koBddyx +EJFcpTvc570E1ZaxO3vuyyNWfSeTN5mVsTp0RzVFVfVorqlbNVzT/3rhgujEqSCrp3d NAJdVg3PO8eBKWn6G7TnSqS5QFifYaEjoz/DLRP5uPU0WmLHgDWtgGjSuVzUZecjJBZa qfFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PJ6WVKuI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a17090636cb00b007a44a13536bsi6713624ejc.243.2022.11.14.03.48.48; Mon, 14 Nov 2022 03:49:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PJ6WVKuI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236724AbiKNLqg (ORCPT + 99 others); Mon, 14 Nov 2022 06:46:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236332AbiKNLqC (ORCPT ); Mon, 14 Nov 2022 06:46:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5D3DA473 for ; Mon, 14 Nov 2022 03:44:59 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 53F4C6106E for ; Mon, 14 Nov 2022 11:44:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAD94C43146; Mon, 14 Nov 2022 11:44:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426298; bh=s+opGJ7QoOGk4sclN8NLpDopS2NNvFfrwRO9izFas60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PJ6WVKuI/QgsSuRDFCKOvAO0uUM0gU8psBNgN+vVzgutS5/SEveoHFBC8sti98ChE 21raGHbXdg1YvVHO1pwKMyCQ79tbvGbCsBATj5YZM6qdlZV07GqGvxGZAfw/B3kQsg MoY8iU5jOKJpwYVBSP2fgzkJWa3naU5SYi95ul/KKOTG3T2MMcmJbV/UetvmyFR4rO kyxdeQEndDY9ETWR1hlki3J3//BGzIO3tD1UvsGblsDOUbFQwl2QvsSt2BVK+tZpzQ Q+EvDa4orxePuIVGvDuJ9hFPzjoUk703JRBFaCQTbyKRTCU67lhK9dSnEcv9pb+Fo1 UJ+XyfhxOgjRg== From: "Jiri Slaby (SUSE)" To: linux-kernel@vger.kernel.org Cc: Andi Kleen , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Andi Kleen , Martin Liska , Jiri Slaby Subject: [PATCH 25/46] sched, lto: mark sched classes as __noreorder Date: Mon, 14 Nov 2022 12:43:23 +0100 Message-Id: <20221114114344.18650-26-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114114344.18650-1-jirislaby@kernel.org> References: <20221114114344.18650-1-jirislaby@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749472041560769253?= X-GMAIL-MSGID: =?utf-8?q?1749472041560769253?= From: Andi Kleen The scheduler code assumes that the scheduler classes are in a particular order in memory. gcc LTO can violate this. Specify __noreorder to avoid a boot BUG(). Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Steven Rostedt Cc: Ben Segall Cc: Mel Gorman Cc: Daniel Bristot de Oliveira Cc: Valentin Schneider Signed-off-by: Andi Kleen Signed-off-by: Martin Liska Signed-off-by: Jiri Slaby --- kernel/sched/sched.h | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index a4a20046e586..fe2703528972 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2230,6 +2230,7 @@ static inline void set_next_task(struct rq *rq, struct task_struct *next) */ #define DEFINE_SCHED_CLASS(name) \ const struct sched_class name##_sched_class \ + __noreorder \ __aligned(__alignof__(struct sched_class)) \ __section("__" #name "_sched_class")