Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
2.  Solaris Kernel Tunables General File System rstchown  Previous   Contents   Next 
   
 

segkpsize

Description

Specify the amount of kernel pageable memory available. This memory is used primarily for kernel thread stacks. Increasing this number allows either larger stacks for the same number of threads or more threads. This parameter can only be set on systems running 64-bit kernels. Systems running 64-bit kernels use a default stack size of 24 Kbytes.

Data Type

Unsigned long

Default

64-bit kernels, 2 Gbytes

32-bit kernels, 512 Mbytes

Range

64-bit kernels, 512 Mbytes - 24 Gbytes

32-bit kernels, 512 Mbytes

Units

Mbytes

Dynamic?

No

Validation

Value is compared to minimum and maximum sizes (512 Mbytes and 24 Gbytes for 64-bit systems) and if smaller than the minimum or larger than the maximum, it is reset to 2 Gbytes and a message to that effect is displayed.

The actual size used in creation of the cache is the lesser of the value specified in segkpsize after the constraints checking and 50% of physical memory.

When to Change

This is one of the steps necessary to support large numbers of processes on a system. The default size of 2 Gbytes, assuming at least 1 Gbyte of physical memory is present, allows creation of 24-Kbyte stacks for more than 87,000 kernel threads. The size of a stack in a 64-bit kernel is the same whether the process is a 32-bit process or a 64-bit process. If more than this number is needed, segkpsize can be increased assuming sufficient physical memory exists.

Commitment Level

Unstable

Change History

For information, see "segkpsize (Pre-Solaris 7 and the Solaris 7 Release)".

dnlc_dir_enable

Description

Enables large directory caching.

Data Type

Unsigned integer

Default

1 (enabled)

Range

0 (disabled), 1 (enabled)

Dynamic?

Yes, but do not change this tunable dynamically. It is possible to enable it if originally disabled, or to disable it if originally enabled. However, enabling, disabling, and then enabling this parameter might lead to stale directory caches.

Validation

No

When to Change

Directory caching has no known problems, but if problems occur, then set dnlc_dir_enable to 0 to disable caching.

Commitment Level

Unstable

dnlc_dir_min_size

Description

Minimum number of entries before caching for one directory.

Data Type

Unsigned integer

Default

40

Range

0 to MAXUINT (no maximum)

Units

Dynamic?

Yes, it can be changed at any time.

Validation

No

When to Change

If performance problems occur with caching small directories, then increase dnlc_dir_min_size. Note that individual file systems might have their own range limits for caching directories. For instance, UFS limits directories to a minimum of ufs_min_dir_cache bytes (approximately 1024 entries), assuming 16 bytes per entry.

Commitment Level

Unstable

dnlc_dir_max_size

Description

Maximum number of entries cached for one directory.

Data Type

Unsigned integer

Default

MAXUINT (no maximum)

Range

0 to MAXUINT

Dynamic?

Yes, it can be changed at any time.

Validation

No

When to Change

If performance problems occur with large directories, then decrease dnlc_dir_max_size.

Commitment Level

Unstable

UFS

bufhwm

Description

Maximum amount of memory for caching I/O buffers. The buffers are used for writing file system metadata (superblocks, inodes, indirect blocks, and directories). Buffers are allocated as needed until the amount to be allocated would exceed bufhwm. At this point, enough buffers are reclaimed to satisfy the request.

For historical reasons, this parameter does not require the ufs: prefix.

Data Type

Signed integer

Default

2% of physical memory

Range

80 Kbytes to 20% of physical memory

Units

Kbytes

Dynamic?

No. Value is used to compute hash bucket sizes and is then stored into a data structure that adjusts the value in the field as buffers are allocated and deallocated. Attempting to adjust this value without following the locking protocol on a running system can lead to incorrect operation.

Validation

If bufhwm is less than 80 Kbytes or greater than the lesser of 20% of physical memory or twice the current amount of kernel heap, it is reset to the lesser of 20% of physical memory or twice the current amount of kernel heap. The following message appears on the system console and in the /var/adm/messages file.

"binit: bufhwm out of range (value attempted). Using N."

Value attempted refers to the value entered in /etc/system or by using the kadb -d command. N is the value computed by the system based on available system memory.

When to Change

Since buffers are only allocated as they are needed, the overhead from the default setting is the allocation of a number of control structures to handle the maximum possible number of buffers. These structures consume 52 bytes per potential buffer on a 32-bit kernel and 104 bytes per potential buffer on a 64-bit kernel. On a 512 Mbyte 64-bit kernel this consumes 104*10144 bytes, or 1 Mbyte. The header allocations assumes buffers are 1 Kbyte in size, although in most cases, the buffer size is larger.

The amount of memory, which has not been allocated in the buffer pool, can be found by looking at the bfreelist structure in the kernel with a kernel debugger. The field of interest in the structure is bufsize, which is the possible remaining memory in bytes. Looking at it with the buf macro by using mdb:

# mdb -k
Loading modules: [ unix krtld genunix ip nfs ipc ]
> bfreelist$<buf
bfreelist:
[ elided ]
bfreelist + 0x78:	bufsize			[ elided ]
				 	      75734016

bufhwm on this system, with 6 Gbytes of memory, is 122277. It is not directly possible to determine the number of header structures used since the actual buffer size requested is usually larger than 1 Kbyte. However, some space might be profitably reclaimed from control structure allocation for this system.

The same structure on the 512 Mbyte system shows that only 4 Kbytes of 10144 Kbytes has not been allocated. When the biostats kstat is examined with kstat -n biostats, it is seen that the system had a reasonable ratio of buffer_cache_hits to buffer_cache_lookups as well. This indicates that the default setting is reasonable for that system.

Commitment Level

Unstable

 
 
 
  Previous   Contents   Next