Which process scheduler is my linux system using?

22,573

Is there some command i can use or a file i can check in order to find out which process scheduler im using on my linux system ?

No, because unlike WRT to the I/O scheduler, there is only one possibility: the CFS ("Completely Fair Scheduler"), which includes real-time capabilities. The CFS is named partly to distinguish it from the "O(1)" scheduler, which as noted in that article was superseded in version 2.6.23.

So if you have a kernel where you are not sure, just check the version number.

Share:
22,573

Related videos on Youtube

exceed
Author by

exceed

Updated on September 18, 2022

Comments

  • exceed
    exceed almost 2 years

    I'm not quite sure if stackoverflow or serverfault is the forum to use for this question, but ill try here.

    Is there some command I can use or a file I can check in order to find out which process scheduler I'm using on my Linux system? I am not looking for the I/O scheduler, but the process scheduler, and please, do not refer to guides or howtos for what a scheduler is, what I'm simply asking is if there is a command or file I can run/check to see this. I could check the doc for my kernel but again I'm just wondering if there is a command or file i can check.

    I might have been a little redundant above but that's because the posts I've seen people seem to confuse process scheduler with the i/o scheduler, and they don't seem to answer the actual question, just provide links to what a scheduler is which is not what I'm after here, so apologies if the above comments sounded rude.

    • Admin
      Admin about 10 years
    • Admin
      Admin about 10 years
      I dont, and i dont think you can change the process scheduler in real time. What im asking is if there is a command to check or a file to read the contents of to be able to see which one is active. But if you wanted i think you could choose O(1) or O(n) if you really wanted to.
    • Admin
      Admin about 10 years
      Zan Lynx: It might be the same question but it does not provide the answer to this question, the command in that question does not seem to output anything when im using it and this question is about if there is any command or file i can check.
    • Admin
      Admin about 10 years
      AFAIK in Linux kernel 2.6.23 we change process scheduler from O(1) to CFS, and we don't have any other scheduler for processes that an be dynamically changed as for block I/O scheduler.
    • Admin
      Admin about 10 years
      @ZanLynx Suggest closing the older question as a duplicate of this one instead, because the question is getting better treatment here already.
    • Admin
      Admin about 10 years
      @TAFKA'goldilocks': I don't have any control over the closing of questions here as my rep is too low.
    • Admin
      Admin about 10 years
      @TAFKA'goldilocks': but this question totally IS a complete duplicate. Perhaps good answers should be added to the other question instead of here.
    • Admin
      Admin about 6 years
      Is cpupower what you're looking for?
  • exceed
    exceed about 10 years
    I dont have the kernel configuration file, then i could check it like that. I'm using a redhat system with a binary rpm that installs the kernel.
  • Artur Szymczak
    Artur Szymczak about 10 years
    Then check in /boot/config-*
  • exceed
    exceed about 10 years
    When searching through it the only variables related to process schedulers seems to be CONFIG_SCHED_SMT=y, CONFIG_SCHED_MC=y and CONFIG_NET_SCHED=y which doesnt really tell me much
  • eyoung100
    eyoung100 about 10 years
    CONFIG_SCHED_SMT=y Hyperthreading Scheduler is ON, CONFIG_SCHED_MC=y MultiCore Support is ON, CONFIG_NET_SCHED=y QoS/FairQueing is ON for Networking. As Goldilocks Alluded to his answer is correct.
  • exceed
    exceed about 10 years
    There is no such text in the file specifying the scheduler, the text "Hyperthreading Scheduler is ON" doesnt exist, the word "Scheduler" doesnt even exist.
  • eyoung100
    eyoung100 about 10 years
    it does if you use menuconfig... thats the difference between a source based distro and a binary one. See Section 4.3
  • exceed
    exceed about 10 years
    Well i cant do anything with the fact that i have a binary one so i dont have the sourcecode and wont be able to run make menuconfig. I have been running make menuconfig many times before so yes i know that. So there really is no way to tell unless you compiled the kernel yourself(?)
  • goldilocks
    goldilocks about 10 years
    I don't think there is such a thing because it doesn't reflect any kind of configuration option or "parameter being used" etc. There's only one possible scheduler, the scheduler; currently, it's called the "completely fair scheduler", and this is an abstract design issue, one of many that contribute to the kernel. Generally they are documented in the source, etc. So the question is redundant of uname -r.
  • eyoung100
    eyoung100 about 10 years
    you can too, See Building the Kernel How else would the package builder build the package??
  • terdon
    terdon about 10 years
    Why not just zgrep SCHEDULE /proc/config.gz?
  • eyoung100
    eyoung100 about 10 years
    @terdon, as per the OP's comments above he doesnt have /proc/config.gz, although he did find it in the boot directory
  • exceed
    exceed about 10 years
    Well i want to see which one is active for the kernel im currently running, not the one im going to configure or build.. what im seeing in the doc is that you at least have to have the sources and i cant download sources to a production server without the need for it..then it would be easier to check the documenation after all i guess and not file i can check. You need to have the Makefile to run make menuconfig and then i guess you would only see the content of the config file in /boot anyway (if you are going to inspect your own kernel settings in use for the kernel youre running)
  • terdon
    terdon about 10 years
    I realize, my point was that you were using an unnecessarily convoluted approach.
  • eyoung100
    eyoung100 about 10 years
    @terdon, I took that code from another post here Go gripe at that poster, not me :)
  • nealmcb
    nealmcb almost 5 years
    This answer just leads folks on a confusing run-around. As noted in the answer by goldilocks, you won't find anything related to process scheduling algorithms in the config file, since there is no choice (still true as of kernel 4.15 at least). You'll find IO scheduling choices, BFQ vs CFQ for IO etc, but that is not process scheduling. The URL you linked to is also 404 not found.