| Display a processes scheduler class in Linux |
|
|
|
| Written by Martin | |
| Tuesday, 15 June 2010 | |
|
The ps command in the ways I use it most (ps -ef and ps auxwww) doesn't display the scheduling class for a process. Oracle have cunningly released a patchset to update Grid Infrastructure that changes the scheduling class from the VKTM and LMSn ASM processes to "Timeshare" instead of Realtime. So far so good, but I had no idea how to display the scheduling class of a process so some man page reading and Internet research were in order. After some digging around I found out that using the BSD command line syntax combined with the "--format" option does the trick. The difficult bit was in figuring out which format identifiers to use. All the information ps can get about a process are recorded in /proc/pid/stat. Parsing this with a keen eye however proves difficult due to the sheer number of fields in the file. So back to using ps (1). Here's the example. Before applying the workaround to the patch, Oracle ASM's VKTM (virtual keeper of time) and LMSn (global cache services process) run with TS priority: [oracle@rac11gr2node2 ~]$ ps ax --format uname,pid,ppid,tty,cmd,cls,pri,rtprio \ After applying the workaround the scheduling class changed: [oracle@rac11gr2node1 ~]$ ps ax --format uname,pid,ppid,tty,cmd,cls,pri,rtprio | \ Notice how the cls field changed, and also that the rtprio is now populated. I have learned something new today. |
|
| Last Updated ( Tuesday, 15 June 2010 ) |
| Next > |
|---|



