Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5485002rwb; Mon, 14 Nov 2022 05:29:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf7wEYGGNAafEfSivS16QiSw/hSg5rSvdMn11k6KKctma2T4yZztl2aG37o86/yblKPrqY/J X-Received: by 2002:a63:f963:0:b0:46f:4b56:ecba with SMTP id q35-20020a63f963000000b0046f4b56ecbamr11497280pgk.422.1668432551201; Mon, 14 Nov 2022 05:29:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668432551; cv=none; d=google.com; s=arc-20160816; b=vQ6ms3/1cPZ/mEn7+HojYIg1l3UV9tDdpO+RD/I1YZGXDPxvTvp+JSrqsmcLqfc6l+ 3lH4YKlFH+hLNvv5ZT10P2gwTPmbZuY48cfueVW7ai56/cu0zUVE4tR9hsCfFRaV0vVy 4frjwcZzecUFAr47+fMvSP5frqYXaGejZd0FXnrdAIuDkQsn+U2sVm3Ba9b7YL7t8uVY 8k+5/uoiH+uEkWIvD7GPXFYoKA4imTOnvSOCPvf8i2muI+USgPb/QbaLro7weIMPOwwK MbpdCybuV9xRlsyj6yRghMT57CTmliQQjIukmjz4HmvuEZMDMZ+BbcrrIm15/bSxWW9C SUug== 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=jknY8RAzgdWn9SxfxApPWvhy4im0I1SE1/1URE6RX8I=; b=UwgPRVKsFt0tibvHXp8TlM1IIBjg20BNtIFvzlNsmd32fdy049DEFOdbcw1foEx1uj fEGDCnIsl9ZOidIal7Qc49MiNFd3fQgqTT3S4zQrggjXDCzUtOpfSEXCu8dV9TJW5y8C ShM7164dvFfZ03cn8o0zJY0GbookhT85CPwdfWmb/Mvnj4Zy+U1hGZ7A1oGsPhQfdMtk gt0kxrYT37C2vEHXcTtxMnjaF+tWuCbsDEv/7wb+wTQBJzQLgMrx0aJQaQ9m2TLJJ6+2 idU4rrp+aNj7wnjtVQasx937qEgDYFA2nfV1Lt9bkWfsL5ppMqI9TJZb6PyynnGwLJYC uk/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=la1ciPpE; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b3-20020a17090a6e0300b0021616a303b8si7355684pjk.83.2022.11.14.05.28.56; Mon, 14 Nov 2022 05:29:11 -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=la1ciPpE; 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 S236414AbiKNLsR (ORCPT + 88 others); Mon, 14 Nov 2022 06:48:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236940AbiKNLra (ORCPT ); Mon, 14 Nov 2022 06:47:30 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55BF824087 for ; Mon, 14 Nov 2022 03:45:29 -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 ams.source.kernel.org (Postfix) with ESMTPS id 1881EB80E78 for ; Mon, 14 Nov 2022 11:45:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58D34C433C1; Mon, 14 Nov 2022 11:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426326; bh=F41S5/OfJJjx4Qyx7KDXsJWPyr7ThQmJ94m+jQiNNUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=la1ciPpE+MIEVxztF90HGogzquhV08rLd3CsVUecIZyEyXFO5P7K4UPkoTyfnvLqe oUMOIiKfbnSMlLH8X67gdclvvmnSs5uh/T5YUsCNDd3DXFnt2rd+wfoXNIpEdxsFcv TZRrtnoHYltBZ7AWs9y146QMRODFePDO4jpkTqcx6Aal5rcpFilq/Eak7oKV5xkEy/ V6+LPxwF7j1bSe9M7pjGIOt2c4yw7tnK6WEWxpIrge8ihcc+HmUtpvbi1ieF0BFe19 Lulw23FgtYKiIrJ5/qmL8ISkxM9W9u0k/OtloelPjQZrVLX9gUIIIR0DqsxVtL/EHQ 1CpfBlSEyzcfw== From: "Jiri Slaby (SUSE)" To: linux-kernel@vger.kernel.org Cc: Andi Kleen , Miguel Ojeda , Nick Desaulniers , Martin Liska , Jiri Slaby Subject: [PATCH 37/46] Compiler attributes, lto: disable __flatten with LTO Date: Mon, 14 Nov 2022 12:43:35 +0100 Message-Id: <20221114114344.18650-38-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 Content-Transfer-Encoding: 8bit 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 From: Andi Kleen Using __flatten causes a simple gcc 12 LTO build not fit into 16GB anymore. Disable flatten with LTO. With gcc 12, the build still does not finish linking in 10 minutes, eating 40GB of RAM at that point. There is an upstream bug about this: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107014 Until this is resolved, simply disable __flatten with LTO. In the future, instead of this patch, we should likely drop __flatten and its only user (pcpu_build_alloc_info()) and use always_inline to all functions which shall be inlined there. Cc: Miguel Ojeda Cc: Nick Desaulniers Signed-off-by: Andi Kleen Signed-off-by: Martin Liska Signed-off-by: Jiri Slaby --- include/linux/compiler_attributes.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h index be6c71fd5ebb..09cf8eebcb0d 100644 --- a/include/linux/compiler_attributes.h +++ b/include/linux/compiler_attributes.h @@ -229,7 +229,12 @@ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes * clang: https://clang.llvm.org/docs/AttributeReference.html#flatten */ +#ifndef CONFIG_LTO_GCC # define __flatten __attribute__((flatten)) +#else +/* Causes very large memory use with gcc in LTO mode */ +# define __flatten +#endif /* * Note the missing underscores. -- 2.38.1