Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp611317rwo; Fri, 21 Jul 2023 18:24:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlG631RXrgz5xvvHuFplYFyNIcK7T5IVPKkdB/3GLYPv8zLWuEdeVD8y0DhVjY3Jl1mNAqzd X-Received: by 2002:a17:90a:a516:b0:263:abea:94d1 with SMTP id a22-20020a17090aa51600b00263abea94d1mr2718670pjq.44.1689989078611; Fri, 21 Jul 2023 18:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689989078; cv=none; d=google.com; s=arc-20160816; b=rfTXC4XYAW8KXI20N1DtXm8CAFi4S86mZpN3GV1ciVwBcjL/RJk7f2w4CgHf6nnPQI sZA0GopOpMHW3+wGe7i8pHusJhlmgrvRjyidb4Q8i2c4KozP6YGo7J/GJu926297KJQI MUC/1dyOwEFb0J4qOQCm/UWElK1hjgxp9iTmqFjoHikjIkXKRRq3DHoRgr5+Fwfa1xKj M4TeA3URNb5kF7giAJsZQx40eEpfGrezL/5k7EeV5eHsNrdLjkn2EXc4IvfhEdfdOcFc 3xqt9+Ory0/Q3q3CkzpI6yB1gbfNN9zK6KSVZTnVscP6Qwuvy+er0cDWrYCzPDUYWjdB +0vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Gj3Xl7dsvl9L6KFIj63HJhmaeXyRYFaIHbakrb1Ec4I=; fh=oxa26P4Sn+Oj2ETnu3KpU3HgqXky7giivNGNZFOlzL8=; b=MU4/V4gBO41Rzy+jxvZrcl5J3/gC0KvAwpjQ0Pux8jgW8UH3sHQOPWSmIXYv5Nkil6 GDCscgcG1yP2dqfvLiq2mbR7qG68GTC51iwV7GvgIvqRh5x/oWPY9mNpd/N41lC53AWn oqjwJfilU4TkWEdOhM+U8m0VO3x4Lx8i4D+ga6ngNc2Gpxwv4I3Zm49HbJm4YEcFp1JP SwZ2v9O2g5cXa/uhoQN4l2N0FX/JDHzLwgHFr8EvIm87usBukrUSOwXUoj7tD9fk0McK rk+LkDv/df1xgxCvcflMZXAYbyGbWLl04Hy5V+r1HiJF3+X3t3NMYx4pel+TchpE5jzD QJWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=MAdJRMJY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k1-20020a637b41000000b0055c8f4a56d5si3948227pgn.600.2023.07.21.18.24.26; Fri, 21 Jul 2023 18:24:38 -0700 (PDT) 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=@google.com header.s=20221208 header.b=MAdJRMJY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231261AbjGVAi3 (ORCPT + 99 others); Fri, 21 Jul 2023 20:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbjGVAiR (ORCPT ); Fri, 21 Jul 2023 20:38:17 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB6A44AA for ; Fri, 21 Jul 2023 17:37:51 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-40371070eb7so72701cf.1 for ; Fri, 21 Jul 2023 17:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689986262; x=1690591062; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Gj3Xl7dsvl9L6KFIj63HJhmaeXyRYFaIHbakrb1Ec4I=; b=MAdJRMJYGacsbrazrEuC0rQIeU8QNFQUnJUCPgK7a1vzUNIj82x/4RiX3EPgCAVJv+ vjDvb5O/dVdRr8MjaYyeLQg7RNJx5mp+B0hz5ymmByPWoPUwC282oofovzofBXW4lOgo uDPcDd3ofQhJYWARPXrTAICAs+ZZ75L7XDKUp34xegAxO54nxkG3DD/j1+HS5w3acRR0 2hKfahZSEDpdXscDRJARFhBCX6IVCFk+ORU7D45GfxMEWXwEwOyTHIDBkfpEdDUfweXI ZKFKuO/VLBeM83b2EJkOtpn3jk8ZfPHtjtO2qHeaVp1h/KkAmh89HkmVdmMDwtBOJ0ON zzbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689986262; x=1690591062; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gj3Xl7dsvl9L6KFIj63HJhmaeXyRYFaIHbakrb1Ec4I=; b=Rp/lqdPnPC/qYcd5M7+heGJrTMIYuJgHt53iHYouEOprbNgbQv59g1ClNxDNQl95Yb /M9a8wSlayLlZYy0ZTiZG2Jlwd6nIDj/LVFcBNvsEfj2xr9xpZ2RdIo843BA8aztRgrv XUEfJRtQnEekUaSYu2caHxsbcLmha8SL4TZUCkTvJazEiZ2RM0t+6AE2CZzZcFn2irBW W0egGF1AqVdjgR8vU1Z/IRIvEm6ZKVArx+nhsQoBZtU6Ix3T1lM0m+uwxY6ZaRAB5bZ6 M+RSnA7XOe5DkfHJNwLIqeUJ104Bpsa+WDzXOmwslB9Bp8XqGNydPq1cpqgOcON5Eb7v OWaQ== X-Gm-Message-State: ABy/qLZd05ijcWcaQUJrRgbPizSxzAyWRyHSlsBJuA7WAbSQp2L1RqBu LPSORWhOagZuvvGmB+nW/icW15RVWM/2zLpg4xpg5A== X-Received: by 2002:ac8:5d49:0:b0:3f4:f0fd:fe7e with SMTP id g9-20020ac85d49000000b003f4f0fdfe7emr56472qtx.3.1689986262548; Fri, 21 Jul 2023 17:37:42 -0700 (PDT) MIME-Version: 1.0 References: <20230625-radish-comic-b0861fb96023@spud> In-Reply-To: From: Fangrui Song Date: Fri, 21 Jul 2023 17:37:31 -0700 Message-ID: Subject: Re: [PATCH v2 0/4] riscv: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION To: Palmer Dabbelt Cc: Conor Dooley , jszhang@kernel.org, ndesaulniers@google.com, bjorn@kernel.org, llvm@lists.linux.dev, Paul Walmsley , aou@eecs.berkeley.edu, Arnd Bergmann , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 On Sun, Jun 25, 2023 at 1:06=E2=80=AFPM Palmer Dabbelt = wrote: > > On Sun, 25 Jun 2023 05:43:13 PDT (-0700), Conor Dooley wrote: > > On Sun, Jun 25, 2023 at 08:24:56PM +0800, Jisheng Zhang wrote: > >> On Fri, Jun 23, 2023 at 10:17:54AM -0700, Nick Desaulniers wrote: > >> > On Thu, Jun 22, 2023 at 11:18:03PM +0000, Nathan Chancellor wrote: > >> > > If you wanted to restrict it to just LD_IS_BFD in arch/riscv/Kconf= ig, > >> > > that would be fine with me too. > >> > > > >> > > select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if LD_IS_BFD > >> > > >> > Hi Jisheng, would you mind sending a v3 with the attached patch appl= ied > >> > on top / at the end of your series? > >> > >> Hi Nick, Nathan, Palmer, > >> > >> I saw the series has been applied to riscv-next, so I'm not sure which > >> solution would it be, Palmer to apply Nick's patch to riscv-next or > >> I to send out v3, any suggestion is appreciated. > > > > I don't see what you are seeing w/ riscv/for-next. HEAD is currently at > > 4681dacadeef ("riscv: replace deprecated scall with ecall") and there > > are no patches from your series in the branch: > > https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git/log/?h= =3Dfor-next > > It's been in and out of staging a few times as we tracked down the > performance regression, but it shouldn't have ever made it to linux-next > for real. > > I'm fine just picking up the patch to disable DCE, I've got a few other > (hopefully small) things to work through first though. Note: for GCC, -fpatchable-function-entry=3D (used by arch/riscv/Kconfig) require GCC 13 for correct garbage collection semantics. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110729 > > Cheers, > > Conor. > > > >> > > Nick said he would work on a report for the LLVM side, so as long = as > >> > > this issue is handled in some way to avoid regressing LLD builds u= ntil > >> > > it is resolved, I don't think there is anything else for the kerne= l to > >> > > do. We like to have breadcrumbs via issue links, not sure if the r= eport > >> > > will be internal to Google or on LLVM's issue tracker though; > >> > > regardless, we will have to touch this block to add a version chec= k > >> > > later, at which point we can add a link to the fix in LLD. > >> > > >> > https://github.com/ClangBuiltLinux/linux/issues/1881 > >> > >> > From 3e5e010958ee41b9fb408cfade8fb017c2fe7169 Mon Sep 17 00:00:00 20= 01 > >> > From: Nick Desaulniers > >> > Date: Fri, 23 Jun 2023 10:06:17 -0700 > >> > Subject: [PATCH] riscv: disable HAVE_LD_DEAD_CODE_DATA_ELIMINATION f= or LLD > >> > > >> > Linking allyesconfig with ld.lld-17 with CONFIG_DEAD_CODE_ELIMINATIO= N=3Dy > >> > takes hours. Assuming this is a performance regression that can be > >> > fixed, tentatively disable this for now so that allyesconfig builds > >> > don't start timing out. If and when there's a fix to ld.lld, this c= an > >> > be converted to a version check instead so that users of older but s= till > >> > supported versions of ld.lld don't hurt themselves by enabling > >> > CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=3Dy. > >> > > >> > Link: https://github.com/ClangBuiltLinux/linux/issues/1881 > >> > Reported-by: Palmer Dabbelt > >> > Suggested-by: Nathan Chancellor > >> > Signed-off-by: Nick Desaulniers > >> > --- > >> > Hi Jisheng, would you mind sending a v3 with this patch on top/at th= e > >> > end of your patch series? > >> > > >> > arch/riscv/Kconfig | 3 ++- > >> > 1 file changed, 2 insertions(+), 1 deletion(-) > >> > > >> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > >> > index 8effe5bb7788..0573991e9b78 100644 > >> > --- a/arch/riscv/Kconfig > >> > +++ b/arch/riscv/Kconfig > >> > @@ -116,7 +116,8 @@ config RISCV > >> > select HAVE_KPROBES if !XIP_KERNEL > >> > select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL > >> > select HAVE_KRETPROBES if !XIP_KERNEL > >> > - select HAVE_LD_DEAD_CODE_DATA_ELIMINATION > >> > + # https://github.com/ClangBuiltLinux/linux/issues/1881 > >> > + select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !LD_IS_LLD > >> > select HAVE_MOVE_PMD > >> > select HAVE_MOVE_PUD > >> > select HAVE_PCI > >> > -- > >> > 2.41.0.162.gfafddb0af9-goog > >> > > >> > --=20 =E5=AE=8B=E6=96=B9=E7=9D=BF