Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp317769lqp; Tue, 11 Jun 2024 05:45:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGlNDvmdsKUJra6WrBnz3+Mbp1KvvDR9QWwhln68WM9UXusHN2+AjTlY1RtPxM06UuvfvgOw2p2c4DlcnWgQsLEE1unZXqf/imu0zqlw== X-Google-Smtp-Source: AGHT+IEBMRS1LS3M7+BXguH94f2heAIIyovTzuB81EgZhUWbcQNQkC/P7iVz0aIvFYk9qGqAjTJR X-Received: by 2002:a50:8d54:0:b0:57c:8105:b9a7 with SMTP id 4fb4d7f45d1cf-57c8105b9cbmr3261133a12.29.1718109942910; Tue, 11 Jun 2024 05:45:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718109942; cv=pass; d=google.com; s=arc-20160816; b=yB7uUZbpVE6n/PbQzH0I+tOmHhtkSRTRmuo3miqObIK+vzcFqx5hdqlW27j+PyOT61 EIg4mbVv0bbI873znVeEyur/ieFvNSeeApGnxPEiAsIAVWPBnWi3280NXgNsgt2Uhs5h W9VFSezj61avxHmslmaRh9kI+jD+hC1VrjB6wpjJ8pBKOMO8gDcUzMpzyAVsiirsdsjC zFMs3fY5fFAg9INlZ9dj21v4AYjgqCh5YzTfLHrLC0t23GvjSQOkCwWOPLm7bkJG0ETs zs7DVW9hfoGAh3nXyqRlfFOD8wu1Eup52+c/7BVt8ZwcT08yrOmtp/x3WST5weG8AtHt gN3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=LA50fIPVA2O1q5A6lERTjC6jOEdlOMiNnypF6hx5p6s=; fh=hzd1iqwDTFt66nxVa1aev5H62OEs2c/TBkxVuFm0UOM=; b=aWVJueTLZsdOF4+kgYcbYBxRJi+WjbwJhS43a3h2+82S4ArtGvjPH1OnYNV4XOucTq 8rZSamq+QK2LfHqFvPKEDkRmDB2cAxEk5LRyhHduPpmC6REVlePI0vgstbMuWAPwMLri YEuOITdoffuiKWhW7XrHMlTIOzjpomefE/7wW4XNwRWYr9OSKFFv2Sbd/8UCgcYhe4en iM9lAixjjOV6ZRiZEIq2JY4w4PO1LRQaeolWGVbS5TmhlzZkcaVLHA/0bkfDOM1q06fk c0zOVeK3z8NHkAPDRLfQr2xIjoaxGp1GUSNeLPnRoH8zvcww0O7w0vqB3O7wqPkoxgQq CZwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-209875-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209875-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c9dea79a9si279782a12.679.2024.06.11.05.45.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 05:45:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209875-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-209875-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209875-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A0DBF1F23CEE for ; Tue, 11 Jun 2024 12:45:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5315617C216; Tue, 11 Jun 2024 12:45:36 +0000 (UTC) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C50A238DC0; Tue, 11 Jun 2024 12:45:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718109935; cv=none; b=ZWkMLT2Y1TG8OFn3PAIyP2JxvFaYWakGp4XHccRBvfKxdpkr9b5aibqQtSdH8tRx8vWx1gvhT4ckjqwwND5obg3L+4VGVkhPJdfIAua3L8QAyJPI0Fs8mkI5o+oXTpbBWbSmQ/QRLLfxEMMrbLbI3mWA4VW7Sr+XQX6W2RqegFg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718109935; c=relaxed/simple; bh=nY8+G6+Wc+iKEOD8LIKa0F5xqH0+KD8ciWBL2bCrMIw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=IpuMAQeI9gZUvZZkC9ovyCpYrWO8EZN2KjL3z7hxJ5PoFWnwaCabC1tGXd4hNQD/UC4njdguYpoVI1xah1mmj9yD2+/HjG2L2FUILUTXuIAbfeIec37h9K6FJGjYqSIGg/WO2nEQiDg4NPNzH136WrV9qmZ+IhT2KQlRwuY6xNg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.219.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-f182.google.com with SMTP id 3f1490d57ef6-dfb3ff45c06so1154303276.3; Tue, 11 Jun 2024 05:45:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718109930; x=1718714730; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LA50fIPVA2O1q5A6lERTjC6jOEdlOMiNnypF6hx5p6s=; b=YTOWC8DsqEjvA4YgO02pMEUt+TNjeDZPbhGRq2F5DJN6qz1x1t+wNd69uYd00YwbRE 0F100BW+6RW/mCbvlgqcJ0W/2XEw1V1ZZIb3vyv+6IsE5N3czc7xVsOxl/CMTkA0yNqH dK+0yNrxONddK8C8tvOEYElpHTDkiX0B3Rch/F3ZlxYySLSJGndEJwd52EowZifRKUI7 orMvPA91GCAL6tWL/XS2hmeRnGGjcpgQZ+Emd9GcSo5qjYFIjjCe1AMoCmrjPqJGPsfq W320Pd5gKYx2QWBXqodpxnPApRNWbT3uWe0G02S3pRFtEZXuV9TMhZf0K5zhluacuxcx H3xQ== X-Forwarded-Encrypted: i=1; AJvYcCWbdw4AHKzPp0OWazSWHKNuV4VSShYfOLsjm2NG6AQ/g6isqB2FQgNXHixETqaPl6hAHP4Po3l1uHR/uJuB5F360EaCecW91g5F2afAb6LKB30N0aeE4UUyciTnP0ss3W6BQyxH7gzw3gaFdeOosqg= X-Gm-Message-State: AOJu0YzzFyYBycmF3dFyxOcKigDtV3qwRoymKLPS1OxCWiWz2LZkVc4U gNmkS6pXkrjkUfmy3jpf0Thm+V0vFiKHkLqhW4ZKNLuQlAOTTv1TfddVLCQ/ X-Received: by 2002:a25:bfc8:0:b0:df4:d29a:6897 with SMTP id 3f1490d57ef6-dfaf65c55aemr11105864276.35.1718109929625; Tue, 11 Jun 2024 05:45:29 -0700 (PDT) Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com. [209.85.219.173]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-dfb0138fd2bsm1512911276.51.2024.06.11.05.45.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jun 2024 05:45:28 -0700 (PDT) Received: by mail-yb1-f173.google.com with SMTP id 3f1490d57ef6-dfb3ff45c06so1154178276.3; Tue, 11 Jun 2024 05:45:28 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXPH8wW/2DKVkKayODXxO6QHartBiuUNLNIUxIBXW0u2rZuFHEcDZNggNTbSKxXkyp8lKkndgDfoVcnpOwlpt5iom6eNCQEVhE0FJZLuSGgnVgxKwRYVMlDFoIIbjf9JSMgX/0WO+leYQil8Gwj4sE= X-Received: by 2002:a25:744d:0:b0:dfa:528d:e8f4 with SMTP id 3f1490d57ef6-dfaf65c01c4mr11427597276.33.1718109927736; Tue, 11 Jun 2024 05:45:27 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240316023932.700685-1-liuyuntao12@huawei.com> In-Reply-To: <20240316023932.700685-1-liuyuntao12@huawei.com> From: Geert Uytterhoeven Date: Tue, 11 Jun 2024 14:45:14 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH-next v4] arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION To: Yuntao Liu Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, arnd@arndb.de, ardb@kernel.org, linux@armlinux.org.uk, afd@ti.com, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, corbet@lwn.net, rppt@kernel.org, robh@kernel.org, tglx@linutronix.de, linus.walleij@linaro.org, maskray@google.com, Linux-Renesas , Chris Brandt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Yuntao, On Sat, Mar 16, 2024 at 3:44=E2=80=AFAM Yuntao Liu = wrote: > The current arm32 architecture does not yet support the > HAVE_LD_DEAD_CODE_DATA_ELIMINATION feature. arm32 is widely used in > embedded scenarios, and enabling this feature would be beneficial for > reducing the size of the kernel image. > > In order to make this work, we keep the necessary tables by annotating > them with KEEP, also it requires further changes to linker script to KEEP > some tables and wildcard compiler generated sections into the right place= . > When using ld.lld for linking, KEEP is not recognized within the OVERLAY > command, and Ard proposed a concise method to solve this problem. > > It boots normally with defconfig, vexpress_defconfig and tinyconfig. > > The size comparison of zImage is as follows: > defconfig vexpress_defconfig tinyconfig > 5137712 5138024 424192 no dce > 5032560 4997824 298384 dce > 2.0% 2.7% 29.7% shrink > > When using smaller config file, there is a significant reduction in the > size of the zImage. > > We also tested this patch on a commercially available single-board > computer, and the comparison is as follows: > a15eb_config > 2161384 no dce > 2092240 dce > 3.2% shrink > > The zImage size has been reduced by approximately 3.2%, which is 70KB on > 2.1M. > > Signed-off-by: Yuntao Liu > Tested-by: Arnd Bergmann > Reviewed-by: Arnd Bergmann Thanks for your patch, which is now commit ed0f941022515ff4 ("ARM: 9404/1: arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION") in arm/for-next (next-20240611). I gave this a try on my custom configs for RSK+RZA1 (RZ/A1H) and RZA2MEVB (RZ/A2M). According to bloat-o-meter, enabling HAVE_LD_DEAD_CODE_DATA_ELIMINATION reduced kernel size by almost 500 KiB (-8.3%). The figures reported in "Memory: ... available" were even more impressive: 1032 KiB more free memory than before. As these boards have only 32 resp. 64 MiB of RAM, and some products even use RZ/A1H with just the 10 MiB of on-chip SRAM, this is a good improvement to have! Thanks! Tested-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert --=20 Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k= .org In personal conversations with technical people, I call myself a hacker. Bu= t when I'm talking to journalists I just say "programmer" or something like t= hat. -- Linus Torvalds