kernel: Remove cpu_info::load
This field forces kernel to track each CPU load all the time. It is not a problem with the current scheduler on a multicore systems, but on single core machnies or with any other future scheduler this field may become just an unnecessary burden. It isn't difficult for an application to compute CPU load by itself when it needs it.
This commit is contained in:
parent
e4ea637227
commit
81e04d7b97
@ -422,7 +422,6 @@ extern void ktrace_vprintf(const char *format, va_list args);
|
||||
|
||||
typedef struct {
|
||||
bigtime_t active_time; /* usec of doing useful work since boot */
|
||||
int32 load;
|
||||
bool enabled;
|
||||
} cpu_info;
|
||||
|
||||
|
@ -81,8 +81,6 @@ void scheduler_new_thread_entry(Thread* thread);
|
||||
|
||||
void scheduler_set_cpu_enabled(int32 cpu, bool enabled);
|
||||
|
||||
int scheduler_get_cpu_load(int32 cpu);
|
||||
|
||||
void scheduler_add_listener(struct SchedulerListener* listener);
|
||||
void scheduler_remove_listener(struct SchedulerListener* listener);
|
||||
|
||||
|
@ -723,13 +723,6 @@ scheduler_set_cpu_enabled(int32 cpuID, bool enabled)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
scheduler_get_cpu_load(int32 cpu)
|
||||
{
|
||||
return CPUEntry::GetCPU(cpu)->GetLoad() / 10;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
traverse_topology_tree(const cpu_topology_node* node, int packageID, int coreID)
|
||||
{
|
||||
|
@ -452,7 +452,6 @@ get_cpu_info(uint32 firstCPU, uint32 cpuCount, cpu_info* info)
|
||||
memset(info, 0, sizeof(cpu_info) * count);
|
||||
for (uint32 i = 0; i < count; i++) {
|
||||
info[i].active_time = cpu_get_active_time(firstCPU + i);
|
||||
info[i].load = scheduler_get_cpu_load(firstCPU + i);
|
||||
info[i].enabled = !gCPU[firstCPU + i].disabled;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user