[BusyBox 0000249]: constify patch

bugs at busybox.net bugs at busybox.net
Thu Jan 19 14:53:32 UTC 2006


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=249 
====================================================================== 
Reported By:                AMohr
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   249
Category:                   Other
Reproducibility:            N/A
Severity:                   tweak
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             05-07-2005 15:31 PDT
Last Modified:              01-19-2006 06:53 PST
====================================================================== 
Summary:                    constify patch
Description: 
Hi,

Introduction part:
----------
I'm doing a performance tuning effort all over the place in
frequently-used Linux programs:
I'm trying to mark as many data areas as possible const (and static)
in various programs (at those places where it's actually feasible,
that is).

This should have the following benefits:
a) more .rodata (read-only) pages in programs, which means that
   pages (since they're read-only and can thus be restored from the binary
any
   time) can simply be discarded instead of having to be paged out when
   free memory is getting low
b) more page sharing between program instances due to less
   modified / read-write (and thus unique instance *per-program*!) memory
pages
c) various const compiler optimizations kicking in
d) less linker work to be done (static)

(use "objdump -x" to analyze what can be improved)

In smaller programs marking variables as const won't be enough to get
several whole pages (4K size) back to read-only, but it goes into the
right direction after all, since we don't intend to actually increase
the number of read-write pages...
----------

I marked several busybox variables const, resulting in the following
improvement:

busybox before:
 13 .rodata       0000edc5  0808c080  0808c080  00044080  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 15 .data         0000045c  0809b000  0809b000  00053000  2**5
                  CONTENTS, ALLOC, LOAD, DATA
-rwxr-xr-x  1 root staff 5499979 May  8 00:16 busybox

busybox after:
 13 .rodata       0000ee05  0808c080  0808c080  00044080  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 15 .data         00000428  0809b000  0809b000  00053000  2**5
                  CONTENTS, ALLOC, LOAD, DATA
-rwxr-xr-x  1 root staff 5499943 May  8 00:15 busybox


Thank you,

Andreas Mohr
(patch attached, against current SVN)
====================================================================== 

---------------------------------------------------------------------- 
 bernhardf - 01-19-06 06:53  
---------------------------------------------------------------------- 
The last missing bits of this specific (small) constify patch were added as
rev.13426.

Thank you! 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-07-05 15:31  AMohr          New Issue                                    
05-07-05 15:31  AMohr          File Added: busybox.diff                     
01-19-06 06:53  bernhardf      Status                   assigned => closed  
01-19-06 06:53  bernhardf      Note Added: 0000952                          
======================================================================




More information about the busybox-cvs mailing list