Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
util-linux.31381
util-linux-chcpu-cpu-count.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File util-linux-chcpu-cpu-count.patch of Package util-linux.31381
From 607274943bfd3d4856b872bc4278b36903fb2182 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec <sbrabec@suse.cz> Date: Wed, 9 May 2018 22:13:07 +0200 Subject: [PATCH] chcpu: Fix maximal number of CPUs chcpu.c mixed maxcpus (number of cpus) and setsize (size of CPU bit mask). It effectively limits number of CPUs to 1/8 of the supported amount. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz> Cc: Michael Matz <matz@suse.de> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> --- sys-utils/chcpu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c index f32b7a6fc..4b5c7579a 100644 --- a/sys-utils/chcpu.c +++ b/sys-utils/chcpu.c @@ -75,12 +75,12 @@ enum { */ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable) { - unsigned int cpu; + int cpu; int online, rc; int configured = -1; - size_t fails = 0; + int fails = 0; - for (cpu = 0; cpu < setsize; cpu++) { + for (cpu = 0; cpu < maxcpus; cpu++) { if (!CPU_ISSET_S(cpu, setsize, cpu_set)) continue; if (!path_exist(_PATH_SYS_CPU "/cpu%d", cpu)) { @@ -132,7 +132,7 @@ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable) } } - return fails == 0 ? 0 : fails == setsize ? -1 : 1; + return fails == 0 ? 0 : fails == maxcpus ? -1 : 1; } static int cpu_rescan(void) @@ -168,11 +168,11 @@ static int cpu_set_dispatch(int mode) */ static int cpu_configure(cpu_set_t *cpu_set, size_t setsize, int configure) { - unsigned int cpu; + int cpu; int rc, current; - size_t fails = 0; + int fails = 0; - for (cpu = 0; cpu < setsize; cpu++) { + for (cpu = 0; cpu < maxcpus; cpu++) { if (!CPU_ISSET_S(cpu, setsize, cpu_set)) continue; if (!path_exist(_PATH_SYS_CPU "/cpu%d", cpu)) { @@ -217,7 +217,7 @@ static int cpu_configure(cpu_set_t *cpu_set, size_t setsize, int configure) } } - return fails == 0 ? 0 : fails == setsize ? -1 : 1; + return fails == 0 ? 0 : fails == maxcpus ? -1 : 1; } static void cpu_parse(char *cpu_string, cpu_set_t *cpu_set, size_t setsize) -- 2.16.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor