Subject: cpu_switch (was Re: 1.5 Release documentation ...)
To: Chris Gilbert <chris@buzzbee.freeserve.co.uk>
From: Mike Pumford <mpumford@black-star.demon.co.uk>
List: port-arm32
Date: 11/06/2000 23:52:38
> I have found something scary in the cpuswitch.S, and that's that it uses ffs 
> to find the first queue with work, so for the most part if there's only user 
> process running it was looping 12 time (eeks the pipeline!!!)  to find the 
> running process that's at the head, I know not a major thing, but I suspect 
> that cpu_switch is hit regularly?  Anyway I'm compiling up a kernel with this 
> tweaked (I finnally got around to digging out the ffs stuff of the mailing 
> list from 2 years back, the ffs version that's fixed time, does a mystical 
> multiply and then lookup from table.)
> 
I've just taken a look. Not pretty especially since IRQ's are disabled when it 
runs. As I understand this is the routine that is called every timeslice to 
schedule a new process so you are quite right that its fairly fundamental 
piece of code that is likely to benifit from optimization.

> Anyway once it's working it'll eventually make it into the tree I hope :)
> 
Drop me a patch if you want someone else to test things.

Mike