]> git.proxmox.com Git - mirror_ovs.git/commit
rhel: limit stack size to 2M.
authorFlavio Leitner <fbl@sysclose.org>
Thu, 28 Feb 2019 16:13:57 +0000 (13:13 -0300)
committerBen Pfaff <blp@ovn.org>
Thu, 28 Feb 2019 19:29:21 +0000 (11:29 -0800)
commitb82a90e266e1246fe2973db97c95df22558174ea
treea8f9e3b2469dc93cbb6c0c88b4877035ffd22953
parentcadfff1e9c791bbb66dff494130eddf2333e15f9
rhel: limit stack size to 2M.

The default stack size in Fedora/RHEL is 8M, which means when ovs-vswitchd
daemon starts and uses --mlockall (default), it will dirty all memory
regions for all threads which is proportionally to the number of CPUs.

On a big host this increases memory usage to many hundreds of megabytes
while OVS actually requires much less.

This patch relies on systemd to limit to 2M/thread. That is much more
than the minimum documented at function ovs_thread_create():

    /* Some small systems use a default stack size as small as 80 kB, but OVS
     * requires approximately 384 kB according to the following analysis:
     * https://mail.openvswitch.org/pipermail/ovs-dev/2016-January/308592.html
     *
     * We use 512 kB to give us some margin of error. */

Acked-By: Timothy Redaelli <tredaelli@redhat.com>
Tested-By: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
rhel/usr_lib_systemd_system_ovs-vswitchd.service.in