Installing RHEL for Real Time
Adding real time capabalities to RHEL for low latency
Abstract
Providing feedback on Red Hat documentation Copy linkLink copied to clipboard!
We are committed to providing high-quality documentation and value your feedback. To help us improve, you can submit suggestions or report errors through the Red Hat Jira tracking system.
Procedure
Log in to the Jira website.
If you do not have an account, select the option to create one.
- Click Create in the top navigation bar.
- Enter a descriptive title in the Summary field.
- Enter your suggestion for improvement in the Description field. Include links to the relevant parts of the documentation.
- Click Create at the bottom of the window.
Chapter 1. Installing RHEL for real time Copy linkLink copied to clipboard!
Many industries and organizations need performance computing and might require low and predictable latency, especially in the financial and telecommunications industries. Latency, or response time, is defined as the time between an event and system response and is generally measured in microseconds (μs).
For most applications running under a Linux environment, basic performance tuning can improve latency sufficiently. For those industries where latency not only needs to be low, but also accountable and predictable, Red Hat developed a 'drop-in' kernel replacement that provides this. RHEL for Real Time is distributed as part of RHEL 10 and provides seamless integration with RHEL 10 for Real Time offers clients the opportunity to measure, configure, and record latency times within their organization.
Before installing RHEL for Real Time, ensure that the base platform is properly tuned and the system firmware parameters are adjusted. Failure to perform these tasks might prevent getting consistent performance from a RHEL Real Time deployment.
The RHEL for Real Time kernel (kernel-rt) on 64-bit ARM (aarch64) is available as a Technology Preview. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information, see Technology Preview features - Kernel in the RHEL 10.1 Release Notes.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
1.1. RHEL for Real Time for optimizing latency Copy linkLink copied to clipboard!
RHEL for Real Time is designed to be used on well-tuned systems for applications with extremely high determinism requirements. The kernel offers the vast majority of the improvement in determinism.
For example, in many workloads, thorough system tuning improves consistency of results to a optimum percentage. This is why, before using RHEL for Real Time, we recommend that customers first perform system tuning of standard RHEL to see if it meets their objectives.
System tuning is just as important when using the Real Time kernel as it is for the standard kernel. Installing the Real-time kernel on an untuned system is not likely to result in any noticeable benefit. Tuning the standard kernel helps achieving good latency numbers, though not consistently. The Real Time kernel provides the required latency reduction, determinism, and consistency.
Before tuning Real Time kernel systems, ensure that the base platform is properly tuned and the system firmware parameters are adjusted. Failure to perform these tasks might prevent getting consistent performance from a RHEL Real-time deployment.
The objective of the Real-time kernel is to provide consistent, low-latency and determinism, offering predictable response times. The real time kernel requires additional processing resources. To provide the environment for reduced latency and ensure that the highest priority task in the system receives more processing time, extra infrastructure was required which increases resource usage. This increased resource usage might result in some degradation in overall throughput. The exact amount is very workload dependent, ranging from 0% to 30%.
For typical workloads with kernel latency requirements in the millisecond (ms) range, the standard RHEL kernel is sufficient. However,if your workload has stringent low-latency determinism requirements for core kernel features such as interrupt handling and process scheduling in the microsecond (μs) range, then the Real Time kernel is for you.
1.2. Installing RHEL for Real Time using dnf Copy linkLink copied to clipboard!
In addition to installing the real-time kernel with dnf, you can download it along with all other downloadable components of Red Hat Enterprise Linux from the Download Red Hat Enterprise Linux portal. Select the appropriate version from the Version menu.
Prerequisites
- The latest version of RHEL 10 is installed on an AMD64 or Intel64 system. The real-time kernel runs on AMD64 and Intel 64 (also known as x86_64) server platforms that are certified to run Red Hat Enterprise Linux.
- Your machine is registered and RHEL is attached to a RHEL for Real Time subscription.
Ensure that the base platform is properly tuned and the system firmware parameters are adjusted.
WarningFailure to perform the prerequisite tasks before installing the real-time kernel might prevent a consistent performance from a RHEL for Real Time kernel deployment.
Procedure
Enable the RHEL for Real Time repository.
# subscription-manager repos --enable rhel-10-for-x86_64-rt-rpmsNoteIf you are using an Extended Update Support (EUS) subscription, enable the RHEL for Real Time EUS repository instead:
# subscription-manager repos --enable rhel-10-for-x86_64-rt-eus-rpmsFor more information about EUS, see Red Hat Enterprise Linux Life Cycle.
Install the RHEL for Real Time package group.
# dnf groupinstall RTThis group installs several packages:
-
kernel-rtincludes meta-package that carries the list of package dependencies to have a functional kernel-rt installed.. -
kernel-rt-coreincludes the core RHEL for Real Time kernel package. -
kernel-rt-develincludes the proper kernel binary, compiled withPREEMPT_RTenabled, the package also contains configuration and scripts to drive the kernel installation. -
kernel-rt-modules-coreincludes the essential kernel modules required for a functional kernel. kernel-rt-modules provides commonly used kernel modules, a complement to kernel-modules-core. -
kernel-rt-modules-extraincludes the RHEL for Real Time kernel extra modules package. -
realtime-setupsets up the basic environment required by RHEL for Real Time. -
rtevalevaluates system suitability for RHEL for Real Time. -
rteval-loadsprovides source code forrtevalloads. -
tuned-profiles-realtimeincludes the additionalTuneDprofiles targeted to real-time.
-
Optional: Additionally, the
tunapackage contains a tool that helps tune the real-time kernel workload, greatly automating CPU isolation and thread affinity operations from the command line or the GUI. This package is available in the base RHEL 10 repository.# dnf install tunaNoteWhen the RHEL for Real Time kernel is installed, it is automatically set to be the default kernel and is used on the next boot. You can also configure other existing kernels variants, such as,
kernel,kernel-debug, orkernel-rt-debugas the default boot kernel. For more information, see Configuring kernel-rt as the default boot kernel.
Verification
Check the installation location and verify that the components have been installed successfully.
# rpm -ql realtime-setup /etc/security/limits.d/realtime.conf /etc/sysconfig/realtime-setup /etc/udev/rules.d/99-rhel-rt.rules /usr/bin/realtime-setup /usr/bin/rt-setup-kdump /usr/bin/slub_cpu_partial_off /usr/lib/.build-id /usr/lib/.build-id/a4 /usr/lib/.build-id/a4/da77908aa4c6f048939f3267f1c552c456d117 /usr/lib/systemd/system/rt-entsk.service /usr/lib/systemd/system/rt-setup.service /usr/sbin/kernel-is-rt /usr/sbin/rt-entsk
1.3. Available RPM packages in the RHEL for Real Time repository Copy linkLink copied to clipboard!
The RHEL for Real Time repository provides RPM packages including the kernel-rt package, kernel test packages for real-time development and debugging, and debuginfo packages for code tracing.
The repository includes the following packages:
-
kernel-rtpackage, which is the RHEL for Real Time kernel package. - RHEL for Real Time kernel test packages, which contains test programs for the real-time kernel.
- RHEL for Real Time debuginfo packages, which are for debugging and code tracing.
| RPM package name | Description | RT-specific | Required |
|---|---|---|---|
|
| Low latency and preemption functionality | Yes | Yes |
| RPM package name | Description | RT-specific | Required |
|---|---|---|---|
|
| Headers and libraries for kernel development | Yes | No |
|
| RHEL for Real Time kernel with debugging functions compiled in (slow) | Yes | No |
|
| Headers and libraries for development on debug kernel | Yes | No |
|
| Utilities for measuring system latencies and for proving that priority-inheritance mutex functions properly | No | No |
The debuginfo packages are provided to use with the perf, trace-cmd, and crash utilities for analyzing kernel crash dumps. The debuginfo packages include symbol tables and are quite large. For this reason, the debuginfo packages are separately delivered from the other RHEL for Real Time packages. You can download the debugging packages with RHEL-RT as part of the RHEL offer.
| RPM package name | Description | RT-specific | Required |
|---|---|---|---|
|
|
Symbols for profiling and debugging use, such as | Yes | No |
|
| Symbols for profiling and tracing | Yes | No |
1.4. Post installation instructions Copy linkLink copied to clipboard!
After you install the real-time kernel, perform system tuning with the provided tuned profiles, configure kdump for crash dump information, and verify that the Real Time kernel is the default kernel.
After installing the real-time kernel, ensure the following:
- To achieve optimal low-latency determinism, perform RHEL for Real Time specific system tuning by using the provided tuned profiles, either as the final tuning or as the canvas for the specific tuning required for your system.
- Review the module compatibility information for the real-time kernel and the standard kernel.
-
To enable
kdump, configure RHEL for Real Time to provide crash dump information by enablingkexec/kdump. - Verify that the Real Time kernel is the default kernel.
1.4.1. Module compatibility of the real-time kernel and the standard kernel Copy linkLink copied to clipboard!
Kernel modules are inherently specific to the kernel they are built for. The RHEL for real-time and RHEL have a common code base, though RHEL for real-time has the real time features and capabilities enabled. As a consequence, modules need to be rebuilt to be used with RHEL for real-time.
If you must use a third-party module, you must recompile it with the RHEL for Real Time header files, which are available in the RHEL for Real Time development and test packages.
The third-party drivers for the standard Red Hat Enterprise Linux 10 but do not currently have a custom build for RHEL for Real Time are:
- EMC Powerpath
- NVIDIA graphics
- Advanced storage adapter configuration utilities from Qlogic
Userspace tools built for Red Hat Enterprise Linux 10 for the stock kernel are fully compatible with RHEL for real-time. Some applications, due to the way they were designed, might behave in a way that does not favor the real time optimizations one would expect to experiment
Chapter 2. Specifying the RHEL kernel to run Copy linkLink copied to clipboard!
You can boot any installed kernel, standard or Real Time by selecting the required kernel manually in the GRUB menu during booting. You can also configure the kernel to boot by default.
When the RHEL for Real Time kernel is installed, it is automatically set to be the default kernel and is used on the next boot.
2.1. Displaying the default kernel Copy linkLink copied to clipboard!
You can display the kernel configured to boot by default.
Procedure
To view the default kernel:
# grubby --default-kernel /boot/vmlinuz-6.12.0-89.el10_0.x86_64+rtThe
+rtin the output of the command shows that the default kernel is a real time kernel.
2.2. Displaying the running kernel Copy linkLink copied to clipboard!
You can display the currently running kernel to verify which kernel version is active on your system.
Procedure
To show which kernel the system is currently running.
# uname -a Linux rt-server.example.com 6.12.0-89.el10_0.x86_64 …NoteWhen the system receives a minor update, for example, from 8.3 to 8.4, the default kernel might automatically change from the Real Time kernel back to the standard kernel.
2.3. Configuring kernel-rt as the default boot kernel Copy linkLink copied to clipboard!
On a newly installed system, the stock RHEL kernel is set as the default boot kernel. You can change this configuration to set kernel-rt as the default kernel and make this configuration persistent across system updates. This is a one-time procedure that you can change or revert if necessary. You can also configure other kernel variants, such as kernel, kernel-debug, or kernel-rt-debug, as the default boot kernel.
Procedure
To configure
kernel-rtas the default boot kernel, enter the following command:# grubby --set-default=<RT_VMLINUZ>RT_VMLINUZis the name of thevmlinuxfile that is associated with thekernel-rtkernel. For example:# grubby --set-default=/boot/vmlinuz-6.12.0-284.11.1.rt14.296.el0_0_2.x86_64+rtTo configure
kernel-rtas default boot kernel on system updates, enter the following command:# sed -i 's/UPDATEDEFAULT=.*/UPDATEDEFAULT=yes/g' /etc/sysconfig/kernel # sed -i 's/DEFAULTKERNEL=.*/DEFAULTKERNEL=kernel-rt-core/g' /etc/sysconfig/kernelThe
UPDATEDEFAULTvariable when specified asyes, sets the default kernel to change with system updates.In the example output, the path for the default kernel is specific to the
kernel-rt-corepackage installed. You can determine the path to the kernel from a package by using therpm -q kernel-rt-corecommand.Optional: If you need to determine the path to the kernel from a package, first list the installed packages:
# rpm -q kernel-rt-core kernel-rt-core-6.12.0-55.14.1.el10_0.x86_64 kernel-rt-core-6.12.0-55.13.1.el10_0.x86_64 kernel-rt-core-6.12.0-55.12.1.el10_0.x86_64To use the latest installed package as the default, enter the following command to find the path to the boot image from the package:
# rpm -ql kernel-rt-core-6.12.0-55.14.1.el10_0.x86_64 | grep '^/boot/vmlinu' /boot/vmlinuz-6.12.0-55.14.1.el10_0.x86_64+rtTo configure
kernel-rtas the default boot kernel, enter the following command:# grubby --set-default=/boot/vmlinuz-6.12.0-55.14.1.el10_0.x86_64+rt
Verification
To verify
kernel-rtis the default kernel, enter the following command:# grubby --default-kernel /boot/vmlinuz-6.12.0-55.14.1.el10_0.x86_64+rt
Chapter 3. Installing kdump Copy linkLink copied to clipboard!
The kdump service is installed and activated by default on the new versions of RHEL 10 installations.
3.1. What is kdump Copy linkLink copied to clipboard!
kdump provides a crash dumping mechanism that generates a vmcore file for analysis. By using the kexec system call, it boots into a reserved capture kernel without a reboot to save the crashed kernel’s memory to a file.
A kernel crash dump can be the only information available if a system failure occur. Therefore, operational kdump is important in mission-critical environments. You must regularly update and test kexec-tools, kdump-utils, and makedumpfile packages in your normal kernel update cycle. This is important when you install new kernel features.
If you have multiple kernels on a machine, you can enable kdump for all installed kernels or for specified kernels only. When you install kdump, the system creates a default /etc/kdump.conf file. /etc/kdump.conf includes the default minimum kdump configuration, which you can edit to customize the kdump configuration.
3.2. Installing kdump using Anaconda Copy linkLink copied to clipboard!
The Anaconda installer provides a graphical interface screen for kdump configuration during an interactive installation. You can enable kdump and reserve the required amount of memory.
Procedure
-
On the Anaconda installer, click KDUMP and enable
kdump. - In Kdump Memory Reservation, select Manual if you must customize the memory reserve.
-
In KDUMP > Memory To Be Reserved (MB), set the required memory reserve for
kdump.
3.3. Installing kdump on the command line Copy linkLink copied to clipboard!
Custom installation options such as Kickstart installations might not install or enable kdump by default. You can manually install and enable kdump on the command line when needed.
Prerequisites
- An active RHEL subscription.
-
A repository containing the
kexec-toolspackage for your system CPU architecture. -
Fulfilled requirements for
kdumpconfigurations and targets. For details, see Supported kdump configurations and targets.
Procedure
Check if
kdumpis installed on your system:# rpm -q kexec-toolsOutput if the package is installed:
kexec-tools-2.0.29-21.el10.x86_64Output if the package is not installed:
package kexec-tools is not installedInstall
kdumpand other necessary packages:# dnf install kexec-tools
Chapter 4. Configuring kdump on the command line Copy linkLink copied to clipboard!
The memory for kdump is reserved during the system boot. You can configure the memory size in the system’s Grand Unified Bootloader (GRUB) configuration file. The memory size depends on the crashkernel= value specified in the configuration file and the size of the physical memory of system.
4.1. Estimating the kdump size Copy linkLink copied to clipboard!
To plan and build your kdump environment effectively, estimate the space required by the crash dump file.
The makedumpfile --mem-usage command estimates the space required by the crash dump file. It generates a memory usage report. The report helps you decide the dump level and the pages that are safe to exclude.
Procedure
Enter the following command to generate a memory usage report:
# makedumpfile --mem-usage /proc/kcore TYPE PAGES EXCLUDABLE DESCRIPTION ------------------------------------------------------------- ZERO 501635 yes Pages filled with zero CACHE 51657 yes Cache pages CACHE_PRIVATE 5442 yes Cache pages + private USER 16301 yes User process pages FREE 77738211 yes Free pages KERN_DATA 1333192 no Dumpable kernel dataImportantThe
makedumpfile --mem-usagecommand reports required memory in pages. This means that you must calculate the size of memory in use against the kernel page size.
4.2. Configuring kdump memory usage Copy linkLink copied to clipboard!
Configure the memory reservation for kdump. The kdump-utils package provides default crashkernel= values that you can use as a reference when setting memory manually.
The automatic memory allocation for kdump also varies based on the system hardware architecture and available memory size. For example, on AMD64 and Intel 64-bit architectures, the default value for the crashkernel= parameter will work only when the available memory is more than 2 GB. The kdump-utils utility configures the following default memory reserves on AMD64 and Intel 64-bit architecture:
crashkernel=2G-64G:256M,64G-:512M
You can also run kdumpctl estimate to get an approximate value without triggering a crash. The estimated crashkernel= value might not be an exact one but can serve as a reference to set an appropriate crashkernel= value.
The crashkernel=1G-4G:192M,4G-64G:256M,64G:512M option in the boot command line is no longer supported on RHEL 10 and later releases.
The commands to test kdump configuration will cause the kernel to crash with data loss. Follow the instructions with care. You must not use an active production system to test the kdump configuration.
Prerequisites
- You have root permissions on the system.
-
You have fulfilled
kdumprequirements for configurations and targets. For details, see Supported kdump configurations and targets. -
You have installed the
ziplutility if it is the IBM Z system.
Procedure
Configure the default value for crash kernel:
# kdumpctl reset-crashkernel --kernel=ALLWhen configuring the
crashkernel=value, test the configuration by rebooting the system withkdumpenabled. If thekdumpkernel fails to boot, increase the memory size gradually to set an acceptable value.To use a custom
crashkernel=value:Configure the required memory reserve.
crashkernel=192MOptionally, you can set the amount of reserved memory to a variable depending on the total amount of installed memory by using the syntax
crashkernel=<range1>:<size1>,<range2>:<size2>. For example:crashkernel=1G-4G:192M,2G-64G:256MThe example reserves 192 MB of memory if the total amount of system memory is 1 GB or higher and lower than 4 GB. If the total amount of memory is more than 4 GB, 256 MB is reserved for
kdump.Optional: Offset the reserved memory.
Some systems require to reserve memory with a certain fixed offset since
crashkernelreservation is very early, and it wants to reserve some area for special usage. If the offset is set, the reserved memory begins there. To offset the reserved memory, use the following syntax:crashkernel=192M@16MThe example reserves 192 MB of memory starting at 16 MB (physical address 0x01000000). If you offset to 0 or do not specify a value,
kdumpoffsets the reserved memory automatically. You can also offset memory when setting a variable memory reservation by specifying the offset as the last value. For example,crashkernel=1G-4G:192M,2G-64G:256M@16M.Update the boot loader configuration:
# grubby --update-kernel ALL --args "crashkernel=<custom-value>"The
<custom-value>must contain the customcrashkernel=value that you have configured for the crash kernel.
Reboot for changes to take effect:
# reboot
Verification
Cause the kernel to crash by activating the sysrq key. The address-YYYY-MM-DD-HH:MM:SS/vmcore file is saved to the target location as specified in the /etc/kdump.conf file. If you select the default target location, the vmcore file is saved in the partition mounted under /var/crash/.
Activate the
sysrqkey to boot into thekdumpkernel:# echo c > /proc/sysrq-triggerThe command causes kernel to crash and reboots the kernel if required.
Display the
/etc/kdump.conffile and check if thevmcorefile is saved in the target destination.See the
grubby(8)man page on your system for more information.
4.3. Configuring the kdump target Copy linkLink copied to clipboard!
Configure where kdump stores crash dump files. Store dumps locally in the file system or send them over a network by using Network File System (NFS) or Secure Shell (SSH). Only one storage option can be configured at a time. The default behavior stores crash dumps in the /var/crash/ directory of the local file system.
Prerequisites
- You have root permissions on the system.
-
Fulfilled requirements for
kdumpconfigurations and targets. For details, see Supported kdump configurations and targets.
Procedure
To store the crash dump file in
/var/crash/directory of the local file system, edit the/etc/kdump.conffile and specify the path:path /var/crashThe option
path /var/crashrepresents the path to the file system in whichkdumpsaves the crash dump file.Note-
When you specify a dump target in the
/etc/kdump.conffile, then the path is relative to the specified dump target. -
When you do not specify a dump target in the
/etc/kdump.conffile, then the path represents the absolute path from the root directory.
Depending on the file system mounted in the current system, the dump target and the adjusted dump path are configured automatically.
-
When you specify a dump target in the
To secure the crash dump file and the accompanying files produced by
kdump, you should set up proper attributes for the target destination directory, such as user permissions and SELinux contexts. Additionally, you can define a script, for examplekdump_post.shin thekdump.conffile as follows:kdump_post <path_to_kdump_post.sh>The
kdump_postdirective specifies a shell script or a command that executes afterkdumphas completed capturing and saving a crash dump to the specified destination. You can use this mechanism to extend the functionality ofkdumpto perform actions including the adjustments in file permissions.Displaying and understanding the
kdumptarget configuration:Show the effective configuration by filtering out comments and empty lines:
# grep -v '^#' /etc/kdump.conf | grep -v '^$'Example output:
ext4 /dev/mapper/vg00-varcrashvol path /var/crash core_collector makedumpfile -c --message-level 1 -d 31The dump target is specified (
ext4 /dev/mapper/vg00-varcrashvol), and, therefore, it is mounted at/var/crash. Thepathoption is also set to/var/crash. Therefore, thekdumpsaves thevmcorefile in the/var/crash/var/crashdirectory.
To change the local directory for saving the crash dump, edit the
/etc/kdump.confconfiguration file as arootuser:-
Remove the hash sign (
#) from the beginning of the#path /var/crashline. Replace the value with the intended directory path. For example:
path /usr/local/coresImportantIn Red Hat Enterprise Linux 10, the directory defined as the
kdumptarget using thepathdirective must exist when thekdumpsystemd service starts to avoid failures. The directory is no longer created automatically if it does not exist when the service starts.
-
Remove the hash sign (
To write the file to a different partition, edit the
/etc/kdump.confconfiguration file:Remove the hash sign (
#) from the beginning of the#ext4line, depending on your choice.-
device name (the
#ext4 /dev/vg/lv_kdumpline) -
file system label (the
#ext4 LABEL=/bootline) -
UUID (the
#ext4 UUID=03138356-5e61-4ab3-b58e-27507ac41937line)
-
device name (the
Change the file system type and the device name, label or UUID, to the required values. The correct syntax for specifying UUID values is both
UUID="correct-uuid"andUUID=correct-uuid. For example:ext4 UUID=03138356-5e61-4ab3-b58e-27507ac41937ImportantYou must specify storage devices by using a
LABEL=orUUID=. Disk device names such as/dev/sda3are not guaranteed to be consistent across reboot.When you use Direct Access Storage Device (DASD) on IBM Z hardware, ensure the dump devices are correctly specified in
/etc/dasd.confbefore proceeding withkdump.
To write the crash dump directly to a device, edit the
/etc/kdump.confconfiguration file:-
Remove the hash sign (
#) from the beginning of the#raw /dev/vg/lv_kdumpline. Replace the value with the intended device name. For example:
raw /dev/sdb1
-
Remove the hash sign (
To store the crash dump to a remote machine by using the
NFSprotocol:-
Remove the hash sign (
#) from the beginning of the#nfs my.server.com:/export/tmpline. Replace the value with a valid hostname and directory path. For example:
nfs penguin.example.com:/export/coresRestart the
kdumpservice for the changes to take effect:$ sudo systemctl restart kdump.serviceNoteWhile using the NFS directive to specify the NFS target,
kdump.serviceautomatically attempts to mount the NFS target to check the disk space. There is no need to mount the NFS target in advance. To preventkdump.servicefrom mounting the target, use thedracut_args --mountdirective inkdump.conf. This enableskdump.serviceto call thedracututility with the--mountargument to specify the NFS target.
-
Remove the hash sign (
To store the crash dump to a remote machine by using the SSH protocol:
-
Remove the hash sign (
#) from the beginning of the#ssh user@my.server.comline. - Replace the value with a valid username and hostname.
Include your SSH key in the configuration.
-
Remove the hash sign from the beginning of the
#sshkey /root/.ssh/kdump_id_rsaline. Change the value to the location of a key valid on the server you are trying to dump to. For example:
ssh john@penguin.example.com sshkey /root/.ssh/mykey
-
Remove the hash sign from the beginning of the
-
Remove the hash sign (
4.4. Configuring the kdump core collector Copy linkLink copied to clipboard!
To configure the kdump core collector, use the makedumpfile utility. It is the default collector in RHEL and helps reduce crash dump size by compressing data and excluding unnecessary pages.
- Compressing the size of a crash dump file and copying only necessary pages by using various dump levels.
- Excluding unnecessary crash dump pages.
- Filtering the page types to be included in the crash dump.
Crash dump file compression is enabled by default.
If you need to customize the crash dump file compression, follow this procedure.
- Syntax
core_collector makedumpfile -l --message-level 1 -d 31
- Options
-
-c,-lor-p: specify compress dump file format by each page using either,zlibfor-coption,lzofor-loption,snappyfor-poption orzstdfor-zoption. -
-d(dump_level): excludes pages so that they are not copied to the dump file. -
--message-level: specify the message types. You can restrict outputs printed by specifyingmessage_levelwith this option. For example, specifying 7 asmessage_levelprints common messages and error messages. The maximum value ofmessage_levelis 31.
-
Prerequisites
- You have root permissions on the system.
-
Fulfilled requirements for
kdumpconfigurations and targets. For details, see Supported kdump configurations and targets.
Procedure
-
As a
root, edit the/etc/kdump.confconfiguration file and remove the hash sign ("#") from the beginning of the#core_collector makedumpfile -l --message-level 1 -d 31. Enter the following command to enable crash dump file compression:
core_collector makedumpfile -l --message-level 1 -d 31The
-loption sets the compressed file format to LZO. The-doption sets the dump level to 31. The--message-leveloption sets the message level to 1. You can also use the-c,-p, or-zoptions to specify other compression formats.See
makedumpfile(8)man page on your system for more information.
4.5. Configuring the kdump default failure responses Copy linkLink copied to clipboard!
To configure the default failure response for kdump, specify an action other than the default reboot. This determines the system behavior when saving the core dump fails.
The additional actions include the following options:
dump_to_rootfs-
Saves the core dump to the
rootfile system. reboot- Reboots the system, losing the core dump in the process.
halt- Stops the system, losing the core dump in the process.
poweroff- Power the system off, losing the core dump in the process.
shell-
Runs a shell session from within the
initramfs, you can record the core dump manually. final_action-
Enables additional operations such as
reboot,halt, andpoweroffafter a successfulkdumpor when shell ordump_to_rootfsfailure action completes. The default isreboot. failure_action-
Specifies the action to perform when a dump might fail in a kernel crash. The default is
reboot.
Prerequisites
- Root permissions.
-
Fulfilled requirements for
kdumpconfigurations and targets. For details, see Supported kdump configurations and targets.
Procedure
-
As a
rootuser, remove the hash sign (#) from the beginning of the#failure_actionline in the/etc/kdump.confconfiguration file. Replace the value with a required action.
failure_action poweroff
4.6. Configuration file for kdump Copy linkLink copied to clipboard!
The configuration file for kdump kernel is /etc/sysconfig/kdump. This file controls the kdump kernel command line parameters. For most configurations, use the default options.
However, in some scenarios you might need to modify certain parameters to control the kdump kernel behavior. For example, modifying the KDUMP_COMMANDLINE_APPEND option to append the kdump kernel command-line to obtain a detailed debugging output or the KDUMP_COMMANDLINE_REMOVE option to remove arguments from the kdump command line.
KDUMP_COMMANDLINE_REMOVEThis option removes arguments from the current
kdumpcommand line. It removes parameters that can causekdumperrors orkdumpkernel boot failures. These parameters might have been parsed from the previousKDUMP_COMMANDLINEprocess or inherited from the/proc/cmdlinefile.When this variable is not configured, it inherits all values from the
/proc/cmdlinefile. Configuring this option also provides information that is helpful in debugging an issue.To remove certain arguments, add them to
KDUMP_COMMANDLINE_REMOVEas follows:# KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb"KDUMP_COMMANDLINE_APPENDThis option appends arguments to the current command line. These arguments might have been parsed by the previous
KDUMP_COMMANDLINE_REMOVEvariable.For the
kdumpkernel, disabling certain modules such asmce,cgroup,numa,hest_disablecan help prevent kernel errors. These modules can consume a significant part of the kernel memory reserved forkdumpor causekdumpkernel boot failures.To disable memory cgroups on the
kdumpkernel command line, run the command as follows:KDUMP_COMMANDLINE_APPEND="cgroup_disable=memory"See
/etc/sysconfig/kdumpfile for more information.
4.7. Testing the kdump configuration Copy linkLink copied to clipboard!
After configuring kdump, manually test a system crash and ensure that the vmcore file is generated in the defined kdump target. The vmcore file is captured from the context of the freshly booted kernel. Therefore, vmcore has critical information for debugging a kernel crash.
Do not test kdump on active production systems. The commands to test kdump cause the kernel to crash with data loss. Depending on your system architecture, ensure that you schedule significant maintenance time because kdump testing might require several reboots with a long boot time.
If the vmcore file is not generated during the kdump test, identify and fix issues before you run the test again for a successful kdump testing.
If you make any manual system modifications, you must test the kdump configuration at the end of any system modification. For example, if you make any of the following changes, ensure that you test the kdump configuration for an optimal kdump performances for:
- Package upgrades.
- Hardware level changes, for example, storage or networking changes.
- Firmware upgrades.
- New installation and application upgrades that include third party modules.
- If you use the hot-plugging mechanism to add more memory on hardware that support this mechanism.
-
After you make changes in the
/etc/kdump.confor/etc/sysconfig/kdumpfile.
Prerequisites
- You have root permissions on the system.
-
You have saved all important data. The commands to test
kdumpcause the kernel to crash with loss of data. - You have scheduled significant machine maintenance time depending on the system architecture.
Procedure
Enable the
kdumpservice:# kdumpctl restartCheck the status of the
kdumpservice with thekdumpctl:# kdumpctl statuskdump:Kdump is operationalOptionally, if you use the
systemctlcommand, the output prints in the systemd journal.Start a kernel crash to test the
kdumpconfiguration. Thesysrq-triggerkey combination causes the kernel to crash and might reboot the system if required.# echo c > /proc/sysrq-triggerOn a kernel reboot, the
address-YYYY-MM-DD-HH:MM:SS/vmcorefile is created at the location you have specified in the/etc/kdump.conffile. The default is/var/crash/.
4.8. Files produced by kdump after system crash Copy linkLink copied to clipboard!
After your system crashes, the kdump service captures the kernel memory in a dump file (vmcore) and it also generates additional diagnostic files to aid in troubleshooting and postmortem analysis.
Files produced by kdump:
-
vmcore- main kernel memory dump file containing system memory at the time of the crash. It includes data according to the configuration of thecore_collectorprogram specified inkdumpconfiguration. By default the kernel data structures, process information, stack traces, and other diagnostic information. -
vmcore-dmesg.txt- contents of the kernel ring buffer log (dmesg) from the primary kernel that panicked. -
kexec-dmesg.log- has kernel and system log messages from the execution of the secondarykexeckernel that collects thevmcoredata.
4.9. Enabling and disabling the kdump service Copy linkLink copied to clipboard!
You can configure to enable or disable the kdump functionality on a specific kernel or on all installed kernels. You must routinely test the kdump functionality and validate its operates correctly.
Prerequisites
- You have root permissions on the system.
-
You have completed
kdumprequirements for configurations and targets. See Supported kdump configurations and targets. -
All configurations for installing
kdumpare set up as required.
Procedure
Enable the
kdumpservice formulti-user.target:# systemctl enable kdump.serviceStart the service in the current session:
# systemctl start kdump.serviceStop the
kdumpservice:# systemctl stop kdump.serviceDisable the
kdumpservice:# systemctl disable kdump.serviceWarningIt is recommended to set
kptr_restrict=1as default. Whenkptr_restrictis set to (1) as default, thekdumpctlservice loads the crash kernel regardless of whether the Kernel Address Space Layout (KASLR) is enabled.If
kptr_restrictis not set to1and KASLR is enabled, the contents of/proc/korefile are generated as all zeros. Thekdumpctlservice fails to access the/proc/kcorefile and load the crash kernel. Thekexec-kdump-howto.txtfile displays a warning message, which recommends you to setkptr_restrict=1. Verify for the following in thesysctl.conffile to ensure thatkdumpctlservice loads the crash kernel:-
The kernel
kptr_restrict=1setting in thesysctl.conffile.
-
The kernel
4.10. Preventing kernel drivers from loading for kdump Copy linkLink copied to clipboard!
To prevent specific kernel drivers from loading in the capture kernel, use the KDUMP_COMMANDLINE_APPEND= variable in /etc/sysconfig/kdump. This stops the kdump initramfs from loading modules, helping to avoid out-of-memory (OOM) errors and other crash kernel failures.
You can append the KDUMP_COMMANDLINE_APPEND= variable by using one of the following configuration options:
-
rd.driver.blacklist=<modules> -
modprobe.blacklist=<modules>
Prerequisites
- You have root permissions on the system.
Procedure
Display the list of modules that are loaded to the currently running kernel. Select the kernel module that you intend to block from loading:
$ lsmodModule Size Used by fuse 126976 3 xt_CHECKSUM 16384 1 ipt_MASQUERADE 16384 1 uinput 20480 1 xt_conntrack 16384 1Update the
KDUMP_COMMANDLINE_APPEND=variable in the/etc/sysconfig/kdumpfile. For example:KDUMP_COMMANDLINE_APPEND="rd.driver.blacklist=hv_vmbus,hv_storvsc,hv_utils,hv_netvsc,hid-hyperv"Also, consider the following example by using the
modprobe.blacklist=<modules>configuration option:KDUMP_COMMANDLINE_APPEND="modprobe.blacklist=emcp modprobe.blacklist=bnx2fc modprobe.blacklist=libfcoe modprobe.blacklist=fcoe"Restart the
kdumpservice:# systemctl restart kdumpSee the
dracut.cmdlineman page on your system for more information.
4.11. Running kdump on systems with encrypted disk Copy linkLink copied to clipboard!
When you run a LUKS encrypted partition, systems require certain amount of available memory. If the system has less than the required amount of available memory, the cryptsetup utility fails to mount the partition. As a result, capturing the vmcore file to an encrypted target location fails in the second kernel (capture kernel).
The kdumpctl estimate command helps you estimate the amount of memory you need for kdump. kdumpctl estimate prints the recommended crashkernel value, which is the most suitable memory size required for kdump.
The recommended crashkernel value is calculated based on the current kernel size, kernel module, initramfs, and the LUKS encrypted target memory requirement.
If you are using the custom crashkernel= option, kdumpctl estimate prints the LUKS required size value. The value is the memory size required for LUKS encrypted target.
Procedure
Print the estimate
crashkernel=value:# *kdumpctl estimate* Encrypted kdump target requires extra memory, assuming using the keyslot with minimum memory requirement Reserved crashkernel: 256M Recommended crashkernel: 652M Kernel image size: 47M Kernel modules size: 8M Initramfs size: 20M Runtime reservation: 64M LUKS required size: 512M Large modules: <none> WARNING: Current crashkernel size is lower than recommended size 652M.-
Configure the amount of required memory by increasing the
crashkernel=value. Reboot the system.
NoteIf the
kdumpservice still fails to save the dump file to the encrypted target, increase thecrashkernel=value as required.
Chapter 5. Enabling kdump Copy linkLink copied to clipboard!
For your RHEL 10 systems, you can configure enabling or disabling the kdump functionality on a specific kernel or on all installed kernels. However, you must routinely test the kdump functionality and validate its working status.
5.1. Enabling kdump for all installed kernels Copy linkLink copied to clipboard!
To enable the kdump service for all kernels installed on the machine, enable kdump.service after the kdump-utils package is installed.
Prerequisites
- You have root permissions on the system.
Procedure
Add the
crashkernel=command-line parameter to all installed kernels:# grubby --update-kernel=ALL --args="crashkernel=xxM"xxMis the required memory in megabytes.-
In terms of UKI, add the
crashkernel=command-line parameter to all installed UKIs by copying an add-on associated with the required argument from/lib/modules/$(uname -r)/vmlinuz-virt.efi.extra.d/to/boot/efi/loader/addons/. Reboot the system:
# rebootEnable the
kdumpservice:# systemctl enable --now kdump.service
Verification
Check that the
kdumpservice is running:# systemctl status kdump.servicekdump.service - Crash recovery kernel arming Loaded: loaded (/usr/lib/systemd/system/kdump.service; enabled; vendor preset: disabled) Active: active (live)
5.2. Enabling kdump for a specific installed kernel Copy linkLink copied to clipboard!
To enable the kdump service for a specific installed kernel, configure the crashkernel parameter in GRUB for the selected kernel and enable the service to capture crash dumps.
Prerequisites
- You have root permissions on the system.
Procedure
List the kernels installed on the machine:
# ls -a /boot/vmlinuz-*/boot/vmlinuz-0-rescue-2930657cd0dc43c2b75db480e5e5b4a9 /boot/vmlinuz-6.12.0-55.9.1.el10_0.x86_64 /boot/vmlinuz-6.12.0-55.9.1.el10_0.x86_64Add a specific
kdumpkernel to the system’s Grand Unified Boot Loader (GRUB) configuration:For example:
# grubby --update-kernel=vmlinuz-6.12.0-55.9.1.el10_0.x86_64 --args="crashkernel=xxM"xxMis the required memory reserve in megabytes.-
In terms of UKI, add the
crashkernel=command-line parameter to a specific UKI by copying an add-on associated with the required argument from/lib/modules/$(uname -r)/vmlinuz-virt.efi.extra.d/to/boot/efi/EFI/Linux/<machine-id>-<kernel-version>.efi.extra.d/. Enable the
kdumpservice:# systemctl enable --now kdump.service
Verification
Check that the
kdumpservice is running:# systemctl status kdump.servicekdump.service - Crash recovery kernel arming Loaded: loaded (/usr/lib/systemd/system/kdump.service; enabled; vendor preset: disabled) Active: active (live)
5.3. Disabling the kdump service Copy linkLink copied to clipboard!
You can stop the kdump.service and disable the service from starting on your RHEL 10 systems.
Prerequisites
-
Fulfilled requirements for
kdumpconfigurations and targets. For details, see Supported kdump configurations and targets.
Procedure
To stop the
kdumpservice in the current session:# systemctl stop kdump.serviceTo disable the
kdumpservice:# systemctl disable kdump.serviceWarningIt is recommended to set
kptr_restrict=1as default. Whenkptr_restrictis set to (1) as default, thekdumpctlservice loads the crash kernel regardless of whether the Kernel Address Space Layout (KASLR) is enabled.If
kptr_restrictis not set to1andKASLRis enabled, the contents of/proc/korefile are generated as all zeros. Thekdumpctlservice fails to access the/proc/kcorefile and load the crash kernel. Thekexec-kdump-howto.txtfile displays a warning message, which recommends you to setkptr_restrict=1. Verify for the following in thesysctl.conffile to ensure thatkdumpctlservice loads the crash kernel:-
The kernel
kptr_restrict=1setting in thesysctl.conffile.
-
The kernel
Chapter 6. Diagnosing RHEL for Real Time bugs Copy linkLink copied to clipboard!
Identifying which kernel, the RHEL for Real Time or the standard kernel, is the source of the problem can increase the chances of having your bug fixed faster. By following the procedure steps, you can diagnose the source of the problem before submitting a bug report.
Prerequisites
- The latest version of RHEL for Real Time kernel is installed.
Procedure
- Verify that you have the latest version of the RHEL for Real Time kernel.
-
Boot into RHEL for Real Time kernel using the
GRUBmenu. - If the problem occurs, report a bug against RHEL for Real Time.
Try to reproduce the problem with the standard kernel.
This troubleshooting step assists in identifying the problem location.
NoteIf the problem does not occur with the standard kernel, then the bug is probably the result of changes introduced in the RHEL for Real Time specific enhancements, which Red Hat has applied on top of the baseline (5.14.0) kernel.