From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 319A3C433DF for ; Mon, 3 Aug 2020 20:16:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CAEFF22B40 for ; Mon, 3 Aug 2020 20:16:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CunNCzrt"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Mb3JcqW+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CAEFF22B40 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ypERWLCJ9PmvEjU2/Lx1N/IXx1l+LP09pWFjMrnUqhE=; b=CunNCzrt76uZXsMCGe4T38IzY H6kwrG9FoPYU2gI9loosQz1LOXTbyA1lgpEPAssLsjixpP6KHWn1hkKgoXqH64rpYQVY3Ns9S7sSf KbRUWrg1vAluiCg5Yzr9kTpOQJIOog+ibSOZxgXqrfx8pA2hrlXMre+qc+0K4YsapZBF5Wv41axkL rneHRgEI2fg0kIjEyXojLbVVDdfq9EifgXPYqJQBqokl6QhDpNNA/yY0i2UjvmuKhfZglPo/Azhka 5D8swuE5BuT/TgmgJGuChkBSBxP+VyK6N2Hif81xHGrj2NrvWFtUcG9NzZp1uoTQKJ6Nb1IPKNK0+ ws9tFl8vA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2gru-000443-63; Mon, 03 Aug 2020 20:15:34 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2grq-000430-Ay for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2020 20:15:31 +0000 Received: by mail-qt1-x844.google.com with SMTP id s16so29234967qtn.7 for ; Mon, 03 Aug 2020 13:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wIzAc23M6SmVRHfzbQTJsd5meKdIF3mKB2ogEoSxK28=; b=Mb3JcqW+XFn1zZNLDNtYzvQ7fYRa2tYUzI3gZFDWNUWde5OcP26V0oh+PjD35OCSzB bzMPfV03KjMF0FQBDerQ64AKSYaoszLeYaXvJK0c2834Apz3yejXmA+jjGn9DCQ++cbt PJDN6Oi3rIRwOLAUF4YqK7/UbjnycJ1TK3UGqO2C3liIo2HQiUA03NRBMMQDpvBAQrbC IOL7zWOem7AHl2unr256yMU8jaPwjG4/WPHVtoLmGLQp46VGFMlnLhTIzAgCw3gEtz2/ aWgH35uAWnE/OxW9pXO4WeDglTwikPls/ndMJJT+REEG3d7QoMRrRkpbl2QrssGKrPQ2 5T7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=wIzAc23M6SmVRHfzbQTJsd5meKdIF3mKB2ogEoSxK28=; b=docTxxLSaGMPlLFR59mrVdDfTT7FVbf9pNLX03QsNtcyiNcTIDJmEGQ9EofWJ+WG60 S/J7GgKv+eu9ATDZFY9vWCRRK2NKGA8Aj0dCl35s2WsOTz/mHIGqGhgcM6kQfeewZuK3 0Vd43lhB8+XI2XR792KYBEQO18bCFOzEYCGslvYxr2cSiUaDSe7zgI0aTv0znEYrBD3e 2/6UU0ZOpjrMu6s63eeMW7pkvO6MObknyJITeU4gXaF6JpTo22Bi3SVpT3NDaMZp8liq LWSCOorRNDm5zdHKsgD7ClysGS9HXB3cCB7yX1NGcHvoHHIWPAWxeAylnPUtoBHF6rwl /N5w== X-Gm-Message-State: AOAM532e3yrg4STE/ddaSRpJZAiOpilLAzl5Md515L30RjYMW9R3EynS NFkPUpKeEj0cZXll1tpk0Wg= X-Google-Smtp-Source: ABdhPJyE3PI+Fi7IC9HkU//5shrXJxzaX2PctnEZrfdsFCsLRS9ySPu20CHEHgpiFEUf6cFiR/O54w== X-Received: by 2002:aed:29a1:: with SMTP id o30mr19112481qtd.249.1596485728209; Mon, 03 Aug 2020 13:15:28 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id w20sm4846226qki.108.2020.08.03.13.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 13:15:27 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Mon, 3 Aug 2020 16:15:25 -0400 To: Andi Kleen Subject: Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections Message-ID: <20200803201525.GA1351390@rani.riverdale.lan> References: <20200731230820.1742553-1-keescook@chromium.org> <20200731230820.1742553-14-keescook@chromium.org> <20200801035128.GB2800311@rani.riverdale.lan> <20200803190506.GE1299820@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200803190506.GE1299820@tassilo.jf.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200803_161530_405992_42824181 X-CRM114-Status: GOOD ( 23.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-efi@vger.kernel.org, Catalin Marinas , Arvind Sankar , Manoj Gupta , Will Deacon , Thomas Gleixner , linux-arch@vger.kernel.org, =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= , Masahiro Yamada , x86@kernel.org, Russell King , Ard Biesheuvel , clang-built-linux@googlegroups.com, Ingo Molnar , Luis Lozano , Borislav Petkov , Kees Cook , Arnd Bergmann , Jian Cai , Nathan Chancellor , Peter Collingbourne , linux-arm-kernel@lists.infradead.org, Michal Marek , Nick Desaulniers , linux-kernel@vger.kernel.org, stable@vger.kernel.org, James Morse Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Aug 03, 2020 at 12:05:06PM -0700, Andi Kleen wrote: > > However, the history of their being together comes from > > > > 9bebe9e5b0f3 ("kbuild: Fix .text.unlikely placement") > > > > which seems to indicate there was some problem with having them separated out, > > although I don't quite understand what the issue was from the commit message. > > Separating it out is less efficient. Gives worse packing for the hot part > if they are not aligned to 64byte boundaries, which they are usually not. > > It also improves packing of the cold part, but that probably doesn't matter. > > -Andi Why is that? Both .text and .text.hot have alignment of 2^4 (default function alignment on x86) by default, so it doesn't seem like it should matter for packing density. Avoiding interspersing cold text among regular/hot text seems like it should be a net win. That old commit doesn't reference efficiency -- it says there was some problem with matching when they were separated out, but there were no wildcard section names back then. commit 9bebe9e5b0f3109a14000df25308c2971f872605 Author: Andi Kleen Date: Sun Jul 19 18:01:19 2015 -0700 kbuild: Fix .text.unlikely placement When building a kernel with .text.unlikely text the unlikely text for each translation unit was put next to the main .text code in the final vmlinux. The problem is that the linker doesn't allow more specific submatches of a section name in a different linker script statement after the main match. So we need to move them all into one line. With that change .text.unlikely is at the end of everything again. I also moved .text.hot into the same statement though, even though that's not strictly needed. Signed-off-by: Andi Kleen Signed-off-by: Michal Marek diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 8bd374d3cf21..1781e54ea6d3 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -412,12 +412,10 @@ * during second ld run in second ld pass when generating System.map */ #define TEXT_TEXT \ ALIGN_FUNCTION(); \ - *(.text.hot) \ - *(.text .text.fixup) \ + *(.text.hot .text .text.fixup .text.unlikely) \ *(.ref.text) \ MEM_KEEP(init.text) \ MEM_KEEP(exit.text) \ - *(.text.unlikely) /* sched.text is aling to function alignment to secure we have same _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel