From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE2B31CDA27; Fri, 1 Nov 2024 18:06:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730484385; cv=none; b=SaENCSdwvsHTbr19+CnDuPi9wceaXBWfW0PyVW9HPIU5dpAmoCBLvyQwdDhkKfZYylIGAPZhvl2JdVbQrRC+cIEi246KWZBkh3i2cWTBoHT1jO+ete62NRQYLtMcw6wCxIQvgJPgz+6klTniwZuc9xeAKwOcfwB4qhruDy/Z/PY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730484385; c=relaxed/simple; bh=JJjwqh39fcCVx0ubjs5+WcMycs+cNM3heEyzFIYdiEE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=dPgV1Rt/ymYCdQK5j9hFiOYEXhcpcUbAmewzuyVt1omEIggwSWhKGkgi4d1VLuvN2rRLXzpABIAMRju/TvHepLWE1ZOQ/phq122+Cdss0HQm+Ax4rtYMdzANi/0VR+vAStec/9rxlZE7/L6Xm8PkYx20I2qzZ0PT/iGxMfjdcgc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oGFyzzrY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oGFyzzrY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6537CC4CED4; Fri, 1 Nov 2024 18:06:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730484384; bh=JJjwqh39fcCVx0ubjs5+WcMycs+cNM3heEyzFIYdiEE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oGFyzzrYctRAw0+vSdKszYhCr6MZakc+bum0xBkNuoIQjBDZeALsgpY3fpU/YiVy/ MTo8d1l8hu7PYeFzes6xmZUeJlbgCq1oLePpHv7X8KJZrPe/rIJW++V7LCiA7rgJcP uj9LI2Ws1OEVr3ma5YoOorGlgj6guMZNslSYXTDI/NOdAMqv48y7Mt2wttESaTHS0u c/vIqc0rPjpRCPr2f5R3l61Nn72sFushIGqPjLdP04vQioG+OOaOw00Wy01otQRN5V M/kSKhMjN7Ag2IktDM6GgLS/YZhl8ESusMWDp+OCz0BSSZrn4EuS4GL/gxC3NHIhR0 xY0abIZFZxuTw== Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2fb599aac99so20217991fa.1; Fri, 01 Nov 2024 11:06:24 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCU6QYIwF9S7TltX5Anb20RpjNuKPpQ2VAGUEX16B7mB3jx+xlTuEvb+vi4CNP2nVzwpRIqKmDoSe16I@vger.kernel.org, AJvYcCUMPyr0QisaZiEZPxmWe8Fs9Hz8WxILKajW0IsUJqo3ccEOkHvEQ/dorbtRhAyuQLBOzJ/RMmPnMt5K@vger.kernel.org, AJvYcCV4kAcYaJCfmFRLJdCsQ1PGD67s7KY+A9yd0JdAvohhByeIOEaukY12LRwBdzTqc55+vhVGXHdSq8WkzQ==@vger.kernel.org, AJvYcCWJW+wt5Mfm6zfMpAofnf6ORKbcpYjuVAfjz0Taiy8AOYiaGV8Ng6r7hHfpKioY+UOwo0BlH2JfA/wPezgF@vger.kernel.org, AJvYcCX6FbLujOVTVKakOxhqYBtUkkBe6Aq3UNZkQr6JbN+BhA8ArF8SCl3q2xvcmjfq6gnXwhGuxNQ2LFxv@vger.kernel.org, AJvYcCXJzVdTyqKqngWg5uDO9KbU8PYNPZGY5Yec6svZ30t19dy063NrlLjMb6jpUJRGEQ0fmLOtMlm3gBY4w69g@vger.kernel.org X-Gm-Message-State: AOJu0YwjFHqTF3dXW5NWnusKaSLsmtJitKLhAhb4axX+tzA/vd00pJFU 7QebvtBcNrTQ20jAFevfN1HFXQYoltvJbO+ZHrP8VYodAv1D4il53TT5Jjh+d2q2bDQZwAnh4Op uWc87t9NxSxpnSV+eZyHxpR3ZrZY= X-Google-Smtp-Source: AGHT+IENQ8plh56/KCN7UexCPK7YNwOgQocP3X0UjZV+vdI494pX+xUTRKzwl4gLjC+Afni5PbyZK3sjbjZQziO76Fo= X-Received: by 2002:a2e:b88a:0:b0:2fb:5bf1:ca5e with SMTP id 38308e7fff4ca-2fedb831b8emr26176271fa.42.1730484383031; Fri, 01 Nov 2024 11:06:23 -0700 (PDT) Precedence: bulk X-Mailing-List: workflows@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20241026051410.2819338-1-xur@google.com> <20241026051410.2819338-4-xur@google.com> In-Reply-To: <20241026051410.2819338-4-xur@google.com> From: Masahiro Yamada Date: Sat, 2 Nov 2024 03:05:46 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 3/7] Adjust symbol ordering in text output section To: Rong Xu Cc: Alice Ryhl , Andrew Morton , Arnd Bergmann , Bill Wendling , Borislav Petkov , Breno Leitao , Brian Gerst , Dave Hansen , David Li , Han Shen , Heiko Carstens , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Jonathan Corbet , Josh Poimboeuf , Juergen Gross , Justin Stitt , Kees Cook , "Mike Rapoport (IBM)" , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , "Paul E. McKenney" , Peter Zijlstra , Sami Tolvanen , Thomas Gleixner , Wei Yang , workflows@vger.kernel.org, Miguel Ojeda , Maksim Panchenko , "David S. Miller" , Andreas Larsson , Yonghong Song , Yabin Cui , Krzysztof Pszeniczny , Sriraman Tallam , Stephane Eranian , x86@kernel.org, linux-arch@vger.kernel.org, sparclinux@vger.kernel.org, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Oct 26, 2024 at 7:14=E2=80=AFAM Rong Xu wrote: > > When the -ffunction-sections compiler option is enabled, each function > is placed in a separate section named .text.function_name rather than > putting all functions in a single .text section. > > However, using -function-sections can cause problems with the > linker script. The comments included in include/asm-generic/vmlinux.lds.h > note these issues.: > =E2=80=9CTEXT_MAIN here will match .text.fixup and .text.unlikely if de= ad > code elimination is enabled, so these sections should be converted > to use ".." first.=E2=80=9D > > It is unclear whether there is a straightforward method for converting > a suffix to "..". > > This patch modifies the order of subsections within the text output > section. Specifically, it repositions sections with certain fixed pattern= s > (for example .text.unlikely) before TEXT_MAIN, ensuring that they are > grouped and matched together. It also places .text.hot section at the > beginning of a page to help the TLB performance. The fixed patterns are currently listed in this order: .text.hot, .text_unlikely, .text.unknown, .text.asan. You reorder them to: .text.asan, .text.unknown, .text.unlikely, .text.hot I believe it is better to describe your thoughts about the reshuffling among the fixed pattern sections. Otherwise, It is unclear to me. -- Best Regards Masahiro Yamada