From owner-freebsd-arch@FreeBSD.ORG Sun Jan 30 07:41:49 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 090F3106566C; Sun, 30 Jan 2011 07:41:49 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id AEAA78FC18; Sun, 30 Jan 2011 07:41:48 +0000 (UTC) Received: by yxh35 with SMTP id 35so1699795yxh.13 for ; Sat, 29 Jan 2011 23:41:47 -0800 (PST) Received: by 10.150.199.15 with SMTP id w15mr3853838ybf.400.1296373307828; Sat, 29 Jan 2011 23:41:47 -0800 (PST) Received: from [10.0.1.198] ([72.253.42.56]) by mx.google.com with ESMTPS id u5sm1213702yba.22.2011.01.29.23.41.44 (version=SSLv3 cipher=RC4-MD5); Sat, 29 Jan 2011 23:41:46 -0800 (PST) Date: Sat, 29 Jan 2011 21:44:45 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Hans Petter Selasky In-Reply-To: <201101291032.35544.hselasky@c2i.net> Message-ID: References: <201101281009.32986.jhb@freebsd.org> <201101291032.35544.hselasky@c2i.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@freebsd.org 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 07:41:49 -0000 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. Thanks, Jeff > > --HPS >