On Thu, Feb 22, 2007 at 04:49:40PM -0800, jonathan@dsg.stanford.edu wrote:Well, it is. :-) It is one form of context switch, and all of the=20 context-switchy things it does are a main part of its expense. True. For the common case, we will have almost the same behavior as now, except= =20 that we can take mutexes in an interrupt handler. As I understand it, the difficulty comes in when the mutex is held by a=20 thread that is not running. In that case, the interrupt handler blocks. In= =20 that case, the interrupt handler has to be blocked, and the interrupt has= =20 to be disabled/ignored until serviced. For systems with a PIC, we disable= =20 the interrupt and cope. For systems without a PIC, like many m68k systems (and VAX as I understand= =20 matt), we would need to disable said interrupt in the CPU (set the chip's= =20 interrupt level) until the service routine completes. As noted, this will hopefully be a rare occurrence, where a thread that=20 holds an interrupt mutex is no longer on a processor. We can structure our= =20 code so that this is very unlikely, if not impossible. Note that in the case of the mutex being locked but the thread being on=20 another processor, we will just spin-wait. That's a feature of the locking= =20 we copied from Solaris. I expect that this _will_ happen, but we then get= =20 the exact same behaviors as if we had spinlocks. Single ande multi-CPU to be sure. But as for the other stuff, it's mostly= =20 what we have now. So I don't see how we will have radially-different=20 results. We should test stuff over time to make sure we don't do something stupid,= =20 to be sure! I don't think that will mater for interupt handlers. Yes, I think there's= =20 a lot of work to do for the networking stack. But I think it'll be=20 different work. As above, trying to get the lock while a thread running on another CPU has= =20 it turns into a spin wait. That's not the slow case. So as long as we=20 don't hold a mutex we take in interrupt context while we do something else= =20 that can block, we will NOT trigger the slow path in an interrupt handler.= =20 We don't sleep while holding SPL now (or we aren't supposed to), so a very= =20 direct 1:1 translation should be fine. We can run into issues, of course, and we need to look for them. Like a case where the process that we interrupted holds a mutex that the thread that holds the interrupt mutex is waiting for. That's a deadlock if we don't detect it & trigger slow-path. It can also be argued that that's a bad design. :-) While I think we need to think about some architectures more, I believe=20 this is a good direction to go in. Also, I remember you wanting to work on MP-ing the network stack. newlock2= =20 + interrupt handling will be a definite springboard for that! Take care, Bill
| Karl Meyer | PROBLEM: 2.6.23-rc "NETDEV WATCHDOG: eth0: transmit timed out" |
| David Miller | Slow DOWN, please!!! |
| Mark Fasheh | [PATCH 0/39] Ocfs2 updates for 2.6.28 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| Shawn O. Pearce | Re: pack operation is thrashing my server |
| Pierre Habouzit | git send-email improvements |
| Matthieu Moy | git push to a non-bare repository |
| Shawn O. Pearce | libgit2 - a true git library |
| Elad Efrat | Integrating securelevel and kauth(9) |
| Hubert Feyrer | Re: Compressed vnd handling tested successfully |
| Lord Isildur | Re: Fork bomb protection patch |
| Matt Thomas | Re: FFS journal |
| Will Maier | cron doesn't run commands in /etc/crontab? |
| Richard Stallman | Real men don't attack straw men |
| Harald Dunkel | Re: Packet Filter: how to keep device names on hardware failure? |
| Jordi Espasa Clofent | Resolving dependencies with pkg_add |
| Question on swap as ramdisk partition | 1 hour ago | Linux kernel |
| Netfilter kernel module | 12 hours ago | Linux kernel |
| serial driver xmit problem | 14 hours ago | Linux kernel |
| Why Windows is better than Linux | 14 hours ago | Linux general |
| How can I see my kernel messages in vt12? | 21 hours ago | Linux kernel |
| Grub | 1 day ago | Linux general |
| vmalloc_fault handling in x86_64 | 1 day ago | Linux kernel |
| epoll_wait()ing on epoll FD | 1 day ago | Linux kernel |
| Framebuffer in x86_64 causes problems to multiseat | 1 day ago | Linux kernel |
| Difference between 2.4 and 2.6 regarding thread creation | 2 days ago | Linux general |
