From owner-freebsd-geom@FreeBSD.ORG Tue Jul 27 17:28:02 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E54B10656A3 for ; Tue, 27 Jul 2010 17:28:02 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 239EB8FC23 for ; Tue, 27 Jul 2010 17:28:01 +0000 (UTC) Received: by fxm13 with SMTP id 13so804098fxm.13 for ; Tue, 27 Jul 2010 10:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=fJocuIMqNGCUeszSKAQ1bAFp/5deRx298ZlOh9CHASE=; b=Yijqtoei2yCcvaXT+NeuuQn5sXni48FeNeWAvYriZw93oGtBzz9YqnyULfrE+hQ/9f z0DfwX37VYlDmFLfxKP1PLumWUlQSTA4jNCYN7CZJk8xM2X1V3772WwuOBFbFOxjcdBx 8C1vmLOcFPHpnxcQQDPsU990x9QULu+mQtkTQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=FhM0SgShotH1ra2Plkhs3RfgUiZl9Krun1MHOGU4NJBHbw1TBBhj2ES/SK1b9vXqhe afIIFMaM/isuVYDDzGRumwDnM4gEwF5i1cvm+u1VLiELoLQjrVRBFYlrgkQ4uMUqEVLl EzgXVD+hQ0zPRAPfhxAhgEjpdkLhCDk+0AVF8= Received: by 10.223.108.204 with SMTP id g12mr8439174fap.21.1280251680962; Tue, 27 Jul 2010 10:28:00 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id w11sm2074776fao.13.2010.07.27.10.27.59 (version=SSLv3 cipher=RC4-MD5); Tue, 27 Jul 2010 10:27:59 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C4F171C.9010106@FreeBSD.org> Date: Tue, 27 Jul 2010 20:27:56 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: =?UTF-8?B?TWFyaXVzIE7DvG5uZXJpY2g=?= References: <4C4ED619.7050305@FreeBSD.org> <27237.1280241532@critter.freebsd.dk> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Poul-Henning Kamp , freebsd-geom@freebsd.org Subject: Re: Hyperactive g_event thread X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2010 17:28:02 -0000 Marius NĂ¼nnerich wrote: > On Tue, Jul 27, 2010 at 18:07, Marius NĂ¼nnerich wrote: >> On Tue, Jul 27, 2010 at 16:38, Poul-Henning Kamp wrote: >>> In message <4C4ED619.7050305@FreeBSD.org>, Alexander Motin writes: >>>> Poul-Henning Kamp wrote: >>>> I have already removed alike timeouts on up/down threads and it indeed >>>> was safe there. But are you really sure about this specific case? Cause >>>> I'm not. Up/down threads using msleep and checking lack of work after >>>> dropping/grabbing lock. Event thread instead does several tasks, drops >>>> lock few times between them and uses tsleep(). I would say there should >>>> be a bunch of race conditions. >>> Quite likely, I didn't say it would be a trivial thing to remove >>> that workaround :-) >> >> I was running with a patch that removed the timeout for a while like 2 >> years ago. Albeit not with high load. Worked fine at that time, I will >> search for the patch when I'm back home later today. >> > Here it is: > http://lists.freebsd.org/pipermail/freebsd-geom/2008-December/003200.html > The mail is quite old now, I don't know if the patch still applies. > Will check that if I can find the time. I would be happy to see this > committed after all this time :) Yes, I was thinking about something like that. Patch mostly applies now and even builds. May be I would just put there sx_sleep() instead if msleep(), as topology_lock is sx. Could somebody to review this and tell how correct is to not drop topology lock between events handling and could there be places where g_wait_event woken without holding topology_lock? -- Alexander Motin