|
| static int | get_num_cpus (void) |
| |
| static int | parse_cpu_hex_mask (const char *str, cpu_set_t *cpuset, size_t cpuset_size) |
| |
| static int | generate_cpu_hex_mask (char *str, size_t str_buf_size, cpu_set_t *cpuset, size_t cpuset_size) |
| |
| static bool | proc_tid_exists (pid_t tid) |
| |
| static bool | proc_name_exists (const char *name, pid_t *res_pid) |
| |
| static enum sched_vty_thread_id | procname2pid (pid_t *res_pid, const char *str, bool applynow) |
| |
| static int | my_sched_setaffinity (enum sched_vty_thread_id tid_type, pid_t pid, cpu_set_t *cpuset, size_t cpuset_size) |
| |
| | DEFUN_ATTR (cfg_sched_cpu_affinity, cfg_sched_cpu_affinity_cmd, "cpu-affinity (self|all|<0-4294967295>|THREADNAME) CPUHEXMASK [delay]", "Set CPU affinity mask on a (group of) thread(s)\n" "Set CPU affinity mask on thread running the VTY\n" "Set CPU affinity mask on all process' threads\n" "Set CPU affinity mask on a thread with specified PID\n" "Set CPU affinity mask on a thread with specified thread name\n" "CPU affinity mask\n" "If set, delay applying the affinity mask now and let the app handle it at a later point\n", CMD_ATTR_IMMEDIATE) |
| |
| static int | set_sched_rr (unsigned int prio) |
| |
| | DEFUN_ATTR (cfg_sched_policy, cfg_sched_policy_cmd, "policy rr <1-32>", "Set the scheduling policy to use for the process\n" "Use the SCHED_RR real-time scheduling algorithm\n" "Set the SCHED_RR real-time priority\n", CMD_ATTR_IMMEDIATE) |
| |
| | DEFUN (cfg_sched, cfg_sched_cmd, "cpu-sched", "Configure CPU Scheduler related settings") |
| |
| | DEFUN (show_sched_threads, show_sched_threads_cmd, "show cpu-sched threads", SHOW_STR "Show Sched section information\n" "Show information about running threads)\n") |
| |
| static int | config_write_sched (struct vty *vty) |
| |
| int | osmo_cpu_sched_vty_init (void *tall_ctx) |
| | Initialize sched VTY nodes. More...
|
| |
| int | osmo_cpu_sched_vty_apply_localthread (void) |
| | Apply cpu-affinity on calling thread based on VTY configuration. More...
|
| |
CPU Scheduling related VTY API.
| DEFUN_ATTR |
( |
cfg_sched_cpu_affinity |
, |
|
|
cfg_sched_cpu_affinity_cmd |
, |
|
|
"cpu-affinity (self|all|<0-4294967295>|THREADNAME) CPUHEXMASK " |
[delay], |
|
|
"Set CPU affinity mask on a (group of) thread(s)\n" "Set CPU affinity mask on thread running the VTY\n" "Set CPU affinity mask on all process' threads\n" "Set CPU affinity mask on a thread with specified PID\n" "Set CPU affinity mask on a thread with specified thread name\n" "CPU affinity mask\n" "If |
set, |
|
|
delay applying the affinity mask now and let the app handle it at a later point\n" |
, |
|
|
CMD_ATTR_IMMEDIATE |
|
|
) |
| |
References argc, argv, cpu_affinity_it::bufname, CMD_SUCCESS, CMD_WARNING, sched_vty_opts::cpu_affinity_li, sched_vty_opts::cpu_affinity_li_mutex, cpu_affinity_it::cpuset, cpu_affinity_it::cpuset_size, cpu_affinity_it::delay, cpu_affinity_it::entry, get_num_cpus(), llist_add_tail(), llist_del(), llist_for_each_entry_safe, my_sched_setaffinity(), OSMO_STRLCPY_ARRAY, parse_cpu_hex_mask(), pid, procname2pid(), SCHED_VTY_THREAD_ALL, SCHED_VTY_THREAD_ID, SCHED_VTY_THREAD_NAME, SCHED_VTY_THREAD_SELF, SCHED_VTY_THREAD_UNKNOWN, sched_vty_opts::tall_ctx, cpu_affinity_it::tid_type, VTY_NEWLINE, and vty_out().