set CPUSchedulingPolicy=fifo

This commit is contained in:
Alexey Avramov
2019-01-14 18:03:17 +09:00
parent 8192681b07
commit e62629d57d
3 changed files with 46 additions and 44 deletions

47
nohang
View File

@@ -27,7 +27,7 @@ else:
wait_time = 14
max_sleep_time = 1
min_sleep_time = 0.05
min_sleep_time = 0.02
notify_helper_path = '/usr/bin/nohang_notify_helper'
@@ -38,8 +38,10 @@ debug = False
stop_cont = True
print_states_debug = False
SC_CLK_TCK = os.sysconf(os.sysconf_names['SC_CLK_TCK'])
# SC_CLK_TCK = os.sysconf(os.sysconf_names['SC_CLK_TCK'])
##########################################################################
@@ -488,27 +490,28 @@ def cont(stopped_list):
def print_states():
print()
t1 = time()
print('non-S states:')
for pid in os.listdir('/proc'):
# only directories whose names consist only of numbers, except /proc/1/
if pid[0].isdecimal() is False or pid is '1' or pid == self_pid:
continue
try:
s = pid_to_state(pid)
if s == 'S':
if print_states_debug:
print()
t1 = time()
print('non-S states:')
for pid in os.listdir('/proc'):
# only directories whose names consist only of numbers, except /proc/1/
if pid[0].isdecimal() is False or pid is '1' or pid == self_pid:
continue
else:
print('State: {}, [{}], {}, {}...'.format(
s, pid, pid_to_name(pid), pid_to_cmdline(pid)[:40]))
except FileNotFoundError:
continue
except ProcessLookupError:
continue
t2 = time()
print('print state time:', t2 - t1)
print()
try:
s = pid_to_state(pid)
if s == 'S':
continue
else:
print('State: {}, [{}], {}, {}...'.format(
s, pid, pid_to_name(pid), pid_to_cmdline(pid)[:40]))
except FileNotFoundError:
continue
except ProcessLookupError:
continue
t2 = time()
print('print state time:', t2 - t1)
print()