tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mutexes, IPL, tty locking


> On Thu, Oct 22, 2009 at 12:32:12PM +0100, Mindaugas Rasiukevicius wrote:
>  > IPL is only being raised and that works in reference counting principle.
>  > Therefore IPL is lowered (and only to IPL_NONE) after the last release,
>  > see ci_mtx_oldspl and ci_mtx_count.  Which means that order of releases
>  > does not matter.  Gradual IPL lowering would unnecessary complicate the
>  > implementation or interface.
> Not that much. Here's some strawman code based on what's in one of my
> kernels, adapted partly for NetBSD. It isn't tested (and doesn't
> compile) but the original form does of course compile, run, and work
> in its own environment.
> I'm not suggesting that we use this as such (and it would take quite a
> bit of work to merge it) but I think the general approach is worth
> considering.

i don't think it's worth to do at this point because
- much complexity for little gain.
- it involves more frequent change of the effective IPL, which might
  be expensive.

otoh, given that we have multi levels of hw interrupts, spin locks can
be nested even for not-so-poor code.  it might be worth to reinvestigate
at some point later.  (when more interrupt handlers get mp-safe.)
however, even if it turns out to be a problem, my bet is that moving
more work from hw interrupt to softint is a better solution.


Home | Main Index | Thread Index | Old Index