master_daemon: taskset to 0 09/5309/1
authorYaroslav Brustinov <[email protected]>
Thu, 15 Dec 2016 22:06:14 +0000 (00:06 +0200)
committerYaroslav Brustinov <[email protected]>
Thu, 15 Dec 2016 22:06:14 +0000 (00:06 +0200)
Change-Id: I74ef8bdf8b0be9f29e0dfc2bae68c1cb451e1a7a
Signed-off-by: Yaroslav Brustinov <[email protected]>
scripts/master_daemon.py

index c3c9c2d..855358f 100755 (executable)
@@ -162,6 +162,11 @@ def _check_path_under_current_or_temp(path):
 if getpass.getuser() != 'root':
     fail('Please run this program as root/with sudo')
 
+pid = os.getpid()
+ret = os.system('taskset -pc 0 %s' % pid)
+if ret:
+    fail('Could not set self affinity to core zero.')
+
 daemon_actions = OrderedDict([('start', 'start the daemon'),
                               ('stop', 'exit the daemon process'),
                               ('show', 'prompt the status of daemon process (running / not running)'),