Re: panic upon kldunload snd_ich (lor # 159)

From: Ariff Abdullah (skywizard_at_MyBSD.org.my)
Date: 09/15/05

  • Next message: Eric Anholt: "Re: Xorg core dump ! FreeBSD 6.0 Beta4"
    Date: Thu, 15 Sep 2005 14:35:40 +0800
    To: pyunyh@gmail.com, minimarmot@gmail.com
    
    

    On Thu, 15 Sep 2005 13:34:48 +0900
    Pyun YongHyeon <pyunyh@gmail.com> wrote:
    > On Thu, Sep 15, 2005 at 11:46:53AM +0800, Ariff Abdullah wrote:
    > > On Thu, 15 Sep 2005 10:45:09 +0900
    > > Pyun YongHyeon <pyunyh@gmail.com> wrote:
    > > >
    > > > That would be supposed to fix the LOR message. But I'd like to
    > > > keep lock ordering between snd_mutex and sndstat_lock. Since
    > > > sndstat_read() could be called at any time there is an implicit
    > > > lock order. I think switching to sx lock from mutex in sndstat
    > > > code was to allow uiomove with lock held. IMO, it would be even
    > > > better to rewrite sndstat_read() without using uiomove such that
    > > > it can also use standard mutex rather than sx lock.
    > > >
    > > I tend to agree with you. Since that sndstat_busy() isn't enough,
    > > how about we acquire the entire sndstat so nobody can monkey with
    > > it (as the proposed / attached diff) and at the same time avoiding
    > > this LOR message. It seems much better rather than locking sndstat
    > > after sndstat_busy() and much of pcm_unregister() procedures, only
    > > to find out that somebody acquire it within that moment.
    > >
    >
    > I didn't try the patch but it looks good to me. :-)
    > If you have more time would you please fix race in sndstat_open()?
    >
    > Minor note : I think it is better to use sx_xunlock ranther than
    > sx_unlock as sx_xunlock clearly indicates which type of locks held.
    >
    o my, that was a mass typo. Will fix it.

    --
    Ariff Abdullah
    MyBSD
    http://www.MyBSD.org.my (IPv6/IPv4)
    http://staff.MyBSD.org.my (IPv6/IPv4)
    http://tomoyo.MyBSD.org.my (IPv6/IPv4)
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Eric Anholt: "Re: Xorg core dump ! FreeBSD 6.0 Beta4"