Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #73852

Bug#998716: linux-image-5.14.0-2-amd64: The package size has grown a lot compared to 5.8/5.10 releases

From Ben Hutchings <ben@decadent.org.uk>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#998716: linux-image-5.14.0-2-amd64: The package size has grown a lot compared to 5.8/5.10 releases
Date 2021-11-30 01:30 +0100
Message-ID <DoZbX-7oy-1@gated-at.bofh.it> (permalink)
References <DgFDr-5D0-1@gated-at.bofh.it> <DgFDr-5D0-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sun, 07 Nov 2021 03:52:13 +0200 Bohdan Horbeshko
<bodqhrohro@gmail.com> wrote:
> Package: linux-image-5.14.0-2-amd64
> Severity: minor
> 
> Dear Maintainer,
> 
> the Installed-Size of the package has occasionally grown up to 375 MB,
> which is about 30% larger than several minor releases before. A kindful
> anonymous person has collected some more information here:
> https://www.linux.org.ru/forum/general/16628666?cid=16628797 , and found
> out that virtually every module has been grown in size. So this is
> likely related to compilation options, rather than to some added modules
> as I suspected before.
> 
> Please investigate the actual reason and report if this can/would be
> fixed in further packages, thanks.
[...]

The linked thread mentioned floppy.ko as an exmaple. Comparing the
versions I have installed here:

~$ ls -l /lib/modules/*/kernel/drivers/block/floppy.ko
-rw-r--r-- 1 root root 182555 Aug  3 07:50 /lib/modules/5.10.0-8-amd64/kernel/drivers/block/floppy.ko
-rw-r--r-- 1 root root 196947 Nov 26 06:33 /lib/modules/5.15.0-2-amd64/kernel/drivers/block/floppy.ko

there's about a 14 KiB increase from 5.10 to 5.15.

The code and static data sizes are roughly the same, actually slightly
smaller:

~$ size /lib/modules/*/kernel/drivers/block/floppy.ko
   text	   data	    bss	    dec	    hex	filename
  64213	   4893	  14660	  83766	  14736	/lib/modules/5.10.0-8-amd64/kernel/drivers/block/floppy.ko
  63619	   4836	  16516	  84971	  14beb	/lib/modules/5.15.0-2-amd64/kernel/drivers/block/floppy.ko

The bss can be ignored as it doesn't take up disk space.

Listing the sections with "objdump -h", I see a new section in 5.15:

Idx Name          Size      VMA               LMA               File off  Algn
[...]
 26 .BTF          00002b58  0000000000000000  0000000000000000  00010c40  2**0
                  CONTENTS, READONLY

That's a size of about 11 KiB, so most of the increase.

After that I compared *all* the modules installed by these versions:

~$ du --bytes --summ /lib/modules/5.10.0-8-amd64/kernel
294650546 /lib/modules/5.10.0-8-amd64/kernel
~$ du --bytes --summ /lib/modules/5.15.0-2-amd64/kernel
371262312 /lib/modules/5.15.0-2-amd64/kernel

About a 73 MiB increase.

I calculated the total size of .BTF sections:

$ find /lib/modules/5.15.0-2-amd64/ -name '*.ko' | xargs objdump -h -j .BTF | awk 'BEGIN { total = 0 } $2 == ".BTF" { total = total + strtonum("0x" $3) } END { print total }'
objdump: Warning: Separate debug info file /usr/lib/modules/5.15.0-2-amd64/kernel/sound/usb/usx2y/snd-usb-us122l.ko found, but CRC does not match - ignoring
objdump: Warning: Separate debug info file /usr/lib/modules/5.15.0-2-amd64/kernel/drivers/leds/leds-gpio.ko found, but CRC does not match - ignoring
objdump: Warning: Separate debug info file /usr/lib/modules/5.15.0-2-amd64/kernel/fs/nls/nls_cp862.ko found, but CRC does not match - ignoring
61693267

About 59 MiB, so again most of the increase.

It appears that BTF in modules was enabled in Linux 5.11 by
<https://git.kernel.org/linus/5f9ae91f7c0dbbc4195e2a6c8eedcaeb5b9e4cbb>

I also compared the total sizes of code and static data:

$ find /lib/modules/5.10.0-8-amd64/ -name '*.ko' | xargs objdump -h  | awk 'BEGIN { total = 0 } $2 ~ /^\..*(text|data)/ { total = total + strtonum("0x" $3) } END { print total }'
objdump: Warning: Separate debug info file /usr/lib/modules/5.10.0-8-amd64/kernel/sound/usb/usx2y/snd-usb-us122l.ko found, but CRC does not match - ignoring
objdump: Warning: Separate debug info file /usr/lib/modules/5.10.0-8-amd64/kernel/drivers/hid/hid-macally.ko found, but CRC does not match - ignoring
objdump: Warning: Separate debug info file /usr/lib/modules/5.10.0-8-amd64/kernel/fs/fat/vfat.ko found, but CRC does not match - ignoring
88844481
$ find /lib/modules/5.15.0-2-amd64/ -name '*.ko' | xargs objdump -h  | awk 'BEGIN { total = 0 } $2 ~ /^\..*(text|data)/ { total = total + strtonum("0x" $3) } END { print total }'
objdump: Warning: Separate debug info file /usr/lib/modules/5.15.0-2-amd64/kernel/sound/usb/usx2y/snd-usb-us122l.ko found, but CRC does not match - ignoring
objdump: Warning: Separate debug info file /usr/lib/modules/5.15.0-2-amd64/kernel/drivers/leds/trigger/ledtrig-default-on.ko found, but CRC does not match - ignoring
objdump: Warning: Separate debug info file /usr/lib/modules/5.15.0-2-amd64/kernel/fs/nls/mac-roman.ko found, but CRC does not match - ignoring
93202503

About 4 MiB increase. This is probably a combination of changes in code
generation between gcc 10 and 11, increases in complexity of existing
code modules, and a few new drivers and features being enabled. Without
doing some full rebuilds it's not possible to separate these.

That leaves about 10 MiB of the increase in installed module size not
yet explained.

Ben.

-- 
Ben Hutchings
This sentence contradicts itself - no actually it doesn't.

Back to linux.debian.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#998716: linux-image-5.14.0-2-amd64: The package size has grown a lot compared to 5.8/5.10 releases Bohdan Horbeshko <bodqhrohro@gmail.com> - 2021-11-07 03:00 +0100
  Bug#998716: marked as done (linux-image-5.14.0-2-amd64: The  package size has grown a lot compared to 5.8/5.10 releases) "Debian Bug Tracking System" <owner@bugs.debian.org> - 2021-11-12 23:30 +0100
  Processed: Re: Bug#998716 closed by Salvatore Bonaccorso  <carnil@debian.org> (Re: Bug#998716: linux-image-5.14.0-2-amd64: The  package size has grown a lot compared to 5.8/5.10 releases) "Debian Bug Tracking System" <owner@bugs.debian.org> - 2021-11-13 09:20 +0100
  Bug#998716: closed by Salvatore Bonaccorso <carnil@debian.org> (Re: Bug#998716: linux-image-5.14.0-2-amd64: The package size has grown a lot compared to 5.8/5.10 releases) Salvatore Bonaccorso <carnil@debian.org> - 2021-11-13 09:20 +0100
  Bug#998716: linux-image-5.14.0-2-amd64: The package size has grown a lot compared to 5.8/5.10 releases Ben Hutchings <ben@decadent.org.uk> - 2021-11-30 01:30 +0100
    Bug#998716: linux-image-5.14.0-2-amd64: The package size has grown a lot compared to 5.8/5.10 releases Горбешко Богдан  <bodqhrohro@gmail.com> - 2021-11-30 04:30 +0100
      Bug#998716: linux-image-5.14.0-2-amd64: The package size has grown a lot compared to 5.8/5.10 releases Ben Hutchings <ben@decadent.org.uk> - 2021-11-30 13:40 +0100
    Bug#998716: linux-image-5.14.0-2-amd64: The package size has grown a lot compared to 5.8/5.10 releases Fabian Grünbichler <f.gruenbichler@proxmox.com> - 2021-11-30 11:20 +0100
      Bug#998716: linux-image-5.14.0-2-amd64: The package size has grown a lot compared to 5.8/5.10 releases Ben Hutchings <ben@decadent.org.uk> - 2021-11-30 20:30 +0100
        Bug#998716: linux-image-5.14.0-2-amd64: The package size has grown a lot compared to 5.8/5.10 releases Fabian Grünbichler <fabian.gruenbichler@student.tuwien.ac.at> - 2021-12-26 17:50 +0100

csiph-web