Welcome to the initial NanoVMs changelog. This microblog is to highlight recent changes in the NanoVMs ecosystem for new features, bugfixes and other pertinent information that doesn't get it's own engineering blog entry or wind up on the company blog.
Schedules and Priorities
Nanos is not linux but sometimes we stub certain syscalls so that applications written under the assumption they run on linux still work under Nanos. For instance in the past we've stubbed getuid as we don't have users. Sometimes we'll use LD_PRELOAD in packages (such as elasticsearch) to override this as well. sched_setscheduler, sched_get_priority_max, sched_get_priority_min are all syscalls we recently stubbed.
For this changelog we will be discussing the sched* family of functions we chose to stub. There are a few functions here. There is sched_setscheduler, sched_get_priority_max, and sched_get_priority_min. The sched_setscheduler syscall tells the kernel what type of policy the process should have. For instance the normal one is SCHED_OTHER which is your average round-robin scheduling but you may also set it to SCHED_BATCH or SCHED_IDLE. The latter is used for very low priority tasks such as perhaps log rotation. You can also do SCHED_FIFO or SCHED_RR.
In addition to setting the type of policy you can set the priority of a process. If you are using the "real-time" policies, obtainable via calls such as sched_get_priority_max and sched_get_priority_min you can set the value.
Somewhat confusingly the "real-time" priorities are opposite of the nice values that most sysdamins are more familiar with. With normal SCHED_OTHER you might have values from -20 to 19 with -20 being the 'highest' but with something like SCHED_FF the range is 1 to 99 with 99 being the highest.
At the end of the day though since nanos is a single process system (with support for multiple threads) we don't support different schedules or different priorities and so these have been stubbed so that applications such as OpenJ9 that calls these functions doesn't error out when starting up.
Stop Deploying 50 Year Old Systems
Introducing the future cloud.
Ready for the future cloud?
Ready for the revolution in operating systems we've all been waiting for?
Schedule a Demo
