diff --git a/Documentation/ref/ovs-ctl.8.rst b/Documentation/ref/ovs-ctl.8.rst index cdbaac4dc..75b3e16f3 100644 --- a/Documentation/ref/ovs-ctl.8.rst +++ b/Documentation/ref/ovs-ctl.8.rst @@ -194,6 +194,11 @@ The following options are less important: place, because, perhaps, OVSDB manager is running on the same host as OVS and share similar attack vectors. +* ``--oom-score=`` + + Sets the Linux Out-Of-Memory (OOM) killer score for the OVS daemon + after it's been started. + * ``--ovsdb-server-priority=`` or ``--ovs-vswitchd-priority=`` diff --git a/NEWS b/NEWS index 497591352..37fa32666 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ Post-v3.5.0 -------------------- - DPDK: * New debug appctl command 'dpdk/get-memzone-stats'. + - ovs-ctl: + * Added a new option, --oom-score=, to set the daemons' Linux + Out-Of-Memory (OOM) killer score. v3.5.0 - xx xxx xxxx diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index 03a39337f..077e1f65a 100644 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -356,6 +356,7 @@ set_defaults () { OVS_MONITOR_IPSEC_OPTIONS= OVSDB_SERVER_UMASK= OVS_VSWITCHD_UMASK= + OOM_SCORE= DB_FILE=$dbdir/conf.db DB_SOCK=$rundir/db.sock @@ -448,6 +449,7 @@ Less important options for "start", "restart" and "force-reload-kmod": --no-full-hostname set short hostname instead of full hostname --no-record-hostname do not attempt to determine/record system hostname as part of start command + --oom-score=SCORE Set oom-score after starting ovs daemon. Debugging options for "start", "restart" and "force-reload-kmod": --ovsdb-server-wrapper=WRAPPER diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index d162227dc..dded0b7c7 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in @@ -236,6 +236,10 @@ start_daemon () { umask "$previuos_umask_value" fi + if test X"$OOM_SCORE" != X; then + echo "$OOM_SCORE" > /proc/`cat $rundir/$daemon.pid`/oom_score_adj 2>/dev/null + fi + if test X"$strace" != X; then # Strace doesn't have the -D option so we attach after the fact. setsid $strace -o "$logdir/$daemon.strace.log" \