|Matthew Dillon||Jun 23, 2000 11:36 am|
|David Greenman||Jun 24, 2000 9:10 pm|
|Matthew Dillon||Jun 25, 2000 10:24 am|
|Jake Burkholder||Jun 25, 2000 11:19 am|
|Chuck Paterson||Jun 26, 2000 9:50 am|
|Matthew Dillon||Jun 27, 2000 10:41 am|
|Chuck Paterson||Jun 27, 2000 11:19 am|
|Kevin Van Maren||Jun 29, 2000 1:52 pm|
|Greg Lehey||Jul 2, 2000 6:51 pm|
|Jason Evans||Jul 3, 2000 8:41 am|
|Jake Burkholder||Jul 3, 2000 1:14 pm|
|Jake Burkholder||Jul 5, 2000 2:23 am|
|Matthew Dillon||Jul 5, 2000 9:43 am|
|Chuck Paterson||Jul 5, 2000 9:52 am|
|Chuck Paterson||Jul 5, 2000 9:57 am|
|Luoqi Chen||Jul 5, 2000 10:29 am|
|Matthew Dillon||Jul 5, 2000 11:28 am|
|Greg Lehey||Jul 5, 2000 4:20 pm|
|Doug Rabson||Jul 6, 2000 1:26 am|
|Matthew Dillon||Jul 6, 2000 10:43 am|
|Greg Lehey||Jul 22, 2000 2:26 am|
|Matthew Dillon||Jul 22, 2000 9:20 am|
|Chuck Paterson||Jul 22, 2000 9:57 am|
|Bruce Evans||Jul 22, 2000 10:36 am|
|Greg Lehey||Jul 23, 2000 8:14 pm|
|Bruce Evans||Jul 24, 2000 1:08 am|
|Chuck Paterson||Jul 24, 2000 6:43 am|
|Matthew Dillon||Jul 24, 2000 9:16 am|
|Subject:||Re: : ipending (was: SMP progress (was: Stepping on Toes))|
|From:||Chuck Paterson (cp...@bsdi.com)|
|Date:||Jul 24, 2000 6:43:33 am|
}OK, I've been thinking about this. I've also looked at the tapes }taken at Yahoo! last month, which I'm currently copying. There you }(Chuck) stated that one of the main goals of SMPng was the elimination }of masking interrupts. Matt stated then that it wouldn't work like }that, but we didn't finish the discussion. We should probably do it }now.
There were several things which got munged into one here. There is the issue of SPLS, lazy interrupt, and ipending. BSD/OS does not do any of this and I don't believe you want to. There are 2 cases of actually blocking, both of which must be done in hardware. Only the first of which is dealt with today in BSD/OS. The first case is where there is a level triggered interrupt which can not be completed at the time you get it. This has to blocked in hardware. The second is to block fast edge triggered interrupts which re-occur. This also has to be blocked in hardware.
In typically operation running on the APIC BSD/OS doesn't have to mask anything. Missing a mutex in the bottom half of a level triggered interrupt is obviously going to require that it gets masked in order to do the EOI. This also requires that a mutex is gotten to protect the hardware and any software state you have. Currently BSD/OS uses the sched lock for this as it is generally already held when the masks and hardware is manipulated.
Given that you are only implementing heavy weight threads you will always have to block the interrupts now. You really ought to organize the assembly code keeping in mind what will be happening when you do lite weight threads, or else all the code you are doing now is going to be tossed in the next go around. Masking needs to be disassociated from actually taking the interrupt.
I realize that I may not have explicitly said this before. Ipending is effectively replaced by the runlock/scheduled state of a thread.
}The other issue is that we should potentially be able to handle one }interrupt in one processor and another in a different processor. I }know that there are problems in this attitude, and that we have }deferred it, but I can't see how this can work at all if we mask the }interrupts.
I don't understand the issue you have with this, it ought to "just work". Masking is done in hardware, and you have to acquired a mutex to protect the hardware while you touch it. The mask you are setting is out in the IO APIC so it protects both processors.
On a related note, in APIC mode BSD/OS doesn't quite assign interrupt threads, or block interrupt "right". Sources are still grouped by the interrupt level they had in PIC mode, where they should really be broken out into sources available to the pins on the APIC. I have not personally looked to see how much of a mess this is to fix, so I wouldn't advocate that we necessarily want do this with FreeBSD now. The reason I bring it up is to point out the potential problems storing to much of this state in something like say an int. BSD/OS does retain the old PIC stuff, and the information indicating that a mask has to be undone is held in an int. The actual masks are else where and we could as easily have stored this info with the mask, and probably should have. Once we undo the ties to the old PIC stuff in APIC mode I'm sure this will have to be undone.
To Unsubscribe: send mail to majo...@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message