lkml.org 
[lkml]   [2002]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectidentifying the idling kernel and kernel hacking.
Hello,
I am looking at some way of "automatically" figuring out when a
kernel might be idle -- more at the level of the kernel code itself. After
a day's reading i have the following pieces of information:

.a. There is something called the run_queue which has a list of process
that can be run.
.b. When nothing is running, we have the swapper process running (process
0 ) that is the ancestor of all processes.
.c. the scheduler goes in and checks this readyqueue every so often, so,
we can figure out if there are no processes running at any given
time..
.d. I am now trying to modify the kernel to do something interesting when
there is only the idle process running.. No idea what though. Linux
2.4.9 (which is the version i am looking at ) has a bunch of gotos and I
think i have identified that the section under still_running_back: is the
place to identify when the run_queue is empty.. I am thinking of putting
in some printfs() to make the kernel put out a message that says something
like "i am idling.." everytime the kernel is idling.. and execute a ps uax
simultaneously to show that the kernel is indeed idling..

are there any obvious disasters that u chaps see? (im not an OS person..)

-a



********************************************************************************

Think, Train, Be

*******************************************************************************


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.109 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site