<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Zaptel on FreeBSD developer&#39;s notebook</title>
    <link>https://kernelnomicon.org/categories/zaptel/</link>
    <description>Recent content in Zaptel on FreeBSD developer&#39;s notebook</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 25 Nov 2007 13:22:00 +0000</lastBuildDate>
    <atom:link href="https://kernelnomicon.org/categories/zaptel/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>INTR_FAST and selwakeup</title>
      <link>https://kernelnomicon.org/posts/intr_fast-and-selwakeup/</link>
      <pubDate>Sun, 25 Nov 2007 13:22:00 +0000</pubDate>
      <guid>https://kernelnomicon.org/posts/intr_fast-and-selwakeup/</guid>
      <description>&lt;p&gt;I stumbled over this problem a couple of years ago, ignored it, was punished for my carelessness, came out with hackerish solution and now I know &amp;ldquo;The Right Way&amp;rdquo; to solve this issue. So, the headache starts when you&amp;rsquo;re trying to wakeup userland application polling on a descriptor from INTR_FAST IRQ handler (for 7.X and later that would be interrupt filter). INTR_FAST/interrupt filter  routines are usually used for timing-critical tasks and run in IRQ dispatcher context, so no operations that may cause context switch are allowed in this code. Unfortunately &lt;a href=&#34;http://www.freebsd.org/cgi/man.cgi?query=selwakeup&amp;amp;apropos=0&amp;amp;sektion=0&amp;amp;manpath=FreeBSD+7-current&amp;amp;format=html&#34;&gt;selwakeup(9)&lt;/a&gt; tries to acquire sellock that leads to a possible context switch and leaves us in a total mess. My solution was handmade kernel thread that has been running through list of channels and performed all dirty work, not the cleanest and easiest to maintain code. &amp;ldquo;Zaptel-bsd take 2&amp;rdquo; utilizes &lt;a href=&#34;http://www.freebsd.org/cgi/man.cgi?query=taskqueue&amp;amp;apropos=0&amp;amp;sektion=0&amp;amp;manpath=FreeBSD+7-current&amp;amp;format=html&#34;&gt;taskqueue(9)&lt;/a&gt; interface to work around IRQ handler limitations. There is handler routine:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
