Chapter 3. MRG Realtime Kernel Tuning
The MRG Realtime kernel offers many performance tuning parameters not otherwise available in Red Hat Enterprise Linux 5.1. In order to achieve optimal low-latency determinism it is necessary to perform MRG Realtime specific system tuning.
A comprehensive Tuning Guide is currently being developed. Until this guide becomes available, please visit the MRG Realtime Wiki Tuning How-To and Section 4.2, “Further Reading”
One of the diagnostic facilities provided with the MRG Realtime kernel is the latency tracer. The latency tracer is a peak detector which is used to identify the longest running non-preemptable kernel codepaths. This is particularly useful for identifying whether non-deterministic performance results are attributable to the kernel or to user space components. In customer deployments, the tool is most useful to differentiate whether delays are in the kernel or the application.
For detailed usage instructions and a case study of the latency tracer visit the MRG Realtime Wiki: Latency Tracer How-To
rmem.ko
MRG Realtime includes a kernel module called rmem.ko. This module is not loaded by default, and is provided only to meet the realtime Java conformance tests - specifically the Technology Compatability Kit (TCK) test in the Real Time Specification for Java's (RTSJ) conformance suite. It is an RTSJ requirement of this conformance test that Java programs have direct access to physical memory. This /dev/rmem capability allows user applications to map any arbitrary memory region.
The capability can only be enabled as a result of direct root system administrator action. To further prevent accidental usage, the capability is disabled unless unprotected_address_spaces=1 is specified as a boot option in the grub.conf file. If the rmem.ko kernel module is explicitly loaded, the kernel will have a tainted flag. In this case, Red Hat Global Support may require you to reproduce any problems without the presence of rmem.ko.
Enabling rmem.ko allows direct memory access to Java applications and also to all other user space programs. Many normal security mechanisms are bypassed and the system becomes much more vulnerable to attacks by malicious users. For this reason, it is strongly suggested that this feature be used exclusively for RTSJ certification purposes only. DO NOT use the rmem.ko module for production deployment.
There is another related boot option for this feature. This boot option reserves contiguous physical kernel memory at boot time for later usage by Java runtime. This memory is allocated at boot prior to the system memory becoming fragmented. The purpose of this is to avoid allocation failures for large contiguous memory. The line that would need to be added to the grub.conf file is the following, where the memsize parameter is expressed in bytes.
alloc_rtsj_mem.size=memsize