The Kernel Userland Communication (KUC) subsystem is a lustre-specific API for something relatively common (deliver stream of records from kernel to userland, transmit feedback from userland to kernel). We propose to replace it by character devices.
Besides being more standard, it can also increase performance significantly. A process can read large chunks from the character device. Our proof of concept shows a 5~10x speedup for reading changelogs by blocks of 4k.
I would like feedback and suggestions. The proposed implementation works as follows:
- register a misc char device at mdc_setup (eg. /dev/changelog-lustre0-MDT0000). The minor number is associated to the corresponding OBD.
- The .open handler starts a thread in the background, that iterates over the llog and enqueues up to X records into a ring buffer
- The .read dequeues records from the ring buffer. We can make it blocking or not.
- .release stops the background thread and releases resources
- changelog clear is not yet implemented. It can either be a .write or a .unlocked_ioctl handler. Which would be preferable?
The implementation for the copytool has not been done yet but would work in a similar way.