Messages in this thread Patch in this message | | | From | "Michael J. Micek" <> | Subject | Re: sys load in 1.3.80 | Date | Fri, 29 Mar 1996 23:23:21 -0800 (PST) |
| |
People haven't commented on my patch, so I'm posting it again. (Until somebody tells me whether it's right or wrong or just to shut up.) It works for me just fine.
> I found that 100% of "free" CPU appears to be used by the system. If I had to > guess, I'd say the idle process was being counted as system time (which makes a > wierd sort of sense, although not what one really wants).
It's a minor bug introduced in the patch of kernel/sched.c, 79->80.
Basically, sched.c was changed so that the idle process wasn't ignored as much. Unfortunately, this meant that it was being recorded as a system process.
My patch also puts printk logging level into some of sched.c If you don't want this, just take the last hunk.
Have fun.
--- sched.c.orig Thu Mar 28 14:19:03 1996 +++ sched.c Fri Mar 29 01:31:01 1996 @@ -106,7 +106,7 @@ #endif #if 1 /* sanity tests */ if (p->next_run || p->prev_run) { - printk("task already on run-queue\n"); + printk(KERN_ERR "task already on run-queue\n"); return; } #endif @@ -155,7 +155,7 @@ #if 1 /* sanity tests */ if (!next || !prev) { - printk("task not on run-queue\n"); + printk(KERN_ERR "task not on run-queue\n"); return; } #endif @@ -163,7 +163,7 @@ static int nr = 0; if (nr < 5) { nr++; - printk("idle task may not sleep\n"); + printk(KERN_ERR "idle task may not sleep\n"); } return; } @@ -291,7 +291,7 @@ /* check alarm, wake up any interruptible tasks that have got a signal */ if (intr_count) { - printk("Aiee: scheduling in interrupt\n"); + printk(KERN_ALERT "Aiee: scheduling in interrupt\n"); return; } if (bh_active & bh_mask) { @@ -421,7 +421,7 @@ void wake_up(struct wait_queue **q) { struct wait_queue *tmp; - struct task_struct * p; + struct task_struct *p; if (!q || !(tmp = *q)) return; @@ -432,11 +432,12 @@ wake_up_process(p); } if (!tmp->next) { - printk("wait_queue is bad (eip = %p)\n", + printk(KERN_ERR + "wake_up: wait_queue is bad (eip = %p)\n", __builtin_return_address(0)); - printk(" q = %p\n",q); - printk(" *q = %p\n",*q); - printk(" tmp = %p\n",tmp); + printk(KERN_ERR "wake_up: q = %p\n", q); + printk(KERN_ERR "wake_up: *q = %p\n", *q); + printk(KERN_ERR "wake_up: tmp = %p\n", tmp); break; } tmp = tmp->next; @@ -456,11 +457,15 @@ wake_up_process(p); } if (!tmp->next) { - printk("wait_queue is bad (eip = %p)\n", + printk(KERN_ERR + "wake_up_interruptible: wait_queue is bad (eip = %p)\n", __builtin_return_address(0)); - printk(" q = %p\n",q); - printk(" *q = %p\n",*q); - printk(" tmp = %p\n",tmp); + printk(KERN_ERR + "wake_up_interruptible: q = %p\n",q); + printk(KERN_ERR + "wake_up_interruptible: *q = %p\n",*q); + printk(KERN_ERR + "wake_up_interruptible: tmp = %p\n",tmp); break; } tmp = tmp->next; @@ -522,7 +527,8 @@ #if SLOW_BUT_DEBUGGING_TIMERS if (timer->next || timer->prev) { - printk("add_timer() called with non-zero list from %p\n", + printk(KERN_ERR + "add_timer() called with non-zero list from %p\n", __builtin_return_address(0)); return; } @@ -559,7 +565,8 @@ } } if (timer->next || timer->prev) - printk("del_timer() called from %p with timer not initialized\n", + printk(KERN_ERR + "del_timer() called from %p with timer not initialized.\n", __builtin_return_address(0)); restore_flags(flags); return 0; @@ -707,7 +714,7 @@ if (xtime.tv_sec % 86400 == 0) { xtime.tv_sec--; time_state = TIME_OOP; - printk("Clock: inserting leap second 23:59:60 UTC\n"); + printk(KERN_NOTICE "Clock: inserting leap second 23:59:60 UTC\n"); } break; @@ -715,7 +722,7 @@ if ((xtime.tv_sec + 1) % 86400 == 0) { xtime.tv_sec++; time_state = TIME_WAIT; - printk("Clock: deleting leap second 23:59:59 UTC\n"); + printk(KERN_NOTICE "Clock: deleting leap second 23:59:59 UTC\n"); } break; @@ -861,11 +868,13 @@ long psecs; p->utime += user; - if (p->priority < DEF_PRIORITY) - kstat.cpu_nice += user; - else - kstat.cpu_user += user; - kstat.cpu_system += system; + if (p->pid) { + if (p->priority < DEF_PRIORITY) + kstat.cpu_nice += user; + else + kstat.cpu_user += user; + kstat.cpu_system += system; + } p->stime += system; psecs = (p->stime + p->utime) / HZ;
| |