Bill Hartner wrote: > > Hubertus wrote : > > > The only problem I have with sched_yield like benchmarks is that it > creates > > artificial lock contention as we basically spent most of the time other > > then context switching + syscall under the scheduler lock. This we won't > > see in real apps, that's why I think the chatroom numbers are probably > > better indicators. > > Agreed. 100% artificial. The intention of the benchmark is to put a lot > of pressure on the scheduler so that the benchmark results will be very > "sensitive" to changes in schedule(). One approach would be to directly measure the time taken by schedule() using the pentium timestamp counter. You can do this with the point-to-point timing patch which I did last year (recently refreshed). It's at http://www.uow.edu.au/~andrewm/linux/#timepegs Applying timepegs, plus schedule-timer.patch (attached) reveals that vanilla schedule() takes 32 microseconds with 100 tasks on the runqueue, and 4 usecs with an empty runqueue. timepegs are probably a bit heavyweight for this. Their cache footprint perhaps introduces some heisenberg effects. Although, given that you're only looking for deltas, this won't matter a lot. [ hack, hack, hack ] OK, schedule-hack-timer.patch open codes the measurement of schedule(). Just thump on ALT-SYSRQ-Q and multiply by your CPU clock period to get the statistics. Booting with `noapic' and ignoring CPU0's results may make things more repeatable... This patch gives similar figures to the timepeg approach. Running 'bwait' (also attached) to populate the runqueue I see schedule() taking the following amount of time: runqueue length microseconds (500MHz PII) 2 5 4 6 6 6 8 6 16 7.5 24 11 32 15 48 20 64 25 128 44 Seems surprisingly slow? -