[openwrt/openwrt] bcm53xx: use -falign-functions=32 for kernel compilation

LEDE Commits lede-commits at lists.infradead.org
Fri Jul 8 04:03:22 PDT 2022


rmilecki pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/8b4169f1c9cd5045bb49766c3e3bcb006ee9d986

commit 8b4169f1c9cd5045bb49766c3e3bcb006ee9d986
Author: Rafał Miłecki <rafal at milecki.pl>
AuthorDate: Sun Jul 3 13:22:00 2022 +0200

    bcm53xx: use -falign-functions=32 for kernel compilation
    
    Northstar SoCs have pretty small CPU caches and their performance is
    heavily affected by cache hits & misses. It means that all kind of
    random code changes can affect performance as they often reorganize
    (change alignment & possibly reorder) kernel symbols.
    
    It was discussed in ARM / net mailinglists:
    1. ARM router NAT performance affected by random/unrelated commits [1] [2]
    2. Optimizing kernel compilation / alignments for network performance [3] [4]
    
    It seems that -falign-functions can be used as a partial workaround. It
    doesn't solve all cases (e.g. documented watchdog one [5]) but it surely
    helps with many of them.
    
    A complete long term solution may be PGO (profile-guided optimization)
    but it isn't available at this point.
    
    [1] https://lkml.org/lkml/2019/5/21/349
    [2] https://www.spinics.net/lists/linux-block/msg40624.html
    [3] https://lore.kernel.org/linux-arm-kernel/066fc320-dc04-11a4-476e-b0d11f3b17e6@gmail.com/T/
    [4] https://www.spinics.net/lists/netdev/msg816103.html
    [5] http://lists.openwrt.org/pipermail/openwrt-devel/2022-July/038989.html
    
    Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
    (cherry picked from commit abc5b28db164dc2d807750cb2baae91e288c84a9)
---
 config/Config-devel.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config/Config-devel.in b/config/Config-devel.in
index a068f694e5..87f9157106 100644
--- a/config/Config-devel.in
+++ b/config/Config-devel.in
@@ -76,6 +76,7 @@ menuconfig DEVEL
 
 	config KERNEL_CFLAGS
 		string "Kernel extra CFLAGS" if DEVEL
+		default "-falign-functions=32" if TARGET_bcm53xx
 		default ""
 
 	config EXTERNAL_KERNEL_TREE




More information about the lede-commits mailing list