From owner-freebsd-current@FreeBSD.ORG Thu Aug 19 09:32:16 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42D0B1065674 for ; Thu, 19 Aug 2010 09:32:16 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id EE5498FC21 for ; Thu, 19 Aug 2010 09:32:15 +0000 (UTC) Received: by qwg5 with SMTP id 5so1688655qwg.13 for ; Thu, 19 Aug 2010 02:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=YPZU7k1gyB0vg7BFPBRHUL8YRH1m0QohJjIc1mw+0QI=; b=VMJfsOyFQDTVYjTxIQnKCKLlFK0ghjcYkjWBNACGVz9MShFUNjcL41HyNgc0R2l63C wVtvoReqfwijZpuMC1xfbBLw+KVKeGTVDJEch8MZcmv42fnI6YjEIm+m2SrjI5LqtNz6 D92jWLGkiOa2OPU2DIZYAcHmRAjkE9O24mNok= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=QykA8GoRLscm6YUt7PJRfu/WlMKoZr/pZoF6m9BlJ0NivjLjVPlfPS487CKWSR9/px /DwY4MQiy5btmdwos4Yw3n3/becOk6mxMCtme7HCkuKL7oj4D8EBdkE4usOKc2l3FmLm znFAjREdocw0RfkC2dRVDUau/6P3AWSvWLjC4= MIME-Version: 1.0 Received: by 10.229.231.3 with SMTP id jo3mr6978025qcb.21.1282210335168; Thu, 19 Aug 2010 02:32:15 -0700 (PDT) Received: by 10.229.31.12 with HTTP; Thu, 19 Aug 2010 02:32:15 -0700 (PDT) In-Reply-To: <699547258.794609.1282176294566.JavaMail.root@erie.cs.uoguelph.ca> References: <699547258.794609.1282176294566.JavaMail.root@erie.cs.uoguelph.ca> Date: Thu, 19 Aug 2010 13:32:15 +0400 Message-ID: From: pluknet To: Rick Macklem Content-Type: text/plain; charset=ISO-8859-1 Cc: Kostik Belousov , FreeBSD Current Subject: Re: LOR on nfs: vfs_vnops.c:301 kern_descrip.c:1580 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2010 09:32:16 -0000 On 19 August 2010 04:04, Rick Macklem wrote: >> On 18 August 2010 12:07, pluknet wrote: >> > On 17 August 2010 20:04, Kostik Belousov wrote: >> > >> >> >> >> Also please take a note of the John' suggestion to use the taskqueue. >> > >> > I decided to go this road. Thank you both. >> > Now I do nfs buildkernel survive and prepare some benchmark results. >> > >> > I'm away from home, so I can only do email and haven't looked at the > patch, but I think you might want to consider avoiding the malloc() > failure by calling malloc(... M_WAITOK); before grabbing the mutex. > Then, set the pointer to NULL if you use it and free it at the end > (I tend to test for non-NULL before calling free(), but others have > pointed out that this isn't necessary.) > > I believe this is called "Dykstra's technique", although I used it > a lot before I found out it had been published. > > I think handling the case where malloc() fails correctly could > be difficult which is why I suggested the above. > > Good luck with the patch, rick Nice :) I need to step back and get a timeout to re-think how to use this technique. -- wbr, pluknet