From owner-freebsd-arch@FreeBSD.ORG Sun Jan 30 09:16:55 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DABA106566B for ; Sun, 30 Jan 2011 09:16:55 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.c2i.net [212.247.154.98]) by mx1.freebsd.org (Postfix) with ESMTP id 9056D8FC15 for ; Sun, 30 Jan 2011 09:16:53 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=wd7fLirDSts22yawIUsTeMUS9lsm8Llc0grT6RvpTjU= c=1 sm=1 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=Z1UOoeQKCxYwIfKCYq0A:9 a=65sFI8CvKIg5ZxEf6SgA:7 a=L5yuOhafPm41-rTcNX_ie-2hqpgA:4 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 80488029; Sun, 30 Jan 2011 10:16:52 +0100 From: Hans Petter Selasky To: freebsd-arch@freebsd.org Date: Sun, 30 Jan 2011 10:16:55 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <201101291032.35544.hselasky@c2i.net> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101301016.55633.hselasky@c2i.net> Cc: Subject: Re: ofed merge soon X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jan 2011 09:16:55 -0000 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? --HPS