The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Dual-processor oddity by cpqrst32007-01-25 03:41:27
  My guess: one CPU gets the main 'kernel' thread by Cokish2007-01-25 03:54:05
    Looking at gkrellm on a dual-core Athlon, by bwkaz 2007-01-25 04:04:47
I almost *never* see the two CPUs doing the same amount of work. (gkrellm has a per-CPU system-/user-/nice-time krell, which shows me how much time is being spent (as a percentage of each second) in user mode, kernel mode, and user mode at maximum nice-ness. The two CPUs' krells are never in sync.)

Encoding video with transcode from V4L2, for instance, causes about twice as much work on one CPU as the other. I suspect this is because one thread is encoding the video, and another (set of?) thread(s?) is/are encoding the audio and doing everything else that needs to be done. The kernel splits this work as best it can between CPUs, but since one thread is doing substantially more work, and *you can't split a thread between CPUs*, the work done by each is never going to be equal.

(Also, the CPU doing more of the work seems to alternate once in a while; sometimes it's CPU0 and sometimes it's CPU1. This happens maybe once or twice a minute. I'm not quite sure why the scheduler decides to do this, but I see that it's happening.)

So I bet this is the issue: cpqrst3 has one thread that's doing most of the work on his machine, and because it's one thread, it can only be running on one CPU at a time. His kernels' schedulers decide to run it primarily on one specific CPU for whatever reason. (Probably because moving a thread between CPUs hurts performance a bit.)

As far as the "kernel thread" stuff goes, I think most OSes these days have a one-to-one threading model: for each user thread, there's a *separate* kernel thread. So the kernel is multi-threaded just like userspace is (in fact it's more multi-threaded, because each user mode process has a thread in the kernel too).
[ Reply ]
      i tried both os's in idle mode, so the cpus... by cpqrst32007-01-25 04:19:27
        Yup (n/t) by Havoc2007-01-25 04:23:49
      Even more true for 4 procs... by mpicklesimer12007-01-25 06:06:00
        no temperature sensors.. by cpqrst32007-01-25 06:40:27

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)