Common Misconfigured HP-UX Resources (April 2006)
Inode Allocation with JFS 4.1 and later
Beginning with JFS 4.1, the inode algorithms change to allocate inodes more efficiently. Rather than
allocating one 4 Kb page which is used to allocate JFS inodes, a larger “chunk” of memory was
used. The inode allocation chunk size is 16Kb. Currently, JFS can carve out 11 inodes out of a 16
Kb chunk.
Inode Chunk
JFS Inode
Free List
Inode 1
Inode 2
Inode 3
Inode 4
Inode 5
Inode 6
16 Kb
Inode 7
Inode 8
Inode 9
Inode 10
Inode 11
unused
So on JFS 4.1 or later, when a new inode is needed and the JFS inode cache can be expanded; JFS
will allocate a chunk of inodes, return one inode to the requestor and place the remaining 10 inodes
on one of the inode free lists. Thus the burden of the inode coalescing is now on JFS instead of the
kernel memory allocator. In order to free a chuck back to the kernel memory allocator, every inode in
the chunk must be free.
Allocating inodes in chunk does have a disadvantage. Note that all inodes in a chunk that are free
must be on the same free list. In order for JFS to free inodes back to the kernel memory allocator,
every inode in the chunk must be free. Also, when trying to find an inode on the free list to re-use, JFS
will look at a given free list first, and if there are no inodes on the free list, it must steal inodes from
another free list. However, unlike earlier version of JFS, since JFS 4.1 allocates inodes in chunks, an
entire chunk of free inodes must be available on another free list in order to steal inodes from another
free list. Thus with JFS 4.1, it is less likely that inodes will be moved from one free list to another.
Thus we need a sufficient number of inodes on each list. Tuning the maximum number of inodes on
each free list will be discussed in the next 2 sections.
Tuning the Maximum Size of the JFS Inode Cache on JFS 3.5 or earlier
Every customer environment is unique. The advantage to a large inode cache is that you do not have
to access the disk every time the inode is needed. If you are doing continuous random lookups on a
directory with 64,000 files in it (such as opening a file or using a stat system call), then having a
large cache is helpful. However, if you are only using a find or ll command occasionally on a set
of 512,000 inodes, then having 128,000 inodes in the cache will not help. You need to understand
how your files are accessed to know whether or not a large inode cache will be helpful. The memory
cost associated with each inode should be taken into account as well.
24