Re: How To Check Your Governor And I O Scheduler From The Command line

0 views
Skip to first unread message
Message has been deleted

Sofia Gilcrease

unread,
Jul 8, 2024, 10:02:14 PM7/8/24
to ndolunethba

Contents

    A guide to the Kernel Development ProcessSubmitting patches: the essential guide to getting your code into the kernelCode of conductKernel Maintainer HandbookAll development-process docs
    Core API DocumentationDriver implementer's API guideKernel subsystem documentationLocking in the kernel
    Linux kernel licensing rulesHow to write kernel documentationDevelopment tools for the kernelKernel Testing GuideKernel Hacking GuidesLinux Tracing Technologiesfault-injectionKernel LivepatchingRust
The Linux kernel user's and administrator's guideLinux kernel release 6.x The kernel's command-line parametersLinux allocated devices (4.x+ version)Documentation for /proc/sysLinux ABI descriptionFeature status on all architecturesHardware vulnerabilitiesReporting issuesReporting regressionsHow to quickly build a trimmed Linux kernelBug huntingBisecting a bugTainted kernelsRamoops oops/panic loggerDynamic debugExplaining the "No working init found." boot hang messageDocumentation for Kdump - The kexec-based Crash Dumping SolutionPerformance monitor supportpstore block oops/panic loggerRules on how to access information in sysfsDiscovering Linux kernel subsystems used by a workloadACPI SupportATA over Ethernet (AoE)Auxiliary Display SupportA block layer cache (bcache)The Android binderfs FilesystemKernel Support for miscellaneous Binary Formats (binfmt_misc)Block DevicesBoot ConfigurationLinux Braille Consolebtmrvl driverControl Groups version 1Control Group v2CIFSClearing WARN_ONCECPU loadHow CPU topology info is exported via sysfsDell Remote BIOS Update driver (dell_rbu)Device MapperEDIDThe EFI Boot Stubext4 General InformationFile system Monitoring with fanotifyNFSgpioNotes on the change from 16-bit UIDs to 32-bit UIDsHardware random number generatorsUsing the initial RAM disk (initrd)I/O statistics fieldsJava(tm) Binary Kernel Support for Linux v1.03IBM's Journaled File System (JFS) for LinuxReducing OS jitter due to per-cpu kthreadsLaptop DriversParallel port LCD/Keypad Panel supportLDM - Logical Disk Manager (Dynamic Disks)Softlockup detector and hardlockup detector (aka nmi_watchdog)Linux Security Module UsageRAID arraysMedia subsystem admin and user guideMemory ManagementKernel module signing facilityMono(tm) Binary Kernel Support for LinuxNamespacesNuma policy hit/miss statisticsParportPerf events and tool securityPower ManagementPower Management StrategiesSystem-Wide Power ManagementWorking-State Power ManagementLinux Plug and Play DocumentationRapidIO Subsystem GuideReliability, Availability and ServiceabilityReal Time Clock (RTC) Drivers for LinuxLinux Serial ConsoleVideo Mode Selection Support 2.13Syscall User DispatchLinux Magic System Request Key HacksThermal SubsystemUSB4 and ThunderboltUsing UFSUnicode supportSoftware cursor for VGAVideo Output Switcher ControlThe SGI XFS FilesystemThe kernel build systemReporting issuesUser-space toolsThe Linux kernel user-space API guide
    The Linux kernel firmware guideOpen Firmware and Devicetree
    CPU Architectures
    Unsorted Documentation
    Translations
This Page
  • Show Source
CPU Idle Time ManagementCopyright 2018 Intel Corporation

There are four CPUIdle governors available, menu, TEO,ladder and haltpoll. Which of them is used by default depends on theconfiguration of the kernel and in particular on whether or not the schedulertick can be stopped by the idle loop. Availablegovernors can be read from the available_governors, and the governorcan be changed at runtime. The name of the CPUIdle governor currentlyused by the kernel can be read from the current_governor_ro orcurrent_governor file under /sys/devices/system/cpu/cpuidle/in sysfs.

How to check your governor and I O scheduler from the command line


Download File https://urlcod.com/2yW9F7



The kernel can be configured to disable stopping the scheduler tick in the idleloop altogether. That can be done through the build-time configuration of it(by unsetting the CONFIG_NO_HZ_IDLE configuration option) or by passingnohz=off to it in the command line. In both cases, as the stopping of thescheduler tick is disabled, the governor's decisions regarding it are simplyignored by the idle loop code and the tick is never stopped.

The cpuidle.off=1 kernel command line option can be used to disable theCPU idle time management entirely. It does not prevent the idle loop fromrunning on idle CPUs, but it prevents the CPU idle time governors and driversfrom being invoked. If it is added to the kernel command line, the idle loopwill ask the hardware to enter idle states on idle CPUs via the CPU architecturesupport code that is expected to provide a default mechanism for this purpose.That default mechanism usually is the least common denominator for all of theprocessors implementing the architecture (i.e. CPU instruction set) in question,however, so it is rather crude and not very energy-efficient. For this reason,it is not recommended for production use.

The cpuidle.governor= kernel command line switch allows the CPUIdlegovernor to use to be specified. It has to be appended with a string matchingthe name of an available governor (e.g. cpuidle.governor=menu) and thatgovernor will be used instead of the default one. It is possible to forcethe menu governor to be used on the systems that use the ladder governorby default this way, for example.

The x86 architecture support code recognizes three kernel command lineoptions related to CPU idle time management: idle=poll, idle=halt,and idle=nomwait. The first two of them disable the acpi_idle andintel_idle drivers altogether, which effectively causes the entireCPUIdle subsystem to be disabled and makes the idle loop invoke thearchitecture support code to deal with idle CPUs. How it does that depends onwhich of the two parameters is added to the kernel command line. In theidle=halt case, the architecture support code will use the HLTinstruction of the CPUs (which, as a rule, suspends the execution of the programand causes the hardware to attempt to enter the shallowest available idle state)for this purpose, and if idle=poll is used, idle CPUs will execute amore or less "lightweight" sequence of instructions in a tight loop. [Notethat using idle=poll is somewhat drastic in many cases, as preventing idleCPUs from saving almost any energy at all may not be the only effect of it.For example, on Intel hardware it effectively prevents CPUs from usingP-states (see CPU Performance Scaling) that require any number of CPUs in a package to beidle, so it very well may hurt single-thread computations performance as well asenergy-efficiency. Thus using it for performance reasons may not be a good ideaat all.]

In addition to the architecture-level kernel command line options affecting CPUidle time management, there are parameters affecting individual CPUIdledrivers that can be passed to them via the kernel command line. Specifically,the intel_idle.max_cstate= and processor.max_cstate= parameters,where is an idle state index also used in the name of the givenstate's directory in sysfs (seeRepresentation of Idle States), causes theintel_idle and acpi_idle drivers, respectively, to discard all of theidle states deeper than idle state . In that case, they will never askfor any of those idle states or expose them to the governor. [The behavior ofthe two drivers is different for equal to 0. Addingintel_idle.max_cstate=0 to the kernel command line disables theintel_idle driver and allows acpi_idle to be used, whereasprocessor.max_cstate=0 is equivalent to processor.max_cstate=1.Also, the acpi_idle driver is part of the processor kernel module thatcan be loaded separately and max_cstate= can be passed to it as a moduleparameter when it is loaded.]

This utility opens the GitHub Rails console on your GitHub Enterprise appliance. Do not use this command without direction from GitHub Enterprise Support. Incorrect use could cause damage or data loss.

This utility opens a MySQL database session on your GitHub Enterprise appliance. Do not use this command without direction from GitHub Enterprise Support. Incorrect use could cause damage or data loss.

Note: If your GitHub Enterprise Server instance is in a geo-replication configuration, or if your instance is a cluster, you should use the ghe-cluster-support-bundle command to retrieve the support bundle. For more information, see "Command-line utilities."

By default the kernel scheduler will load balance all threads across allavailable cores. To stop system threads from interfering with your applicationthreads from you can use the kernel command line option isolcpus. It disablesscheduler load balancing for the isolated cores and causes threads to berestricted to the non-isolated cores by default. Note that your criticalapplication threads needs to be specifically pinned to the isolated cores inorder to run there.

The scheduler runs regularly on each core in order to switch between runnablethreads. This will introduce jitter for latency critical applications. If youhave isolated your application cores and are running a single application threadper isolated core you can use the nohz_full kernel command line optionin order to suppress the timer interrupts.

Reduce jitter from interrupt processing by changing the CPU affinity of theinterrupts. This can easily be done by runningirqbalance. By defaultirqbalance will automatically isolate the cores specified by the kernelcommand line parameter isolcpus. You can also specify cores to isolate usingthe IRQBALANCE_BANNED_CPUS environment variable.

aa06259810
Reply all
Reply to author
Forward
0 new messages