From owner-freebsd-geom@FreeBSD.ORG Tue Jul 27 12:51:52 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 D8D101065674 for ; Tue, 27 Jul 2010 12:51:52 +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 66EAF8FC18 for ; Tue, 27 Jul 2010 12:51:52 +0000 (UTC) Received: by fxm13 with SMTP id 13so601873fxm.13 for ; Tue, 27 Jul 2010 05:51:51 -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=eAt4fJQ6NvrEfqLm0iSOSnIb8hCK+0ENECU9zoMGM2I=; b=Q2cvS2gMJ8hzlJRQOLmPHHa0yAnGof3GQcYklfAafhUnEmi8gZLutlViAPLge6Fne7 3ZW4nNdHE1e9aM01ARD4d2Fvd41KA12YC3svC2y8Ie2v+42xiBNfS6vn3YgHMfSPqBH+ 5QdzamzEziJ4U4pshOxkW7EkiyJd4eIUV6iZE= 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=oDVdhbk2s+rCug9p4a+dW6xRzgl4QRcvniT2KW+8cY1Cko9TlIS2MVGrjoPNfdBhXA r+JtshxNvc4ICiwS+xqlA8YT+hjYhbHtfy9aEX8U5bNenJX2HHCe3jBD9ReMbqpKrWVW QBFZaZRDEpBNmffrbYA1TDTBm4mDIaXWy0rlM= Received: by 10.223.107.211 with SMTP id c19mr8034682fap.20.1280235111272; Tue, 27 Jul 2010 05:51:51 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id r5sm1890276faq.8.2010.07.27.05.51.49 (version=SSLv3 cipher=RC4-MD5); Tue, 27 Jul 2010 05:51:50 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C4ED619.7050305@FreeBSD.org> Date: Tue, 27 Jul 2010 15:50:33 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Poul-Henning Kamp References: <24822.1280220363@critter.freebsd.dk> In-Reply-To: <24822.1280220363@critter.freebsd.dk> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: 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 12:51:52 -0000 Poul-Henning Kamp wrote: > In message <4C4E919C.2060009@FreeBSD.org>, Alexander Motin writes: > >> The only reason for doing it I >> see in imperfect locking of g_run_events() loop and respective >> tsleep()/wakeup(). So timeout there may be needed for collection >> potentially lost wakeup() events. > > Back when GEOM was written, the kernels SMP facilites were rather > rudimentary and in a few cases downright buggy, so workarounds > like that timeout were employed. > > They can hopefully safely be removed now. 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. -- Alexander Motin