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=-4.0 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,URIBL_BLOCKED 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 92B1CC433E0 for ; Tue, 4 Aug 2020 16:08:32 +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 6E8632086A for ; Tue, 4 Aug 2020 16:08:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="13mVrtPz"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k59NGMAr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E8632086A 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=krpVrIijxBCduCPtR9zI5jJpGPF5WgBCBG/alqFgfxQ=; b=13mVrtPzyyZD2SsdVS4D3WD6p 1vUHkHZYUWdbKfwsmrA3TA41u6i9FFjZ3vBdGWK7QVmLx1ifhQCNjdIELTOFhXDHWcmCBl0cPwJwg Zo3To1lLsDN/m8taG8R5EL08X/liQg+6tGcLI2AC609x3UlIpjDER9gsSWPsXJ6roVtH1WRNcKldS lT4eGtNtZwWrNH2sqke8XWM0ER0gQojEv76CLEA6RYtBWFT/sEp+7JB/hKvPpasuWBAxri51GsTaP /Gs3jJoV6j6CX2ZAtpkZa2a3ko9EF8HSV2ysy2g9DgoQzj0ZIfcW34/sSRLYd1HZMTrpIxPftxcz9 d8uzZo1Jw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2zSt-0004yk-1T; Tue, 04 Aug 2020 16:06:59 +0000 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2zSp-0004ws-Jf for linux-arm-kernel@lists.infradead.org; Tue, 04 Aug 2020 16:06:56 +0000 Received: by mail-qv1-xf43.google.com with SMTP id w2so7170537qvh.12 for ; Tue, 04 Aug 2020 09:06:53 -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=m06IKFD+Y+zyRLVsGx/ScdWAMYbWtM8lfzX3TLDLqQM=; b=k59NGMArZW/IVO5lr7VYQgHpHOKABoRYVH38jJDnL76HtOxMU2WW97srBYNJZXvEnM CCSnkcKxJTchNS0UFV0HmDnGK0YonaUICzlqNZD4jahfj8pxq2H9dL4YDEO+4SQhEFNe j873vmvHK52C+04qxmB9RF4SkRifztnBM87cifTAPPYhWQ3QZpsKZIKearzQ6cVADQVn 36xs8pwoKmlu+9xubKS0claygFJRomudE6cTBrc1gWJJl8aPalo+ofIM0ZEtwBvLEjfv 5oYtbZbYpahkW6zv2S7hsB1rHZ/Cvq3VR5bCYi37c5iSprz7jXwa2aTiXclrBFdF/bHO 2U3w== 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=m06IKFD+Y+zyRLVsGx/ScdWAMYbWtM8lfzX3TLDLqQM=; b=iO3KF2LASiF2e/gtgGt7Diq01n0h+VaQfqZDbNJ3NV72bA7gOSF1ZvaYHv9ILX56hK EmxtgRvcm3LiXp1H0G8jotXh/F+Ut6yFAWbjH+IR9cHhXcm3jVz1sUdDK4itpGla+HAV VtKVOfiKJJ4zvofNTHiIkEZTyXCIHShT7EDvFZxmWUVooOmVHz4WPk4dmtEtvGmhMrDv UHAp19XWC4Wz82wgwQGWgZhtPk/oK0PCQwhzbsb/fFfVXGTMKreO5mqFPPk4aJZ1BDER kD7HUncsE7RGccMTq4WmqrcowDNb3aHhqz5A0OJFWzANX9ZuP/I18ZwfOrwp4+TCHBHa iVOw== X-Gm-Message-State: AOAM530/y0Mdcws47WxVsVpmqWuITRnc+S7Lmo0nMghp611AJ49WnqBq 2PH1kB5edCmMy+bDNZxGvJA= X-Google-Smtp-Source: ABdhPJw2bGYPIUfHRQvq5E7+uSyeqHN5wJTlNWr7pWF5NPqZbUp6h4AcE6QeqyvyFrZTPl2dPt4rGw== X-Received: by 2002:a0c:99c8:: with SMTP id y8mr17347027qve.57.1596557212233; Tue, 04 Aug 2020 09:06:52 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id l13sm23581582qth.77.2020.08.04.09.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2020 09:06:51 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 4 Aug 2020 12:06:49 -0400 To: Andi Kleen Subject: Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections Message-ID: <20200804160649.GA2409491@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> <20200803201525.GA1351390@rani.riverdale.lan> <20200804044532.GC1321588@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200804044532.GC1321588@tassilo.jf.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200804_120655_660066_7DC1005C X-CRM114-Status: GOOD ( 17.26 ) 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 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. > > 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. > Yes, that could be true for .text.hot, depending on whether the hot functions are called from all over the kernel (in which case putting them together ought to be better) or mostly from regular text within the unit in which they appeared (in which case it would be better together with that code). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel