Subject: Re: cpu_switch (was Re: 1.5 Release documentation ...)
To: None <mpumford@black-star.demon.co.uk>
From: Robert Swindells <rjs@fdy2.demon.co.uk>
List: port-arm32
Date: 11/07/2000 00:16:29
>> 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.

I'll be happy to test it too.

I want to do some work on it to make use of the process ID register on
the SA11x0 and XScale processors, and need to take the time to see how
it works.

Robert Swindells