Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp154098lqp; Tue, 11 Jun 2024 18:55:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWKF2ujIJCl0wjnfz81XjpXytFgXXYWyoink8zFFKItSBuTt0id7lT1h8oorkC0DRm0bR/SzF15Ra9SO621+WhsOSITOfP2N7xrHmRZzQ== X-Google-Smtp-Source: AGHT+IFyNv+GQ0sQKPZ1w3LPEDiXLHir2xiLqmPKp4S4IbC9xwOARIS/KcjoZqKhNYNgZtoYLxb5 X-Received: by 2002:a17:902:d507:b0:1f5:e635:21fc with SMTP id d9443c01a7336-1f83b5e5720mr5520685ad.21.1718157321842; Tue, 11 Jun 2024 18:55:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718157321; cv=pass; d=google.com; s=arc-20160816; b=F2qYf7rwEr8+73Ztis7fEvQ8D3u6dBZeb4xzSg4S4sLgZipFp1qY/tByxia7fyrVvQ Ocm/NtTyN5/ET1Sp9Jcu0/jEtkPFgx+ESaU/+c3iUQqe2rzaTyEiiGCtpHPgvllxIp9P 5sy10ogTDbiF3h9xoqn2viZNRaZelBaYT23v5bHBs8wJE6azUne0G1T3Xv9cEVFe5eKE csPniPx3lOpbNIiAOmCZtXR08JISxc14/ys/WCnZc9EwDnilWAW9ATulH0Ql+6ZZsmjc 3CRbiAWqGQYp18IR/DU3zQyn74xO4KPblGEjRUw35zRwa8GJPBSiPOp/UVF5JHhPJ40q OvWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=FRtyzzpS4p5LzgqqEz3EZxxH8/D6zC20bOKODe0j7BY=; fh=3NmtIWGJb+cXxjrMf0Em8bfuFdChPciHA6kUzk7QSlk=; b=UJR3lcAug0DHAfbQTv6ELG+Rr0eLH1CawBd6puShCN46ATHw6Rcm+yxj6K0VkYI8EE 4EagE/YtsAl+kfCZQOrlvcBFimfxgk8JIQYvuRdcME/LFtV0pLf5PXRbrzHnG/20ULOS A0wjMHTi2ccyerT9+b24MXM9Eu9YIYrQNrVrUFwRTqw+FyX1IIR9KlIvs7LmtLZi5Dy8 auoNliswAz86+h0hfN/o40fvpjHqA1APdbq8rt0rL8uI3dR2B3t5x9yDHvx3HDSZgH3w jvVKU2Wifyi/+RJRc6qUFSJFnmB7zrfpPqBSaNHQB39M3WJ7niNdnswgmWRV2w7anls+ BZEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-210784-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210784-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f7010599a1si57100185ad.287.2024.06.11.18.55.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 18:55:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210784-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-210784-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210784-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2CB01285559 for ; Wed, 12 Jun 2024 01:55:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FE4DBE55; Wed, 12 Jun 2024 01:55:01 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 C0AF5A34; Wed, 12 Jun 2024 01:54:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718157300; cv=none; b=KrlQO8/6L/dBEzyXlJ5/vCvvGW2XmTi3komtKkXR0b2E+chRG+IlSI5BZnp0Ds2snlF2OWNymAVDvJ+tjG2FMuQRQoE/2t77/yAOD5DuismVSG8peygrQ5BXz09mduDei4bP6OQEterMGm8xAZqHKAh1KpGv6YLXS2ZMS+U1A5Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718157300; c=relaxed/simple; bh=r8PY6QEOhPtRFjfjSiFU8lPQ8wJfWgLeOtd1jLIo/JA=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=KxqIvgxmsk0MJ40mI4xgI75LixvmiL/9Sn80yYzvLXhHL7OkcqVoR9LK1uNCU8oT0lzV9yqGf9AW2NbHPURN2sZOrdJZOq6+urXsf8qen6+sHpPxZA5gT9YloDRkJy9aKcJeTcoM2QkVs3rCF9aA3udxC0WhNaHG9wVzHNpWJlk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VzT4y4fKBzmcTP; Wed, 12 Jun 2024 09:50:10 +0800 (CST) Received: from dggpemd100004.china.huawei.com (unknown [7.185.36.20]) by mail.maildlp.com (Postfix) with ESMTPS id E4FD5140EEF; Wed, 12 Jun 2024 09:54:53 +0800 (CST) Received: from [10.67.109.211] (10.67.109.211) by dggpemd100004.china.huawei.com (7.185.36.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Wed, 12 Jun 2024 09:54:53 +0800 Message-ID: Date: Wed, 12 Jun 2024 09:54:53 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH-next v4] arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION Content-Language: en-US To: Geert Uytterhoeven CC: , , , , , , , , , , , , , , Linux-Renesas , Chris Brandt References: <20240316023932.700685-1-liuyuntao12@huawei.com> From: "liuyuntao (F)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemd100004.china.huawei.com (7.185.36.20) That's great, thanks for your testing. On 2024/6/11 20:45, Geert Uytterhoeven wrote: > Hi Yuntao, > > On Sat, Mar 16, 2024 at 3:44 AM 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 >