]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[core] make auto mean cpu * 3 / 2
authorAnthony Minessale <anthm@signalwire.com>
Wed, 15 Apr 2020 19:03:21 +0000 (19:03 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:10 +0000 (22:00 +0300)
src/include/switch_utils.h

index 41b2436538fd6432be97f6b84f0c11f543abbaf8..ec361a98859432fffb03c6e5abd1fcd32d689d98 100644 (file)
@@ -1144,10 +1144,7 @@ static inline uint32_t switch_parse_cpu_string(const char *cpu)
        if (!cpu) return 1;
 
        if (!strcasecmp(cpu, "auto")) {
-               if (cpu_count > 4) return 4;
-               if (cpu_count <= 2) return 1;
-
-               return (uint32_t)(cpu_count / 2);
+               return (uint32_t)((cpu_count * 3) / 2);
        }
 
        if (!strncasecmp(cpu, "cpu/", 4)) { /* cpu/2 or cpu/2/<max>  */