This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Any way to allow tunables to include small headers?


Siddhesh,

Title says it all. I'm seeing some duplication in the default
values for tunables and the defaults used in the structures
used to hold those values. Take for example:

sysdeps/unix/sysv/linux/x86/elision-conf.c

 33 struct elision_config __elision_aconf =
 34   { 
 35     /* How often to not attempt to use elision if a transaction aborted
 36        because the lock is already acquired.  Expressed in number of lock
 37        acquisition attempts.  */
 38     .skip_lock_busy = 3,
 39     /* How often to not attempt to use elision if a transaction aborted due
 40        to reasons other than other threads' memory accesses.  Expressed in
 41        number of lock acquisition attempts.  */
 42     .skip_lock_internal_abort = 3,
 43     /* How often we retry using elision if there is chance for the transaction
 44        to finish execution (e.g., it wasn't aborted due to the lock being
 45        already acquired.  */
 46     .retry_try_xbegin = 3,
 47     /* Same as SKIP_LOCK_INTERNAL_ABORT but for trylock.  */
 48     .skip_trylock_internal_abort = 3,
 49   };

elf/dl-tunables.list:

 97   elision {
 98     enable {
 99       type: INT_32
100       minval: 0
101       maxval: 1
102     }
103     skip_lock_busy {
104       type: INT_32
105       default: 3
106     }
107     skip_lock_internal_abort {
108       type: INT_32
109       default: 3
110     }
111     skip_lock_after_retries {
112       type: INT_32
113       default: 3
114     }
115     tries {
116       type: INT_32
117       default: 3
118     }
119     skip_trylock_internal_abort {
120       type: INT_32
121       default: 3
122     }
123   }

Any ideas to avoid this duplication?

I was thinking a micro-header that defines just the defaults, and we
use it in C code and the tunables list file. That would mean allowing
a include to pass through scripts/gen-tunables.awk and that could set
dangerous precedent :-)

-- 
Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]