Pete's Log: context switch: sysadmin to kernel hacker
Entry #991, (Coding, Hacking, & CS stuff)(posted when I was 22 years old.)
This was odd: after restarting X, a gnome message popped up, informing me gmc had segfaulted. oh well, I hit ok. Another message informing me of the same thing (but different PID) popped up. I kept hitting ok, I kept getting new segfault messages. Hrmm. I restart X and the problem goes away. Odd.
I've spent a good chunk of time lately playing sysadmin. It's cool. I can now connect from malloc directly to any of the machines in our cluster (they're on a private network, protected by a firewall, so this was non-trivial, especially since I had to learn ipchains syntax...). I also now have my home directory nfs-mounted off of switch, so that my home directory on malloc is the same as my home directory on the cluster machines. That is sweet. I also now have the empty 3gig partition I found on malloc some time ago mounted and in use to store vmware stuff. I've also been doing some work on the cluster machines of late to make them more friendly. So now life seems to have returned to a stable condition. Now real work can begin.
Now apparently some of the statistics the linux kernel gathers about itself are pretty inaccurate. Seva has added this profiling stuff to the kernel, it seems, which seems pretty cool. The tricky bit, however, is that you have to be smart. Say you're entering an interrupt handler. Well, you don't want time spent here to count as part of some other counter, you want it counted only towards time spent in interrupts. So you gotta have masks to keep track of what's going on, and you need to save all that fun stuff. So now begins my fun job of tracking down where to add counting in order to get accurate numbers for what we want. For example, let's say we want to count the amount of time spent in user time or in kernel time. Well, in order to accomplish this, we need to set/reset/whatever our counters every time there's a context switch. Seva said his first attempt failed: the number of times the system entered kernel mode did not match the number of times the system entered user mode. badness. And the kernel is a huge mother. Tracking down all the context switches within may prove to be a formidable task. And thus my evening begins.