On Thu, Feb 22, 2007 at 09:46:42AM -0800, Bill Studenmund wrote:Exactly. We already context switch for interrupts, but it is not the same as mi_switch. What I want to do is give the interrupt handler enough context (curlwp, stack) that it can block briefly and be restarted later. There are two outcomes: the interrupt runs to completion, or the handler blocks. In both of those cases, we return back to the interrupted LWP just as we do now. The handlers would be permitted to block only in order to acquire a mutex or RW lock. Calling cv_wait(), or lockmgr() or pool_get(, PR_WAITOK) etc. from the handler's context would panic the machine. When the lock a handler is waiting on is released, we end up in sleepq_wake. The interrupt handler gets marked runnable and put onto a per-CPU run queue. Just before returning, sleepq_wake notices that there is a high priority LWP (above system or kernel priority) waiting to run and calls preempt. The interrupt handler is the highest priority item in the run queue, so it gets picked and put back on the CPU. What Jonathan is describing is roughly how FreeBSD works, I think. When the interrupt comes in, mi_switch() is called to dispatch it. The thread that was running when the interrupt came in gets kicked off the CPU. Andrew
| David Newall | Re: Slow DOWN, please!!! |
| Renato S. Yamane | Error -71 on device descriptor read/all |
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| Shawn O. Pearce | libgit2 - a true git library |
| Martin Langhoff | Re: pack operation is thrashing my server |
| Aubrey Li | git proxy issue |
| Pierre Habouzit | git send-email improvements |
| Elad Efrat | Integrating securelevel and kauth(9) |
| Hubert Feyrer | Compressed vnd handling tested successfully |
| Matt Thomas | Interrupt, interrupt threads, continuations, and kernel lwps |
| Michael | Re: yamt-km branch |
| Richard Stallman | Real men don't attack straw men |
| Will Maier | cron doesn't run commands in /etc/crontab? |
| askthelist | Packets Per Second Limit? |
| Harald Dunkel | Packet Filter: how to keep device names on hardware failure? |
| Question on swap as ramdisk partition | 2 hours ago | Linux kernel |
| Netfilter kernel module | 12 hours ago | Linux kernel |
| serial driver xmit problem | 15 hours ago | Linux kernel |
| Why Windows is better than Linux | 15 hours ago | Linux general |
| How can I see my kernel messages in vt12? | 22 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 | 2 days ago | Linux kernel |
| Difference between 2.4 and 2.6 regarding thread creation | 2 days ago | Linux general |
