From owner-freebsd-geom@FreeBSD.ORG Thu Oct 21 17:43:11 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 23A02106564A; Thu, 21 Oct 2010 17:43:11 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id D072C8FC12; Thu, 21 Oct 2010 17:43:10 +0000 (UTC) Received: from a91-153-123-205.elisa-laajakaista.fi (a91-153-123-205.elisa-laajakaista.fi [91.153.123.205]) by gw02.mail.saunalahti.fi (Postfix) with ESMTP id 1F7041397C0; Thu, 21 Oct 2010 20:43:03 +0300 (EEST) Date: Thu, 21 Oct 2010 20:43:01 +0300 From: Jaakko Heinonen To: Alexander Motin Message-ID: <20101021174301.GA1381@a91-153-123-205.elisa-laajakaista.fi> References: <4C4ED619.7050305@FreeBSD.org> <27237.1280241532@critter.freebsd.dk> <4C4F171C.9010106@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4C4F171C.9010106@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Marius =?utf-8?Q?N=C3=BCnnerich?= , 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: Thu, 21 Oct 2010 17:43:11 -0000 Hi, On 2010-07-27, Alexander Motin wrote: > Marius NĂ¼nnerich wrote: > > On Tue, Jul 27, 2010 at 18:07, Marius NĂ¼nnerich wrote: > >> 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. http://nuenneri.ch/freebsd/geom_tl2.patch > 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? I looked at this patch. g_post_event_x() and possibly g_orphan_provider() may wake g_wait_event up without holding the topology lock. g_do_wither() also lacks an assert for the lock although I guess that it's always held there. Thus I don't consider the patch being correct. I drafted a patch to use g_eventlock instead to protect against losing wakeups: http://people.freebsd.org/~jh/patches/geom-eventproc-sleep.diff Reviews and/or testing will be welcomed. -- Jaakko