Marc, following
cpu_demand_event == cpu_demand_stat_init(stat,CPU_DEMAND_TP_TASK)
what is initialized (other then with "0" val) are the following fields. - last_sleep = now; - recalc_interval = CPU_DEMAND_TASK_RECALC.
There are two do_div invocations. One with denominator total and one with total_pressure. The latter one is checked for zero.
The only reason we would even do the do_div is that total >= recalc_interval ( sched.c # L_143 ).
So the recalc_interval is not properly intialized which is what is done in cpu_demand_stat_init. (sched.c # L_80 ).
Why we don't see this bug is beyond me. We must have some random value in recalc_init.
A simple printk ( might help :-)
Anyway, applying your patch is the right thing to do.
-- Hubertus
Marc E. Fiuczynski wrote:
Hi Hubertus,
I could not get my kernel booted when you guys moved forward from the version 1 CPU controller. It appeared to croak very early on, which turns out to be in sched_init(). Finally tracked down why this was the case. It appears that the do_div() operation in ckrm_cpu_monitor.c would cause a FPE because the total field == 0. Unfortunately, it is too early in the boot process for the kernel to print such a message to the screen. What I've figured out is that you need to initialize the demand_stat structure of the first process, as shown by the oneline patch below (against 2.6.8.1 + e16rc1 cpu controller v7). Am very curious why you guys didn't have this problem---naturally I am concerned that I missed something in my merge.
*** sched.c 2004-09-28 01:47:08.252312059 -0400 --- sched.c.new 2004-09-28 01:47:13.191440261 -0400 *************** *** 4556,4561 **** --- 4556,4562 ---- rq->idle = current; set_task_cpu(current, smp_processor_id()); #ifdef CONFIG_CKRM_CPU_SCHEDULE + cpu_demand_event(&(current)->demand_stat,CPU_DEMAND_INIT,0); current->cpu_class = get_default_cpu_class(); current->array = NULL; #endif
Marc
------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ ckrm-tech mailing list https://lists.sourceforge.net/lists/listinfo/ckrm-tech
