Date: Sun, 30 Jan 2011 04:29:22 -0800 From: Julian Elischer <julian@freebsd.org> To: Daniel Eischen <deischen@freebsd.org> Cc: freebsd-arch@freebsd.org, Hans Petter Selasky <hselasky@c2i.net> Subject: Re: ofed merge soon Message-ID: <4D4559A2.7040601@freebsd.org> In-Reply-To: <Pine.GSO.4.64.1101300710520.20802@sea.ntplx.net> References: <alpine.BSF.2.00.1101271653470.1412@desktop> <201101291032.35544.hselasky@c2i.net> <alpine.BSF.2.00.1101292143010.1412@desktop> <201101301016.55633.hselasky@c2i.net> <Pine.GSO.4.64.1101300710520.20802@sea.ntplx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 1/30/11 4:12 AM, Daniel Eischen wrote: > On Sun, 30 Jan 2011, Hans Petter Selasky wrote: > >> On Sunday 30 January 2011 08:44:45 Jeff Roberson wrote: >>> On Sat, 29 Jan 2011, Hans Petter Selasky wrote: >>>> Hi, >>>> >>>> Just a comment: >>>> >>>> + >>>> +#define >>>> DEFINE_MUTEX(lock) \ >>>> + mutex_t >>>> lock; \ >>>> + SX_SYSINIT_FLAGS(lock, &(lock).sx, "lnxmtx", SX_NOWITNESS) >>>> + >>>> +static inline void >>>> +linux_mutex_init(mutex_t *m) >>>> +{ >>>> + >>>> + memset(&m->sx, 0, sizeof(m->sx)); >>>> + sx_init_flags(&m->sx, "lnxmtx", SX_NOWITNESS); >>>> +} >>>> + >>>> +#define mutex_init linux_mutex_init >>>> >>>> I see you workaround the fact that Linux does not destroy any >>>> mutexes by >>>> disabling witness. Do you have any plan to upgrade the Linux 3rd >>>> party >>>> code to destroy mutexes? >>> >>> It introduces too many diffs that are difficult to maintain. I don't >>> think it's viable. One option would be to tag the memory linux >>> uses so >>> that when it's freed we reclaim any locks in it. You could scan the >>> witness tables for pointers within the free'd region fairly >>> easily. It >>> wouldn't be pretty though. >> >> How about requiring that Linux code, once imported, must destroy >> it's mutexes? > > Or add a mutex_destroy for all OS's, and make it a noop > for Linux. Then there are no diffs to maintain... the upstream source is linux only code and they do not accept non linux patches.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D4559A2.7040601>