문제

Reading a server boot sequence of a redhat server 5.8, i saw this and for me is very unclear, maybe i wrong, but i know the linux kernel body allocator uses a power of two mechanism for allocate and dellocate the system memory,

From boot messagges:

 PID hash table entries: 4096 (order: 12, 32768 bytes)
 Console: colour VGA+ 80x25
 Dentry cache hash table entries: 33554432 (order: 16, 268435456 bytes)
 Inode-cache hash table entries: 16777216 (order: 15, 134217728 bytes)

Order in power of two

 python -c 'import math ; print int(math.pow(2,12))*4096'
 16777216
 python -c 'import math ; print int(math.pow(2,16))*4096'
 268435456
 python -c 'import math ; print int(math.pow(2,15))*4096'
 134217728

So, my question is, Why the first line "PID hash table entrie" isn't 16777216 bytes?

도움이 되었습니까?

해결책

PID hash table entries allocated as 2^N struct hlist_heads, which on a 64bit system are 8 bytes each. 2^12*8 = 32768.

Inode/Dentry caches are allocated as 2^N pages, usually 4096 bytes each. 2^15*4096 = 134217728.

This info is available in the source, kernel/pid.c and fs/inode.c respectively.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top