Date: Thu, 27 Feb 2014 20:32:26 +0900 (JST) From: Kohji Okuno <okuno.kohji@jp.panasonic.com> To: hps@bitfrost.no Cc: jmg@funkthat.com, freebsd-current@freebsd.org, okuno.kohji@jp.panasonic.com Subject: Re: kqueue for usb_dev Message-ID: <20140227.203226.2191673573133476018.okuno.kohji@jp.panasonic.com> In-Reply-To: <530F197D.6040004@bitfrost.no> References: <20140227.190128.1827840697797583715.okuno.kohji@jp.panasonic.com> <20140227.193914.1745107579233813450.okuno.kohji@jp.panasonic.com> <530F197D.6040004@bitfrost.no>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi HPS, Your patch did not resolve the kernel panic. I think, we should check knlist_clear() before knlist_destroy(). When a device is lost suddenly, usb_dev notify to a process in usb_fifo_close() and then calls knlist_destroy(). knlist_destroy() clears knlist->kn_lock and knlist->kn_unlock. But, the process that is notified will start over kqueue_scan() after knlist_destroy(). And, in KN_LIST_LOCK(kn), the context will call NULL function (kn->knlist->kn_lock). Regards, Kohji Okuno > On 02/27/14 11:39, Kohji Okuno wrote: >> Hi HPS and John-Mark, >> >> After I changed as the following, the kernel panic does not happen. >> What do you think about this change? >> >> + knlist_clear(&f->selinfo.si_note, 0); >> knlist_destroy(&f->selinfo.si_note); >> >> Regards, >> Kohji Okuno >> > > Can you try the attached patch instead? > > --HPS >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140227.203226.2191673573133476018.okuno.kohji>