tech-kern archive

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

Re: mutexes, IPL, tty locking



On Fri, Oct 30, 2009 at 07:43:24AM +0000, David Holland wrote:
> On Thu, Oct 29, 2009 at 09:41:12PM +0000, Mindaugas Rasiukevicius wrote:
>  > David Holland <dholland-tech%netbsd.org@localhost> wrote:
>  > >  if (oldspl == highest && cur->l_iplcounts[highest-1] == 0) {
>  > >     while (highest > 0 && cur->l_iplcounts[highest-1] == 0) {
>  > >        highest--;
>  > >     }
>  > 
>  > It would probably be better to use bitmask and ffs() right here, to avoid
>  > looping through priorities.
> 
> Yes, except that you need the counts. Maintaining a mask as well as
> the counts is probably more expensive than executing this loop once in
> a while.
> 
>  > Anyway, this is some overhead in low level
>  > primitive to support very rare cases.   I do not think it is worth.  Also,
>  > the case in our TTY locking should be fixed be revamping it (i.e. having
>  > locking in drivers).
> 
> I'm not sure it's as rare as all that; it just mostly doesn't overtly
> fail. Instead you end up silently running at a higher IPL than
> necessary, and that buys you longer interrupt latencies and more
> dropped packets and all that.

I have done extensive testing to on SPL behaviour and can confidently say
that with our current setup it simply does not matter unless you have a
very poorly written bit of code - in which case that's your problem, not
the interrupt masking system.


Home | Main Index | Thread Index | Old Index