hamadmarri / ECHO-CPU-Scheduler

ECHO CPU Scheduler - Enhanced CPU Handling Orchestrator It is a CPU processes scheduler patch for Linux kernel.
29 stars 2 forks source link

Kernel fails to build with CONFIG_HZ_PERIODIC #5

Closed anh0516 closed 4 weeks ago

anh0516 commented 5 months ago

The kernel fails to build with CONFIG_HZ_PERIODIC. It seems that ECHO expects CONFIG_NO_HZ_COMMON: kernel/sched/bs.c:879:30: error: use of undeclared identifier 'run_rebalance_domains' 879 | open_softirq(SCHED_SOFTIRQ, run_rebalance_domains); | ^

This is easily fixed by making CONFIG_ECHO_SCHED depend on CONFIG_NO_HZ_COMMON.

hamadmarri commented 5 months ago

Hello @anh0516

Thank you for reporting this issue. Actually ECHO should work with periodic fine but I missed up the declaration location for some functions. Try this patch if you need to use periodic hz

fix-periodic.zip

anh0516 commented 5 months ago

Sorry I took so long to get back. It looks like the patch doesn't apply cleanly anymore after you made some changes since writing it. I poked around a bit but I'm not sure exactly how to hack it in:

--- kernel/sched/balancer.h
+++ kernel/sched/balancer.h
@@ -814,7 +765,7 @@ void trigger_load_balance(struct rq *this_rq)
     * Don't need to rebalance while attached to NULL domain or
     * runqueue CPU is not active
     */
-   if (unlikely(on_null_domain(c_rq) || !cpu_active(cpu)))
+   if (unlikely(on_null_domain(this_rq) || !cpu_active(this_cpu)))
        return;

    if (this_cpu != 0)
hamadmarri commented 5 months ago

Sorry, this was included by mistake. I removed this diff please see this attached patch

fix-periodic.zip

anh0516 commented 4 months ago

It works now, thanks!