Re: [PATCH 12/20] ACPI: thinkpad-acpi: use bitfields for module flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 21 Apr 2007, Len Brown wrote:
> On Saturday 21 April 2007 10:08, Henrique de Moraes Holschuh wrote:
> > Use a bitfield to hold boolean module-wide flags, to conserve some memory.
> > It is easy and it is clean, so we do it just for the heck of it even if it
> > saves very little space.
> 
> I think that is an under-statement.
> This plus the patch before it actually increase text size
> for a static size change of 0.
> 
> -Len
> 
> before:
>    text    data     bss     dec     hex filename
>   24002    3286     728   28016    6d70 drivers/misc/thinkpad_acpi.o
> 
> after
>    text    data     bss     dec     hex filename
>   24082    3270     664   28016    6d70 drivers/misc/thinkpad_acpi.o

Well, as module, same Debian gcc 4.1.2 pre-release I used before, and
objdump -w -h on the .ko file:

.bss:  decreases from 0x22c to 0x20c
.data: decreases from 0x7a4 to 0x5b4
.init.data: no change
.text: decreases from 0x3658 to 0x3628
.init.text: increases from 0x174a to 0x1763
.rodata*: no change

Same remark as before: maybe I am mistaken on how these things work when the
linking is done at insmod time.

I really did not even consider checking what happens in a static build, it
is quite possible that size increases with these patches.  One of the other
patches really causes an unamusing size increase due to data structure
alignment that I will address later (it is lower priority and would cause
too much rework on patches I did not submit yet).  It happened when some
arrays were broken up to components and arrays of pointers to them.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux