kernel |
Distributions |
|||
Novell |
Red Hat |
|||
Family |
Family release |
Family |
Family release |
|
2.6.5 |
SLES (SuSE Linux Enterprise
Server) |
9 |
FC (Fedora Core) |
2 |
2.6.9 |
FC (Fedora Core) |
3 |
||
RHEL (Red Hat Enterprise
Linux) |
4 |
|||
2.6.11 |
(Open) SuSE |
9.3 |
FC (Fedora Core) |
4 |
2.6.16 |
SLES (SuSE Linux Enterprise
Server) |
10 |
EINVAL |
keyword is invalid |
identifier is a NULL pointer, while the
tunable asked for needs an identifier |
|
identifier is an empty string, while the
tunable asked for needs an identifier |
|
outbuf is a NULL pointer |
|
out_sz is a NULL pointer |
|
ENODATA |
The value looked for could not be found |
ESRCH |
identifier points to an invalid pid |
EPERM |
the calling application does not have the
neccessary rights to get the needed tunable value |
ENOENT |
the underlying file does not exist. |
ENOMEM |
if the API failed to allocate memory |
EINVAL |
keyword is invalid |
identifier is a NULL pointer, while the
tunable asked for needs an identifier |
|
identifier is an empty string, while the
tunable asked for needs an identifier |
|
in_buff is a NULL pointer |
|
in_sz has a 0 value |
|
outbuf is a NULL pointer |
|
out_sz is a NULL pointer |
|
keyword is one of TUN_H_OP_MAX, TUN_S_OP_MAX,
TUN_H_CHILD_MAX, TUN_S_CHILD_MAX, TUN_S_STK_MAX, TUN_S_DATA_MAX,
TUN_S_VM_MAX and the input buffer is not a string of digits |
|
ESRCH |
identifier points to an invalid pid |
EPERM |
the calling application does not have the
neccessary rights to set the needed tunable value |
ENOENT |
the underlying file does not exist. |
ENOMEM |
if the API failed to allocate memory |
ERANGE |
keyword is one of TUN_H_OP_MAX, TUN_S_OP_MAX,
TUN_H_CHILD_MAX, TUN_S_CHILD_MAX, TUN_S_STK_MAX, TUN_S_DATA_MAX,
TUN_S_VM_MAX and the input buffer contains a value that is out of range |
EINVAL |
keyword is invalid |
outbuf is a NULL pointer |
|
out_sz is a NULL pointer |
|
ENOMEM |
if the API failed to allocate memory |
EINVAL |
location is a NULL pointer |
keyword points to an invalid value |
|
location is an empty string |
|
keyword is a NULL pointer |
|
ENOMEM |
if the API failed to allocate memory |
EINVAL |
keyword is a NULL pointer |
keyword points to an invalid value |
EINVAL |
keyword is invalid |
help is a NULL pointer |
|
help_sz is a NULL pointer |
|
ENOMEM |
if the API failed to allocate memory |
Constant name |
Tunable meaning |
id parameter in the API
interfaces |
location |
TUN_SHMMIN | Minimum shm segment size (in
bytes) |
N/A |
|
TUN_H_OP_MAX |
Max number of open fds (hard limit) | N/A |
|
TUN_S_OP_MAX | Max number of open fds (soft limit) | N/A |
|
TUN_H_CHILD_MAX | Max number of processes (hard limit) | N/A |
|
TUN_S_CHILD_MAX | Max number of processes (soft limit) | N/A |
|
TUN_S_STK_MAX | stack size (soft limit) | N/A |
|
TUN_S_DATA_MAX | size of data segment (soft limit) | N/A |
|
TUN_S_VM_MAX | size of virtual memory (soft limit) | N/A |
|
TUN_SEMMSL | Max number of semaphores per id | /proc/sys/kernel/sem |
|
TUN_SEMMNS | Max number of semaphores in the system | /proc/sys/kernel/sem | |
TUN_SEMOPM | Max number of operations per semop call | /proc/sys/kernel/sem | |
TUN_SEMMNI | Max number of semaphore identifiers | /proc/sys/kernel/sem | |
TUN_REC_PACKS | Number of receive packets for <interface> | Network interface (string) |
/proc/net/dev |
TUN_MEMSPACE |
Total memory space |
/proc/meminfo | |
TUN_SWAPTOT | Total swap space | /proc/meminfo | |
TUN_SWAPFREE |
Free swap area | /proc/meminfo | |
TUN_HPGTOT | Total number of huge pages | /proc/meminfo | |
TUN_HPGFREE | Number of free huge pages | /proc/meminfo | |
TUN_HPGSZ | Huge page size | /proc/meminfo | |
TUN_CTX_SW | Number of context switches | /proc/stat | |
TUN_CPUPHYSID | Physical id for <cpuid> | CPU id (integer) |
/proc/cpuinfo |
TUN_SIBLINGS | Number of sibling CPUs for CPU <cpuid> | CPU id (integer) |
/proc/cpuinfo |
TUN_SHMMNI | Maximum number of shm segment ids | /proc/sys/kernel/shmmni | |
TUN_SEM | All semaphore parameters | /proc/sys/kernel/sem | |
TUN_CMDLINE | Complete command line for process <pid> | Process id (integer) |
/proc/<PID>/cmdline |
TUN_STAT | Statistics for process <pid> | Process id (integer) |
/proc/<PID>/stat |
TUN_MEMINFO | Memory statistics | /proc/meminfo | |
TUN_SLEEPSTATE | Sleep state | /sys/power/state | |
TUN_CPULIMITS | limits for CPU <cpuid> | CPU id (integer) |
/proc/acpi/processor/CPU<CPUID>/limit |
TUN_FILEMAX | Max number of files |
/proc/sys/fs/file-max | |
TUN_CPUINFO | CPU info | /proc/cpuinfo | |
TUN_FIN_TIMEOUT | Timeout for a FIN packet before the socket is forcibly closed | /proc/sys/net/ipv4/tcp_fin_timeout | |
TUN_MAX_BACKLOG | Maximum # of queued connection requests which have still not received an ACK from the connecting client | /proc/sys/net/ipv4/tcp_max_syn_backlog | |
TUN_TW_REUSE | Allow to reuse TIME-WAIT sockets for new connections | /proc/sys/net/ipv4/tcp_tw_reuse | |
TUN_LOC_P_RANGE | Local port range used by TCP and UDP | /proc/sys/net/ipv4/ip_local_port_range | |
TUN_IPV4_RMEM | Min-default-max memory size of the TCP receive buffers | /proc/sys/net/ipv4/tcp_rmem | |
TUN_IPV4_WMEM | Min-default-max memory size of the TCP send buffers | /proc/sys/net/ipv4/tcp_wmem | |
TUN_WIN_SCALING | Enable TCP to negociate the
use of window scaling during connection set up |
/proc/sys/net/ipv4/tcp_window_scaling | |
TUN_MTU_SIZE | MTU size for <interface> | Network interface (string) |
/proc/sys/net/ipv6/conf/<interface>/mtu |
TUN_PARTITIONS | Disks info | /proc/partitions |
|
TUN_NET_DEV | Network device status info | /proc/net/dev | |
TUN_RMEM_MAX | Max receive buffer size | /proc/sys/net/core/rmem_max | |
TUN_WMEM_MAX | Max send buffer size | /proc/sys/net/core/wmem_max | |
TUN_NET_BACKLOG | Max # of received buffers
processed before congestion |
/proc/sys/net/core/netdev_max_backlog | |
TUN_OVC_MEM | Kernel policy for memory
allocation |
/proc/sys/vm/overcommit_memory | |
TUN_OVC_RATIO | Percentage of memory added
to the swap to get the max address space allowed to be committed |
/proc/sys/vm/overcommit_ratio | |
TUN_SWAPPINESS | Swappiness |
/proc/sys/vm/swappiness | |
TUN_NR_HUGE_PG | Number of configured huge pages | /proc/sys/vm/nr_hugepages | |
TUN_P_STAT | Kernel and system statistics | /proc/stat | |
TUN_SHMALL |
Max # of shm segment pages
system wide |
/proc/sys/kernel/shmall |
|
TUN_SHMMAX |
Max size, in bytes, of a shm
segment |
/proc/sys/kernel/shmmax |
|
TUN_MSGMNI |
Max # of msg queue ids |
/proc/sys/kernel/msgmni |
|
TUN_THREADS_MAX |
Max # of threads |
/proc/sys/kernel/threads-max |
|
TUN_MIN_ADV_MSS |
Min MSS value |
/proc/sys/net/ipv4/route/min_adv_mss |
Constant name |
Tunable meaning |
location |
>= FC4 location |
TUN_EXEC_SHIELD | Security level for the
exec-shield functionality - Red Hat specific |
/proc/sys/kernel/exec-shield | /proc/sys/kernel/exec-shield |
TUN_EXEC_SHIELD_R | Controls whether to
randomize VM mappings - Red Hat specific |
/proc/sys/kernel/exec-shield-randomize | /proc/sys/kernel/randomize_va_space |
Constant name |
Tunable meaning |
id parameter in the API
interfaces |
location |
TUN_MAPPED_BASE | Shared memory address map
for <pid> - SuSE specific |
Process id (integer) |
/proc/<PID>/mapped_base |
# cd scripts
# F=`./get_distro.sh -f`
# R=`./get_distro.sh -r`
# cd ..
# mkdir -p db/include/base-2.6.Z/distro-${F}_${R}
Distro
Distro family
Pseudo ($F)
RedHat
Fedora Core
FC
Red Hat Linux
RH
Red Hat Enterprise Linux
RHEL
SuSE
SuSE Linux
SL
SuSE Linux Enterprise Server
SLES
Name category (see point #2 in the list) |
How to set the
name
attribute |
2.1 |
ATTR_NAME_SYS_WIDE |
2.2.a |
ATTR_NAME_PER_PROC |
2.2.b |
ATTR_NAME_PER_CPU |
2.2.c |
ATTR_NAME_PER_NETINT |
2.2.d |
ATTR_NAME_PER_PCI |
Contents category |
How to set the
content
attribute |
3.a |
Depends on the
tunable |
3.b |
ATTR_CONT_SYS_WIDE |
3.c |
ATTR_CONT_PER_*
(see
include/libtune_priv.h for the possible values) |
3.d |
ATTR_CONT_SYS_WIDE |
3.e |
ATTR_CONT_PER_* (see include/libtune_priv.h for the possible values) |
3.f |
ATTR_CONT_SYS_WIDE |
Contents category |
Index to use |
Get strategy
routine |
Set strategy
routine |
3.a | N/A |
Depends on the
tunable |
Depends on the tunable |
3.b |
2 |
strat_get_subfile_line |
strat_set_subfile_line |
3.c |
3 |
strat_get_subfile_lines |
strat_set_subfile_lines |
3.d |
4 |
strat_get_subfile_block |
strat_set_subfile_block |
3.e |
5 |
strat_get_subfile_blocks | strat_set_subfile_block |
3.f |
6 |
strat_get_file |
strat_set_file |
# cd scriptsThe effect of this command is to create the file db/include/base-2.6.30/libtuninitdb_base.h as described in chapter 5.1.
# ./add_support.sh 2.6.30
#
# cd /var/lib/tundb/binThe effect of this command is to create the following 2 files:
# ./add_kernel.sh 2.6.30
#
# cd scriptsThe effect of this command is to create the file db/include/base-2.6.30/distro-FC_20/libtuninit_distro.h as described in chapter 5.2.
# ./add_distro.sh FC 20
Enter an existing kernel release:
1 ) 2.6.9
2 ) 2.6.17
3 ) 2.6.5
4 ) 2.6.16
5 ) 2.6.11
6 ) 2.6.30
Answer: 6
#../db/include/base-2.6.30/distro-FC_20/libtuninitdb_distro.h has been successfully created
# cd /var/lib/tundbThe effect of this command is to create the following 2 files:
# ./add_distro.sh FC 20
Enter an existing kernel release:
1 ) 2.6.9
2 ) 2.6.17
3 ) 2.6.5
4 ) 2.6.16
5 ) 2.6.11
6 ) 2.6.30
Answer: 6
# /var/lib/tundb/base-2.6.30/distro-FC_20/libtuninitdb_distro.h has been successfully created
/var/lib/tundb/base-2.6.30/distro-FC_20/tundb_distro has been successfully created
# cd /var/lib/tundb/bin
# ./new_tunable.sh BLAH_BLAH_K
*************** DEPENDENCY ***************
Is the tunable
1 ) kernel dependentAnswer: 1
2 ) distro dependent
TUN_BLAH_BLAH_K has been correctly added to /usr/include/libtune.h
Original /usr/include/libtune.h has been saved into /usr/include/libtune.h_ref_24580
# diff /usr/include/libtune.h /usr/include/libtune.h_ref_24580
105a106
> #define TUN_BLAH_BLAH_K 0x00036
107c108
< #define TUN_NEXT_K 0x00036
---
> #define TUN_NEXT_K 0x00037
# ./add_tunable.sh -t BLAH_BLAH_K
TUN_BLAH_BLAH_K goes to kernel DB
Enter an existing kernel release:
1 ) 2.6.9
2 ) 2.6.17
3 ) 2.6.5
4 ) 2.6.16
5 ) 2.6.11
6 ) 2.6.30
Answer: 6
What file do you want to update
1 ) database binary file
2 ) database header file
3 ) both files
Answer: 3
The following files will be updated
/var/lib/tundb/base-2.6.30/libtuninitdb_base.h
/var/lib/tundb/base-2.6.30/tundb_kernel
************* TUNABLE CHARACTERISTICS ***************
*************** STRATEGY ROUTINE ***************
1 ) Get/set a given field in a file made of a single line
2 ) Get/set a given field within a given line in a file made
of several lines
3 ) Get/set a value in a file made of a single block. This block
is made of several lines that contain an identifier and the
actual value.
4 ) Get/set a value in a file made of several blocks. Each block
is identified by a unique identifier, and it is made of
several lines that contain an identifier and the actual value.
5 ) Get/set the entire file contents
6 ) Other (no pseudo-file support)
Answer: 1
Enter the field number within a line to access the tunable
(should start at 0):
1
*************** FILE NAME ATTRIBUTE ***************
1 ) The pathname is a fixed string
2 ) Per process pathname (a pid is needed to build the path)
3 ) Per CPU pathname (a CPU id is needed to build the path)
4 ) Per IRQ pathname (an IRQ number is needed to build the path)
5 ) Per PCI bus pathname (a PCI bus number is needed to build the path)
6 ) Per network pathname (a network interface name is needed to build the path)
7 ) Per user pathname (a uid is needed to build the path)
Answer: 1
*************** LOCATION PATH ***************
Enter the absolute path to the pseudo-file
(printf conversion sequences - %. - are recognized):
/proc/blah_blah_k
************** FILE CONTENTS ATTRIBUTE **************
1 ) System wide setting
2 ) Per process setting
3 ) Per CPU setting
4 ) Per IRQ setting
5 ) Per PCI bus setting
6 ) Per network interface setting
7 ) Per user setting
Answer: 1
*************** HELP STRING ***************
Enter the help string in a single line format
(escape sequences are recognized and not interpreted):
help string for BLAH_BLAH_K
TUN_BLAH_BLAH_K has been correctly added to /var/lib/tundb/base-2.6.30/tundb_kernel
Original /var/lib/tundb/base-2.6.30/tundb_kernel has been saved into /var/lib/tundb/base-2.6.30/tundb_kernel_ref_24666
TUN_BLAH_BLAH_K has been correctly added to /var/lib/tundb/base-2.6.30/libtuninitdb_base.h
Original /var/lib/tundb/base-2.6.30/libtuninitdb_base.h has been saved into /var/lib/tundb/base-2.6.30/libtuninitdb_base.h_ref_24666
# diff /var/lib/tundb/base-2.6.30/libtuninitdb_base.h_ref_24666 \
/var/lib/tundb/base-2.6.30/libtuninitdb_base.h
142a143,146
> {ATTR_NAME_SYS_WIDE|ATTR_CONT_SYS_WIDE, 6,
> "/proc/blah_blah_k",
> "help string for blah_blah_k",
> "TUN_BLAH_BLAH_K"},
#
# ./remove_tunable.sh BLAH_BLAH_K
TUN_BLAH_BLAH_K will be removed from kernel DB
Enter an existing kernel release:
1 ) 2.6.9
2 ) 2.6.17
3 ) 2.6.5
4 ) 2.6.16
5 ) 2.6.11
6 ) 2.6.30
Answer: 6
What file do you want to update
1 ) database binary file
2 ) database header file
3 ) both files
Answer: 3
The following files will be updated
/var/lib/tundb/base-2.6.30/libtuninitdb_base.h
/var/lib/tundb/base-2.6.30/tundb_kernel
TUN_BLAH_BLAH_K has been correctly removed from /var/lib/tundb/base-2.6.30/tundb_kernel
Original /var/lib/tundb/base-2.6.30/tundb_kernel has been saved into /var/lib/tundb/base-2.6.30/tundb_kernel_ref_24845
TUN_BLAH_BLAH_K has been correctly removed from /var/lib/tundb/base-2.6.30/libtuninitdb_base.h
Original /var/lib/tundb/base-2.6.30/libtuninitdb_base.h has been saved into /var/lib/tundb/base-2.6.30/libtuninitdb_base.h_ref_24845
# diff /var/lib/tundb/base-2.6.30/libtuninitdb_base.h_ref_24845 \ /var/lib/tundb/base-2.6.30/libtuninitdb_base.h
143,146c143,144
< {ATTR_NAME_SYS_WIDE|ATTR_CONT_SYS_WIDE, 6,
< "/proc/blah_blah_k",
< "help string for blah_blah_k",
< "TUN_BLAH_BLAH_K"},
---
> {ATTR_NONE, 0, "", "", ""},
#
# cd /var/lib/tundb/bin
# ./get_tunedb -d
TUN_MAPPED_BASE (0xC02)
/proc/%d/mapped_base
Shared memory address map for <pid>