From Fedora Project Wiki

(User interface changed, the commands have a slightly different form now.)
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 32: Line 32:
   -D, --debug          Print DEBUG level logging details to console
   -D, --debug          Print DEBUG level logging details to console


[jkacur@fionn tuna]$ tuna priority -h
jkacur@fionn tuna]$ tuna isolate -h
usage: tuna priority [-h] -t THREAD-LIST [-C] POLICY:RTPRIO
usage: tuna isolate [-h] (-c CPU-LIST | -S CPU-SOCKET-LIST | -N)


Set thread scheduler tunables: POLICY and RTPRIO
Move all allowed threads and IRQs away from CPU-LIST
 
positional arguments:
  POLICY:RTPRIO        Set thread scheduler tunables: POLICY and RTPRIO


options:
options:
   -h, --help            show this help message and exit
   -h, --help            show this help message and exit
   -t THREAD-LIST, --threads THREAD-LIST
   -c CPU-LIST, --cpus CPU-LIST
                         THREAD-LIST affected by commands
                         CPU-LIST affected by commands
   -C, --affect_children
   -S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
                         Operation will affect children thread
                         CPU-SOCKET-LIST affected by commands
[jkacur@fionn tuna]$ pgrep "xfce4-session"
  -N, --nohz_full      CPUs in nohz_full kernel command line will be affected
2334
                        by operations
[jkacur@fionn tuna]$ chrt -p $(pgrep "xfce4-session")
 
pid 2334's current scheduling policy: SCHED_OTHER
So to isolate cpu 0, do the following
pid 2334's current scheduling priority: 0
 
[jkacur@fionn tuna]$ ./tuna priority -t 2334 SCHED_FIFO:1
<nowiki>[jkacur@fionn tuna]$ tuna isolate -c 0</nowiki>
[jkacur@fionn tuna]$ chrt -p $(pgrep "xfce4-session")
pid 2334's current scheduling policy: SCHED_FIFO
pid 2334's current scheduling priority: 1

Latest revision as of 17:41, 23 February 2023

The user interface changed slightly upstream, but is far easier now.

[jkacur@fionn tuna]$ tuna --help

usage: tuna [-h] [-v] [-L LOG-LEVEL] [-D]

                  {isolate,include,move,spread,priority,run,save,apply,show_threads,show_irqs,show_configs,what_is,gui}
                  ...

tuna - Application Tuning Program

commands:

 {isolate,include,move,spread,priority,run,save,apply,show_threads,show_irqs,show_configs,what_is,gui}
   isolate             Move all allowed threads and IRQs away from CPU-LIST
   include             Allow all threads to run on CPU-LIST
   move                Move selected entities to CPU-LIST
   spread              Spread selected entities over CPU-LIST
   priority            Set thread scheduler tunables: POLICY and RTPRIO
   run                 Fork a new process and run the COMMAND
   save                Save kthreads sched tunables to FILENAME
   apply               Apply changes described in profile
   show_threads        Show thread list
   show_irqs           Show IRQ list
   show_configs        List preloaded profiles
   what_is             Provides help about selected entities
   gui                 Start the GUI

options:

 -h, --help            show this help message and exit
 -v, --version         show version
 -L LOG-LEVEL, --logging LOG-LEVEL
                       Log application details to file for given LOG-LEVEL
 -D, --debug           Print DEBUG level logging details to console

jkacur@fionn tuna]$ tuna isolate -h usage: tuna isolate [-h] (-c CPU-LIST | -S CPU-SOCKET-LIST | -N)

Move all allowed threads and IRQs away from CPU-LIST

options:

 -h, --help            show this help message and exit
 -c CPU-LIST, --cpus CPU-LIST
                       CPU-LIST affected by commands
 -S CPU-SOCKET-LIST, --sockets CPU-SOCKET-LIST
                       CPU-SOCKET-LIST affected by commands
 -N, --nohz_full       CPUs in nohz_full kernel command line will be affected
                       by operations

So to isolate cpu 0, do the following

[jkacur@fionn tuna]$ tuna isolate -c 0