JFS Tuning and Performance

15
Concurrent I/O
The main problem addressed by concurrent I/O is VxFS inode lock contention. During a read() system
call, VxFS will acquire the inode lock in shared mode, allowing many processes to read a single file
concurrently without lock contention. However, when a write() system call is made, VxFS will attempt
to acquire the lock in exclusive mode. The exclusive lock allows only one write per file to be in
progress at a time, and also blocks other processes reading the file. These locks on the VxFS inode
can cause serious performance problems when there are one or more file writers and multiple file
readers.
Figure 9. Normal shared read locks and exclusive write locks
In the example above, Process A and Process B both have shared locks on the file when Process C
requests an exclusive lock. Once the request for an exclusive lock is in place, other shared read lock
requests must also block, otherwise the writer may be starved for the lock.
With concurrent I/O, both read() and write() system calls will request a shared lock on the inode,
allowing all read() and write() system calls to take place concurrently. Therefore, concurrent I/O
will eliminate most of the VxFS inode lock contention.