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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 005A6C433E1 for ; Fri, 21 Aug 2020 19:19:34 +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 C269420735 for ; Fri, 21 Aug 2020 19:19:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bPQxF1MC"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="c9nTXlQN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C269420735 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org 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:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uIgZCBqQyNJLO2E0NM9ecfAr0t/8u56nRw04uKXghEo=; b=bPQxF1MClSaA2oSEBh3BDyKdy ZfNLCf0Fa19ORC7olFQ/AEn0suq5g1CWRnYrQ6Njt/hnduY5jSX9fzeLxYkxvPcw7BSqNPp5/N3X8 g2gLcNTC5O9vkYTRSYRpN+BYsUvl3iYq+ydV1IdJzZ75UksgX9RbDCXaIN3bLedkGtvcSOPLsNmgw wXIKpkMvLQl8s3xFlxzKo7RrM1oi4qrn8Tn4JlLEyx15oZEqUV+dfBZfb5+hdur6z9yab4iys1T+w lQLFGCeQP5rR9JjQMNwdQrteLiQW2pcPY7QV3k+2XS1ZypTfiYL9TAda1nksP774FBoY9AKVnCd75 UjaLjHK1w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k9CYL-0004ms-3p; Fri, 21 Aug 2020 19:18:17 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k9CYI-0004ls-52 for linux-arm-kernel@lists.infradead.org; Fri, 21 Aug 2020 19:18:14 +0000 Received: by mail-pf1-x444.google.com with SMTP id 17so1529088pfw.9 for ; Fri, 21 Aug 2020 12:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=iH/eGhwplhANu5ngguYajhAAOM68U/Ap6x/YYMCKQeM=; b=c9nTXlQNMxlTkjUEBmI7ZJXRVD9/w0VzmwP7XYcrlwJNqIvD9e/4Bg7nhro9mqIRHX W7TkfsuoDy1IphU7AxA4ZmZuKL9yG5AjEURR9d4qU8313miQfcRhOmwz9VC758r41oVz RNirK13ZYv7MZlL30hWsJsl0GdCKhM2nFuYk0= 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=iH/eGhwplhANu5ngguYajhAAOM68U/Ap6x/YYMCKQeM=; b=sU9kzWPQoXijywq6p8zg3uG78jwGjtq23JtOx2TnWS+CmI4dBpday8Duq2NR7g2wiS X1m5TYbzRgNu+ZLyYBF4hSxxxf43T4WIvevR3ZA/rJCG0/sblXYJbmpuQicUSwYux720 hYziq4l/IfNZaBecTlJiKqNozdFAY4SysTReExiu+a8w2y2obFQfjtEaGAyMRaxqAfQI saDuxzTU/XE55eBEooBghw1ecsAVr18U13JzQ1NB3nRlNfpd3YbJe3q26UJFRe7igpof W8JgBQ8yuXbHT6QvyyaP1GqDHKXVhJR4Wbiqvr0AfzeZt7wDKU+aWTldPQ6W6vQz/K6/ u5bg== X-Gm-Message-State: AOAM530uEJiWwZ0CJ8zBgxqo7D6fP0jAuZVcNG9i+OW9OXCELQE3ogvn m+cKplwMDBbj7IAOIuhm8CeI3w== X-Google-Smtp-Source: ABdhPJw5LmRHZmwZ/AvZZhq0vdAI/mHYL/NERH3jKS/lDJIqSghu3bjCZwheNmuG7UoQaGfupCNrTw== X-Received: by 2002:a05:6a00:22c9:: with SMTP id f9mr3657627pfj.212.1598037492193; Fri, 21 Aug 2020 12:18:12 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z6sm3413592pfg.68.2020.08.21.12.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 12:18:11 -0700 (PDT) Date: Fri, 21 Aug 2020 12:18:10 -0700 From: Kees Cook To: Arvind Sankar Subject: Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections Message-ID: <202008211216.3812BBA0C8@keescook> 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> <20200804160649.GA2409491@rani.riverdale.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200804160649.GA2409491@rani.riverdale.lan> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200821_151814_272631_B2F502B8 X-CRM114-Status: GOOD ( 21.27 ) 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 , Manoj Gupta , Will Deacon , Thomas Gleixner , linux-arch@vger.kernel.org, Andi Kleen , =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= , Masahiro Yamada , x86@kernel.org, Russell King , Ard Biesheuvel , clang-built-linux@googlegroups.com, Ingo Molnar , Luis Lozano , Borislav Petkov , 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 Tue, Aug 04, 2020 at 12:06:49PM -0400, Arvind Sankar wrote: > On Mon, Aug 03, 2020 at 09:45:32PM -0700, 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. > > Separating out .text.unlikely, which isn't aligned, slightly _reduces_ > this loss, but not by much -- just over 1K on a defconfig. More > importantly, it moves cold code out of line (~320k on a defconfig), > giving better code density for the hot code. > > For .text and .text.hot, you lose the alignment padding on every > function boundary, not unit boundary, because of the 16-byte alignment. > Whether .text.hot and .text are arranged by translation unit or not > makes no difference. > > With *(.text.hot) *(.text) you get HHTT, with *(.text.hot .text) you get > HTHT, but in both cases the individual chunks are already aligned to 16 > bytes. If .text.hot _had_ different alignment requirements to .text, the > HHTT should actually give better packing in general, I think. Okay, so at the end of the conversation, I think it looks like this patch is correct: it collects the hot, unlikely, etc into their own areas (e.g. HHTTUU is more correct than HTUHTU), so this patch stands as-is. -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel