mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
cpuplugd/cpu: Rework CPU management functions
Simplify the cpu management parts of cpuplugd code by introducing functions from libutil and rework some logic to drop some assumptions about how kernel assigns cpuids. Right now cpuplugd assumes that the cpuids are always sequential and there are no gaps in between, however kernel does not guarantee that. Make cpuplugd compliant by traversing cpu sysfs entries instead. Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Signed-off-by: Mete Durlu <meted@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -23,6 +23,9 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "lib/util_base.h"
|
||||
#include "lib/util_path.h"
|
||||
#include "lib/util_file.h"
|
||||
#include "lib/util_scandir.h"
|
||||
#include "lib/zt_common.h"
|
||||
|
||||
#define NAME "cpuplugd"
|
||||
@@ -190,9 +193,8 @@ void proc_cpu_read(char *procinfo);
|
||||
unsigned long proc_read_size(char *path);
|
||||
char *get_var_rvalue(char *var_name);
|
||||
void cleanup_cmm(void);
|
||||
int hotplug(int cpuid);
|
||||
int hotunplug(int cpuid);
|
||||
int is_online(int cpuid);
|
||||
int hotplug_one_cpu(void);
|
||||
int hotunplug_one_cpu(void);
|
||||
long get_cmmpages_size();
|
||||
void parse_options(int argc, char **argv);
|
||||
void check_if_started_twice();
|
||||
@@ -204,7 +206,6 @@ int check_cmmfiles(void);
|
||||
void check_config();
|
||||
void set_cmm_pages(long size);
|
||||
int check_lpar();
|
||||
int cpu_is_configured(int cpuid);
|
||||
void setup_history(void);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user