1 Dec 2006 02:39
Re: a proposed callout API
Robert Watson <rwatson <at> FreeBSD.org>
2006-12-01 01:39:24 GMT
2006-12-01 01:39:24 GMT
On Thu, 30 Nov 2006, Ivan Voras wrote: > No trying to take sides here, but for us willing to learn here, what exactly > are the problems in Matt Dillon's suggestions? From a novice's POV, having > per-cpu queues looks (emphasis: looks) very scalable and performant. The implications of adopting the model Matt proposes are quite far-reaching: callouts don't exist in isolation, but occur in the context of data structures and work occuring in many threads. If callouts are pinned to a particular CPU, and can only be scheduled, rescheduled, and cancelled from that CPU, that implies either that all work associated with that callout is also pinned to the CPU, or that migration or message-passing be involved if the requirement comes up in a thread on another CPU. Consider the case of TCP timers: a number of TCP timers get regularly rescheduled (delack, retransmit, etc). If they can only be manipulated from cpu0 (i.e., protected by a synchronization primitive that can't be acquired from another CPU -- i.e., critical sections instead of mutexes), how do you handle the case where the a TCP packet for that connection is processed on cpu1 and needs to change the scheduling of the timer? In a strict work/data structure pinning model, you would pin the TCP connection to cpu0, and only process any data leading to timer changes on that CPU. Alternatively, you might pass a message from cpu1 to cpu0 to change the scheduling. The idea of processing timers in multiple threads and pinning them to multiple CPUs clearly isn't a bad idea: we could likely benefit from parallelism (and generally, concurrency) in timer processing. One of the things we discussed at the recent developer summit was subsystem callout threads (introducing the opportunity for parallism without committing to a particular CPU scheduling(Continue reading)
.
Ok, this is what I found:
- ipiwakeup doesn't produce differences as calculated by ministat
- turning off preemption produces visible differences, which are
calculated by ministat to be upto 10%.
x nopreempt+ipiwakeup
+ preempt+ipiwakeup
+--------------------------------------------------------------------------+
|+ + + + x x xx xx x|
| |___________A__M________| |______MA_______| |
+--------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 7 99.92 104.19 101.48 101.78429 1.4606717
+ 4 90.5 95.78 94.12 93.53 2.2081365
Difference at 95.0% confidence
-8.25429 +/- 2.4751
-8.10959% +/- 2.43172%
(Student's t, pooled s = 1.74576)
Sorry about the small number of samples - these are collected from the
system in the same state and product version (the machine was otherwise
RSS Feed