Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp52660pxa; Mon, 3 Aug 2020 22:33:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcxJsU9GX5dQOVzC1FxBPX0eId3816lGS1Nj7MJUGFdhl4s4KqJlF6ya/tLoSyAwr9Megg X-Received: by 2002:a17:906:454e:: with SMTP id s14mr19424052ejq.147.1596519185142; Mon, 03 Aug 2020 22:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596519185; cv=none; d=google.com; s=arc-20160816; b=dZc5kls960ra8cqxhbw6SXrsGjKQMs+4cYCB8YKyo3BZLMKEml3hT098JcpBv1LG1g CdWmMgrCjf+dsf8Wb/wE144YJR2WaInuE+gBYQ9ZhtqdoSIKDTUCr8pYinmRIxyYApRc eX15xrbBw9eWZGQPlSkz3PR5rqwuU+vOMy+ytYW3U5W2YFxk2t96hjauTugQLu9jpMm5 D9IZPFbZ4B057+1d1lpRE97JcCV/ZapiSrmytMAziy1w5n6ImktkoFCznm5Xv2QQzlG4 OYoj6veWX0ox2e0WQsIC/fyfDyW1GLmkdLCg7U++OyLK8y/C1T+sP78cQPdfj5polk5/ mQyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=SYIRLxV49LREgpupMxZqNaA5o9fHAoeWk6pTwu6HNpo=; b=PZWrrGNticZLS6qy5XUBLRXjBSPHgunHhhikG1YBeQnUodqBilwvt8TuZqlqMFd2yD Mvbs76kxtsCOBdr7FbnKIP+lQwrzrN86NY0LtJCWf1lG+2nJVuJNBWU6HEk1wlkJuspp y2++KJ11BGmqFwPVX9Hw/UKwwU4UT6cIc84UdyGWvZeapgXdYk7M/Um8LovdFCuGRxYi Td3Z5pTL9aQQa6WceHP3KW9MTiM0KeSLMzOJJ+j3r8d2V+FSNsa49IuHkz9PtS2sDMGv fxg8ernkawLX01IwO3zZTwUNT/LB0IrGPadhayHqLyTgcMTAdRT2UkMFEkAAkU5TKHLV yr4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Ph8ZuBGU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o8si11695991edq.435.2020.08.03.22.32.42; Mon, 03 Aug 2020 22:33:05 -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=pass header.i=@google.com header.s=20161025 header.b=Ph8ZuBGU; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbgHDFcd (ORCPT + 99 others); Tue, 4 Aug 2020 01:32:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727812AbgHDFcc (ORCPT ); Tue, 4 Aug 2020 01:32:32 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A575C06179E for ; Mon, 3 Aug 2020 22:32:32 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id e8so21461154pgc.5 for ; Mon, 03 Aug 2020 22:32:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=SYIRLxV49LREgpupMxZqNaA5o9fHAoeWk6pTwu6HNpo=; b=Ph8ZuBGUk+/4Umvi3tBIzf/QoNeRTzEty93PfC99H5oKffGm5XPBIYydB/2qEjwx+J SZlumfSOoM+FB4ii86QCn1PTMJ9NjJY1FZUj2o/u1krMTrrJozPlGsMuZcNXIvRjpPcJ +81DI4YxL4IU6lFGb0Pbpc9mW8IlwPMik2dCyLkBcwktamtjKAinHZrEX//ZHUbKngp2 MSXGzP8/tmQLmOFB7W5dB+57aIme9PO1DVII/zySdREQiWkYF7MCpIOIHFgUVx2svIar 11zh2B8Q9ICjj9GH1pCF3bU70VMzSX8LQhVIliff5lguiHIeRZXh+NE4la6L3y3/ChSK Id9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=SYIRLxV49LREgpupMxZqNaA5o9fHAoeWk6pTwu6HNpo=; b=FOZ+BCoqFhAcft39kDi7Etk7bYDtboeO+Wzix07AszhHyKrPdxUFcF0K0kA8GGHuIR adxSagTEbsoCY32/JdbUFupNng0xerVZ60Yn7I8rFefY8VZCGZ/eb2QQMu5X/grJ/8ba FlH3VdLmTxCJys412BmGOItyOKkmwPqIH0XjRsXM+WDCDedEM8iD3nvGchP/OT03BHIF lPQbdif/G/9qsr9s5lGzkNTjg/DLtuYBio8aTvguDHTRbyhGzIQvK2jYCf7AEeaKDsyb KwgpYIxIKry8BjsW/rRozEYIx7p7oB6pmcif0djMQ8xAMg3Ytb1ldhvNRm6DwVSivfse oSGA== X-Gm-Message-State: AOAM531hTAgOgf4KmbuLPC26tp7SA9JbKDWwHNKO/a4qpum78QKEnwRr o+5TXgPOzl6jTNFlcEMStP64Sw== X-Received: by 2002:a63:cf0e:: with SMTP id j14mr10344966pgg.119.1596519151489; Mon, 03 Aug 2020 22:32:31 -0700 (PDT) Received: from google.com ([2620:15c:2ce:0:a6ae:11ff:fe11:4abb]) by smtp.gmail.com with ESMTPSA id go12sm1117217pjb.2.2020.08.03.22.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 22:32:30 -0700 (PDT) Date: Mon, 3 Aug 2020 22:32:27 -0700 From: =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= To: Andi Kleen Cc: Arvind Sankar , Kees Cook , Thomas Gleixner , Will Deacon , Nick Desaulniers , Jian Cai , Luis Lozano , Manoj Gupta , stable@vger.kernel.org, Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Ingo Molnar , Russell King , Masahiro Yamada , Nathan Chancellor , Arnd Bergmann , x86@kernel.org, clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Marek Subject: Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections Message-ID: <20200804053227.k7zyozzrw5mhv6qi@google.com> References: <20200731230820.1742553-1-keescook@chromium.org> <20200731230820.1742553-14-keescook@chromium.org> <20200801035128.GB2800311@rani.riverdale.lan> <20200803190506.GE1299820@tassilo.jf.intel.com> <20200803201525.GA1351390@rani.riverdale.lan> <20200804044532.GC1321588@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200804044532.GC1321588@tassilo.jf.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-08-03, Andi Kleen wrote: >> 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 > >You may lose part of a cache line on each unit boundary. Linux has >a lot of units, some of them small. All these bytes add up. > >It's bad for TLB locality too. Sadly with all the fine grained protection >changes the 2MB coverage is eroding anyways, but this makes it even worse. > Gives worse packing for the hot part > if they are not aligned to 64byte boundaries, which they are usually > not. I do not see how the 64-byte argument is related to this patch. If a function requires 64-byte alignment to be efficient, the compiler should communicate this fact by setting the alignment of its containing section to 64 bytes or above. If a text section has a 16-byte alignment, the linker can reorder it to an address which is a multiple of 16 but not a multiple of 64. I agree with your other statement that having a single input section description might be helpful. With more than one input section descrition, the linker has to respect the ordering requirement. With just one input section description, the linker has more freedom ordering sections if profitable. For example, LLD performs two ordering heuristics as my previous reply mentions. It'd be good if someone can measure the benefit. Personally I don't think this kind of ordering has significant benefit. (For arm/aarch64/powerpc there might be some size benefit due to fewer range extension thunks) >> 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. > >It was about efficiency. > >-Andi > >-- >You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. >To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. >To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200804044532.GC1321588%40tassilo.jf.intel.com.