Discussion:
[RFC 0/2] CLI: start a process from tuna
Daniel Bristot de Oliveira
2014-12-30 20:37:25 UTC
Permalink
This patch set adds the ability to start a new process with its affinity and
sched parameters defined on the tuna command line.

To do so, two new parameters were added to tuna's command line: one Modifier to
set the sched tunables (-T, --sched_tunable=), and an Action to set and run
a command line (-r, --run=).

The option -r will fork a new process, set the sched tunables and affinity, and
execute the new application's code. If arguments are passed, the entire
command line must be provided inside "quotes"

Tuna will wait for the new process to return, and then continue its execution.
That means that it is possible to execute many Actions after the creation of
the new process, including the start of many process in a single command line.

Daniel Bristot de Oliveira (2):
[RFC] CLI: start an application from tuna
[RFC] docs: uptade the man page with options -T and -r

docs/tuna.8 | 6 ++++++
tuna-cmd.py | 17 +++++++++++++++--
tuna/tuna.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++-------------
3 files changed, 67 insertions(+), 15 deletions(-)
--
1.9.3
Daniel Bristot de Oliveira
2014-12-30 20:37:26 UTC
Permalink
Currently it is possible to set the CPU affinity and sched tunables for threads
running on a system. However, tuna does not permit to start a new application
with these parameters set.

This patch adds the ability to start a new process with its affinity and sched
tunable set before it starts to run.

To do so, two new parameters were added to tuna's command line. These parameters
are composed by a Modifier:

-T, --sched_tunable=[POLICY:]RTPRIO
Define scheduler tunables: POLICY and RTPRIO for an Action. POLICY
is one of OTHER, FIFO, RR, or BATCH.

And an Action:

-r, --run="COMMAND"
Run a command. If arguments are passed, the entire command line
must be provided inside "quotes". Modifiers -c and -T can be used to
set the affinity and scheduler tunables of the given command.

The option -T was needed because the current parameter to set the sched tunables
is an Action.

The option -r will fork a new process, set the sched tunables and affinity, and
execute the new application's binary.

Tuna will wait for the new process to return, and then continue its execution
That means that it is possible to execute many Actions after the creation of
a new process, including the start of many process in a single command line.

Example of use:

[***@kiron bristot]# tuna -c 2 -T fifo:2 -r httpd -t httpd -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
31624 FIFO 2 2 1 0 httpd

In this example, a new httpd process was started with affinity set to the
CPU 2, and with FIFO:2 sched. Then the new httpd process was printed by the
option -P.

Reviewed-by: Luis Claudio R. Goncalves <***@redhat.com>
Signed-off-by: Daniel Bristot de Oliveira <***@bristot.me>
---
tuna-cmd.py | 17 +++++++++++++++--
tuna/tuna.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++-------------
2 files changed, 61 insertions(+), 15 deletions(-)

diff --git a/tuna-cmd.py b/tuna-cmd.py
index cc21656..24a667a 100755
--- a/tuna-cmd.py
+++ b/tuna-cmd.py
@@ -68,6 +68,8 @@ def usage():
print fmt % ('-Q, --show_irqs', _('Show IRQ list'))
print fmt % ('-q, --irqs=' + _('IRQ-LIST'), _('%(irqlist)s affected by commands') %
{"irqlist": _('IRQ-LIST')})
+ print fmt % ('-r, --run=' + _('COMMAND'), _('fork a new process and run the %(command)s') % \
+ {"command": _('COMMAND')})
print fmt % ('-s, --save=' + _('FILENAME'), _('Save kthreads sched tunables to %(filename)s') % \
{"filename": _('FILENAME')})
print fmt % ('-S, --sockets=' +
@@ -76,6 +78,10 @@ def usage():
print fmt % ('-t, --threads=' +
_('THREAD-LIST'), _('%(threadlist)s affected by commands') % \
{"threadlist": _('THREAD-LIST')})
+ print fmt % ('-T, --sched_tunables=[' +
+ _('POLICY') + ':]' +
+ _('RTPRIO'), _('Define scheduler tunables: %(policy)s and %(rtprio)s an Action') % \
+ {"policy": _('POLICY'), "rtprio": _('RTPRIO')})
print fmt % ('-U, --no_uthreads', _('Operations will not affect user threads'))
print fmt % ('-v, --version', _('Show version'))
print fmt % ('-W, --what_is', _('Provides help about selected entities'))
@@ -449,13 +455,14 @@ def main():

i18n_init()
try:
- short = "a:c:CfgGhiIKlmp:PQq:s:S:t:UvWx"
+ short = "a:c:CfgGhiIKlmp:PQq:r:s:S:t:T:UvWx"
long = ["cpus=", "affect_children", "filter", "gui", "help",
"isolate", "include", "no_kthreads", "move",
"show_sockets", "priority=", "show_threads",
"show_irqs", "irqs=",
"save=", "sockets=", "threads=", "no_uthreads",
- "version", "what_is", "spread","cgroup","config_file_apply=","config_file_list="]
+ "version", "what_is", "spread","cgroup","config_file_apply=","config_file_list=",
+ "run=", "sched_tunable="]
if have_inet_diag:
short += "n"
long.append("show_sockets")
@@ -472,6 +479,8 @@ def main():
cpu_list = None
irq_list = None
irq_list_str = None
+ rtprio = None
+ policy = None
thread_list = []
thread_list_str = None
filter = False
@@ -622,6 +631,10 @@ def main():
sys.exit(2)
for tid in thread_list:
thread_help(tid)
+ elif o in ("-T", "--sched_tunable"):
+ (policy, rtprio) = tuna.get_policy_and_rtprio(a)
+ elif o in ("-r", "--run"):
+ tuna.run_command(a, policy, rtprio, cpu_list)

if run_gui:
try:
diff --git a/tuna/tuna.py b/tuna/tuna.py
index 49c9eab..f562746 100755
--- a/tuna/tuna.py
+++ b/tuna/tuna.py
@@ -1,7 +1,7 @@
# -*- python -*-
# -*- coding: utf-8 -*-

-import copy, ethtool, os, procfs, re, schedutils
+import copy, ethtool, os, procfs, re, schedutils, sys, shlex
import help, fnmatch

try:
@@ -455,6 +455,22 @@ def get_irq_affinity_text(irqs, irq):
# needs root prio to read /proc/irq/<NUM>/smp_affinity
return ""

+def get_policy_and_rtprio(parm):
+ parms = parm.split(":")
+ rtprio = 0
+ policy = None
+ if parms[0].upper() in ["OTHER", "BATCH", "IDLE", "FIFO", "RR"]:
+ policy = schedutils.schedfromstr("SCHED_%s" % parms[0].upper())
+ if len(parms) > 1:
+ rtprio = int(parms[1])
+ elif parms[0].upper() in ["FIFO", "RR"]:
+ rtprio = 1
+ elif parms[0].isdigit():
+ rtprio = int(parms[0])
+ else:
+ raise ValueError
+ return (policy, rtprio)
+
def thread_filtered(tid, cpus_filtered, show_kthreads, show_uthreads):
if cpus_filtered:
try:
@@ -489,18 +505,9 @@ def thread_set_priority(tid, policy, rtprio):
schedutils.set_scheduler(tid, policy, rtprio)

def threads_set_priority(tids, parm, affect_children = False):
- parms = parm.split(":")
- rtprio = 0
- policy = None
- if parms[0].upper() in ["OTHER", "BATCH", "IDLE", "FIFO", "RR"]:
- policy = schedutils.schedfromstr("SCHED_%s" % parms[0].upper())
- if len(parms) > 1:
- rtprio = int(parms[1])
- elif parms[0].upper() in ["FIFO", "RR"]:
- rtprio = 1
- elif parms[0].isdigit():
- rtprio = int(parms[0])
- else:
+ try:
+ (policy, rtprio) = get_policy_and_rtprio(parm)
+ except ValueError:
print "tuna: " + _("\"%s\" is unsupported priority value!") % parms[0]
return

@@ -559,6 +566,32 @@ def get_kthread_sched_tunings(proc = None):

return kthreads

+def run_command(cmd, policy, rtprio, cpu_list):
+ newpid = os.fork()
+ if newpid == 0:
+ cmd_list = shlex.split(cmd)
+ pid = os.getpid()
+ if rtprio:
+ try:
+ thread_set_priority(pid, policy, rtprio)
+ except (SystemError, OSError) as err:
+ print "tuna: %s" % err
+ sys.exit(2)
+ if cpu_list:
+ try:
+ schedutils.set_affinity(pid, cpu_list)
+ except (SystemError, OSError) as err:
+ print "tuna: %s" % err
+ sys.exit(2)
+
+ try:
+ os.execvp(cmd_list[0], cmd_list)
+ except (SystemError, OSError) as err:
+ print "tuna: %s" % err
+ sys.exit(2)
+ else:
+ os.waitpid(newpid, 0);
+
def generate_rtgroups(filename, kthreads, nr_cpus):
f = file(filename, "w")
f.write('''# Generated by tuna
--
1.9.3
Arnaldo Carvalho de Melo
2014-12-30 21:47:21 UTC
Permalink
Post by Daniel Bristot de Oliveira
Currently it is possible to set the CPU affinity and sched tunables for threads
running on a system. However, tuna does not permit to start a new application
with these parameters set.
This patch adds the ability to start a new process with its affinity and sched
tunable set before it starts to run.
To do so, two new parameters were added to tuna's command line. These parameters
-T, --sched_tunable=[POLICY:]RTPRIO
Define scheduler tunables: POLICY and RTPRIO for an Action. POLICY
is one of OTHER, FIFO, RR, or BATCH.
Couldn't this reuse:

[***@zoo linux]$ tuna --help | grep -- --priority
-p, --priority=[POLICY:]RTPRIO Set thread scheduler tunables: POLICY and RTPRIO
[***@zoo linux]$

Sure, the above has been, so far, an "action", i.e. it will set the
scheduler policy and rtprio for the set of "entities" selected, i.e. the
threads previously selected using -t or -q, while with --run we will
after the "--priority" "action" state what is to be acted upon...
Post by Daniel Bristot de Oliveira
-r, --run="COMMAND"
Run a command. If arguments are passed, the entire command line
must be provided inside "quotes". Modifiers -c and -T can be used to
set the affinity and scheduler tunables of the given command.
The option -T was needed because the current parameter to set the sched tunables
is an Action.
The option -r will fork a new process, set the sched tunables and affinity, and
execute the new application's binary.
Tuna will wait for the new process to return, and then continue its execution
That means that it is possible to execute many Actions after the creation of
a new process, including the start of many process in a single command line.
Can't we elide the '-t httpd' and remember the fact that '-r' set what
further actions operate on, i.e. -P would show only what -r set?

I.e. to sum both comments I made, I thought that we could do instead:

tuna -c 2 -p fifo:2 -r httpd -P

And have the same results as below.
Post by Daniel Bristot de Oliveira
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
31624 FIFO 2 2 1 0 httpd
But perhaps we need a -p equivalent that don't acts on anything, just
changes those parameters to set the stage for -r...

I.e. I thought that having both -T and -p for setting the same thing
gets confusing, with the only difference that the first (-T) don't acts
on anything but what comes next, possibly in multiple --run instances.

Perhaps -p, when no threads are selected, would work as -T in your
patch. And when there are threads selected at the point that we want to
set the stage for --run, we could use an thread list to "reset" the list
of threads to be affected by -p, i.e.:

tuna -t sshd -c 1 -m -t -p fifo:1 --run httpd

I.e. we want to move sshd to cpu 1, but then we don't want to set it to
fifo:1, just start httpd with fifo:1 sched policy/rtprio, if we wanted
to have both sshd and httpd being fifo:1, just remove that empty -t:

tuna -t sshd -c 1 -m -p fifo:1 --run httpd

I think this makes things more compact and clear, no?

- Arnaldo
Post by Daniel Bristot de Oliveira
In this example, a new httpd process was started with affinity set to the
CPU 2, and with FIFO:2 sched. Then the new httpd process was printed by the
option -P.
---
tuna-cmd.py | 17 +++++++++++++++--
tuna/tuna.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++-------------
2 files changed, 61 insertions(+), 15 deletions(-)
diff --git a/tuna-cmd.py b/tuna-cmd.py
index cc21656..24a667a 100755
--- a/tuna-cmd.py
+++ b/tuna-cmd.py
print fmt % ('-Q, --show_irqs', _('Show IRQ list'))
print fmt % ('-q, --irqs=' + _('IRQ-LIST'), _('%(irqlist)s affected by commands') %
{"irqlist": _('IRQ-LIST')})
+ print fmt % ('-r, --run=' + _('COMMAND'), _('fork a new process and run the %(command)s') % \
+ {"command": _('COMMAND')})
print fmt % ('-s, --save=' + _('FILENAME'), _('Save kthreads sched tunables to %(filename)s') % \
{"filename": _('FILENAME')})
print fmt % ('-S, --sockets=' +
print fmt % ('-t, --threads=' +
_('THREAD-LIST'), _('%(threadlist)s affected by commands') % \
{"threadlist": _('THREAD-LIST')})
+ print fmt % ('-T, --sched_tunables=[' +
+ _('POLICY') + ':]' +
+ _('RTPRIO'), _('Define scheduler tunables: %(policy)s and %(rtprio)s an Action') % \
+ {"policy": _('POLICY'), "rtprio": _('RTPRIO')})
print fmt % ('-U, --no_uthreads', _('Operations will not affect user threads'))
print fmt % ('-v, --version', _('Show version'))
print fmt % ('-W, --what_is', _('Provides help about selected entities'))
i18n_init()
- short = "a:c:CfgGhiIKlmp:PQq:s:S:t:UvWx"
+ short = "a:c:CfgGhiIKlmp:PQq:r:s:S:t:T:UvWx"
long = ["cpus=", "affect_children", "filter", "gui", "help",
"isolate", "include", "no_kthreads", "move",
"show_sockets", "priority=", "show_threads",
"show_irqs", "irqs=",
"save=", "sockets=", "threads=", "no_uthreads",
- "version", "what_is", "spread","cgroup","config_file_apply=","config_file_list="]
+ "version", "what_is", "spread","cgroup","config_file_apply=","config_file_list=",
+ "run=", "sched_tunable="]
short += "n"
long.append("show_sockets")
cpu_list = None
irq_list = None
irq_list_str = None
+ rtprio = None
+ policy = None
thread_list = []
thread_list_str = None
filter = False
sys.exit(2)
thread_help(tid)
+ (policy, rtprio) = tuna.get_policy_and_rtprio(a)
+ tuna.run_command(a, policy, rtprio, cpu_list)
diff --git a/tuna/tuna.py b/tuna/tuna.py
index 49c9eab..f562746 100755
--- a/tuna/tuna.py
+++ b/tuna/tuna.py
@@ -1,7 +1,7 @@
# -*- python -*-
# -*- coding: utf-8 -*-
-import copy, ethtool, os, procfs, re, schedutils
+import copy, ethtool, os, procfs, re, schedutils, sys, shlex
import help, fnmatch
# needs root prio to read /proc/irq/<NUM>/smp_affinity
return ""
+ parms = parm.split(":")
+ rtprio = 0
+ policy = None
+ policy = schedutils.schedfromstr("SCHED_%s" % parms[0].upper())
+ rtprio = int(parms[1])
+ rtprio = 1
+ rtprio = int(parms[0])
+ raise ValueError
+ return (policy, rtprio)
+
schedutils.set_scheduler(tid, policy, rtprio)
- parms = parm.split(":")
- rtprio = 0
- policy = None
- policy = schedutils.schedfromstr("SCHED_%s" % parms[0].upper())
- rtprio = int(parms[1])
- rtprio = 1
- rtprio = int(parms[0])
+ (policy, rtprio) = get_policy_and_rtprio(parm)
print "tuna: " + _("\"%s\" is unsupported priority value!") % parms[0]
return
return kthreads
+ newpid = os.fork()
+ cmd_list = shlex.split(cmd)
+ pid = os.getpid()
+ thread_set_priority(pid, policy, rtprio)
+ print "tuna: %s" % err
+ sys.exit(2)
+ schedutils.set_affinity(pid, cpu_list)
+ print "tuna: %s" % err
+ sys.exit(2)
+
+ os.execvp(cmd_list[0], cmd_list)
+ print "tuna: %s" % err
+ sys.exit(2)
+ os.waitpid(newpid, 0);
+
f = file(filename, "w")
f.write('''# Generated by tuna
--
1.9.3
_______________________________________________
tuna-devel mailing list
https://lists.fedorahosted.org/mailman/listinfo/tuna-devel
Daniel Bristot de Oliveira
2015-01-12 16:41:38 UTC
Permalink
Post by Arnaldo Carvalho de Melo
Post by Daniel Bristot de Oliveira
Currently it is possible to set the CPU affinity and sched tunables for threads
running on a system. However, tuna does not permit to start a new application
with these parameters set.
This patch adds the ability to start a new process with its affinity and sched
tunable set before it starts to run.
To do so, two new parameters were added to tuna's command line. These parameters
-T, --sched_tunable=[POLICY:]RTPRIO
Define scheduler tunables: POLICY and RTPRIO for an Action. POLICY
is one of OTHER, FIFO, RR, or BATCH.
-p, --priority=[POLICY:]RTPRIO Set thread scheduler tunables: POLICY and RTPRIO
Sure, the above has been, so far, an "action", i.e. it will set the
scheduler policy and rtprio for the set of "entities" selected, i.e. the
threads previously selected using -t or -q, while with --run we will
after the "--priority" "action" state what is to be acted upon...
Post by Daniel Bristot de Oliveira
-r, --run="COMMAND"
Run a command. If arguments are passed, the entire command line
must be provided inside "quotes". Modifiers -c and -T can be used to
set the affinity and scheduler tunables of the given command.
The option -T was needed because the current parameter to set the sched tunables
is an Action.
The option -r will fork a new process, set the sched tunables and affinity, and
execute the new application's binary.
Tuna will wait for the new process to return, and then continue its execution
That means that it is possible to execute many Actions after the creation of
a new process, including the start of many process in a single command line.
Can't we elide the '-t httpd' and remember the fact that '-r' set what
further actions operate on, i.e. -P would show only what -r set?
tuna -c 2 -p fifo:2 -r httpd -P
And have the same results as below.
Post by Daniel Bristot de Oliveira
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
31624 FIFO 2 2 1 0 httpd
But perhaps we need a -p equivalent that don't acts on anything, just
changes those parameters to set the stage for -r...
I.e. I thought that having both -T and -p for setting the same thing
gets confusing, with the only difference that the first (-T) don't acts
on anything but what comes next, possibly in multiple --run instances.
Perhaps -p, when no threads are selected, would work as -T in your
patch. And when there are threads selected at the point that we want to
set the stage for --run, we could use an thread list to "reset" the list
tuna -t sshd -c 1 -m -t -p fifo:1 --run httpd
I.e. we want to move sshd to cpu 1, but then we don't want to set it to
fifo:1, just start httpd with fifo:1 sched policy/rtprio, if we wanted
tuna -t sshd -c 1 -m -p fifo:1 --run httpd
I think this makes things more compact and clear, no?
Thanks for the suggestions Arnaldo, I implemented them and I will
submit a RFC v2.

An example of tuna running with these suggestions implemented:

[***@kiron tuna]# tuna -t sshd -P -c 1 -m -P -t - -p fifo:1 --run httpd -c 1,2 -r +snmpd -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
23519 OTHER 0 0,1,2,3 1 1 sshd
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
23519 OTHER 0 1 1 1 sshd
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
23378 FIFO 1 1,2 310 0 snmpd
23535 FIFO 1 1 1 0 httpd

Tuna printed the sshd daemon running, and moved it to CPU 1, and
printed it again. Then the thread list was cleared with "-t -" [1],
the policy:prio fifo:1 was saved, and httpd was started with these
parameters. The httpd was saved in the thread list. Then the CPU
1,2 was set and the snmpd daemon started. The prefix + on snmpd made
it be appended to the thread list. Finally the thread list was printed.

[1] I used the - as reset parameter to -t because it requires a
parameter. If no parameter is given, the optargs sets the next option
as the parameter, what may cause a wrong interpretation of the command
line. If anyone knows a better way to deal with it, feel free to fix it
:-).

Regarding the idea of this feature, I'd say that I just implemented
the idea given by a well know tuna developer/creator ;-).

- Daniel
Arnaldo Carvalho de Melo
2015-01-12 20:40:09 UTC
Permalink
Post by Daniel Bristot de Oliveira
Post by Arnaldo Carvalho de Melo
I think this makes things more compact and clear, no?
Thanks for the suggestions Arnaldo, I implemented them and I will
submit a RFC v2.
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
23519 OTHER 0 0,1,2,3 1 1 sshd
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
23519 OTHER 0 1 1 1 sshd
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
23378 FIFO 1 1,2 310 0 snmpd
23535 FIFO 1 1 1 0 httpd
Tuna printed the sshd daemon running, and moved it to CPU 1, and
printed it again. Then the thread list was cleared with "-t -" [1],
the policy:prio fifo:1 was saved, and httpd was started with these
parameters. The httpd was saved in the thread list. Then the CPU
1,2 was set and the snmpd daemon started. The prefix + on snmpd made
it be appended to the thread list. Finally the thread list was printed.
[1] I used the - as reset parameter to -t because it requires a
parameter. If no parameter is given, the optargs sets the next option
as the parameter, what may cause a wrong interpretation of the command
line. If anyone knows a better way to deal with it, feel free to fix it
:-).
'-' without arguments is the ideal argument for -t to mean "remove all
threads", as '-t -snmp' means "remove 'snmp' from the thread list", so,
not specifying a thread ID, name or wildcard should mean everything, and
I think its prefered to '-t -*' because we like to type less, even if
just one char :-)
Post by Daniel Bristot de Oliveira
Regarding the idea of this feature, I'd say that I just implemented
the idea given by a well know tuna developer/creator ;-).
:-)

Thanks!

- Arnaldo

Daniel Bristot de Oliveira
2014-12-30 20:37:27 UTC
Permalink
Update tuna.8 man page with the descriptions of the two new command line
options:

A Modifier:
-T, --sched_tunable=[POLICY:]RTPRIO
Define scheduler tunables: POLICY and RTPRIO for an Action. POLICY
is one of OTHER, FIFO, RR, or BATCH.

And an Action:
-r, --run="COMMAND"
Run the COMMAND. If arguments are passed, the entire command line
must be provided inside "quotes". Modifiers -c and -T can be used to
set the affinity and scheduler tunables of the given command.

Reviewed-by: Luis Claudio R. Goncalves <***@redhat.com>
Signed-off-by: Daniel Bristot de Oliveira <***@bristot.me>
---
docs/tuna.8 | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/docs/tuna.8 b/docs/tuna.8
index 4864a99..089ae29 100644
--- a/docs/tuna.8
+++ b/docs/tuna.8
@@ -43,6 +43,9 @@ Show thread list.
\fB\-s\fR, \fB\-\-save\fR=\fIFILENAME\fR
Save kthreads sched tunables to FILENAME.
.TP
+\fB\-r\fR, \fB\-\-run\fR=\fI"COMMAND"\fR
+Run the COMMAND. If arguments are passed, the entire command line must be provided inside "quotes". Modifiers \fB-c\fR and \fB-T\fR will set the affinity and scheduler tunables of the given command.
+.TP
\fB\-v\fR, \fB\-\-version\fR
Show version
.TP
@@ -71,6 +74,9 @@ Operations will not affect kernel threads.
\fB\-q\fR, \fB\-\-irqs\fR=\fIIRQ\-LIST\fR
IRQ\-LIST affected by commands. Requires an IRQ number or a comma-separated list of IRQ numbers.
.TP
+\fB\-T\fR, \fB\-\-sched_tunable\fR=\fI[POLICY:]\fRRTPRIO
+Define scheduler tunables: POLICY and RTPRIO for an \fBAction\fR. POLICY is one of OTHER, FIFO, RR, or BATCH.
+.TP
\fB\-S\fR, \fB\-\-sockets\fR=\fICPU\-SOCKET\-LIST\fR
CPU\-SOCKET\-LIST affected by commands. Requires a socket number or a comma-separated list of socket numbers.
.TP
--
1.9.3
Arnaldo Carvalho de Melo
2014-12-30 21:32:22 UTC
Permalink
Post by Daniel Bristot de Oliveira
This patch set adds the ability to start a new process with its affinity and
sched parameters defined on the tuna command line.
To do so, two new parameters were added to tuna's command line: one Modifier to
set the sched tunables (-T, --sched_tunable=), and an Action to set and run
a command line (-r, --run=).
The option -r will fork a new process, set the sched tunables and affinity, and
execute the new application's code. If arguments are passed, the entire
command line must be provided inside "quotes"
Tuna will wait for the new process to return, and then continue its execution.
That means that it is possible to execute many Actions after the creation of
the new process, including the start of many process in a single command line.
The description is awesome, cool new feature, how couldn't I have
thought of that? Now to quickly skim the implementation! :-)
Post by Daniel Bristot de Oliveira
[RFC] CLI: start an application from tuna
[RFC] docs: uptade the man page with options -T and -r
docs/tuna.8 | 6 ++++++
tuna-cmd.py | 17 +++++++++++++++--
tuna/tuna.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++-------------
3 files changed, 67 insertions(+), 15 deletions(-)
--
1.9.3
_______________________________________________
tuna-devel mailing list
https://lists.fedorahosted.org/mailman/listinfo/tuna-devel
Loading...