Date: Sat, 01 Oct 2011 12:48:59 +0300 From: Alexander Motin <mav@FreeBSD.org> To: Adrian Chadd <adrian@freebsd.org> Cc: freebsd-hackers@freebsd.org Subject: Re: how are callouts handled in cpu_idle() ? Message-ID: <4E86E20B.7000703@FreeBSD.org> In-Reply-To: <CAJ-Vmon1xMpourX1u6%2Bx=Y%2Bpi3G3VNCCJRoO1wHH6kCMKFYKog@mail.gmail.com> References: <CAJ-Vmoksy68YmTXAQ1S87-%2BFMUHjZ-K0TOV0OUm3hQpYGZhXHw@mail.gmail.com> <4E86DC86.3040204@FreeBSD.org> <CAJ-Vmon1xMpourX1u6%2Bx=Y%2Bpi3G3VNCCJRoO1wHH6kCMKFYKog@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Adrian Chadd wrote: > On 1 October 2011 17:25, Alexander Motin <mav@freebsd.org> wrote: > >> Use of critical section in cpu_idle() from the beginning was based on >> number of assumptions about filter interrupt handler's limitations. > > [snip] > >> So, if you really need to use callout() in interrupt filter, we could >> disable interrupts before calling cpu_idleclock(), as you have told. But >> that is only a partial solution and you should be ready for the second >> half of the problems. Depending on your needs I am not sure it will >> satisfy you. > > I'm not using callouts from a swi in ath(4), at least not yet. I > haven't yet gone over all the drivers in sys/dev/ to see if any of > them are actually doing this. > I was just making an observation. All I've told above related only to filter interrupt handlers. Swi has no any problems from this point. Swi is alike to regular threaded interrupt handler, it has no this kind of limitations. If interrupt fires after cpu_idleclock() and schedules swi, sched_runnable() will return non-zero and sleep will be canceled. After that, when it is finally called, swi have updated time and allowed to use callouts as it wants to. -- Alexander Motin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E86E20B.7000703>