Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Oct 2010 20:43:01 +0300
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        Alexander Motin <mav@FreeBSD.org>
Cc:        Marius =?utf-8?Q?N=C3=BCnnerich?= <marius@nuenneri.ch>, Poul-Henning Kamp <phk@phk.freebsd.dk>, freebsd-geom@freebsd.org
Subject:   Re: Hyperactive g_event thread
Message-ID:  <20101021174301.GA1381@a91-153-123-205.elisa-laajakaista.fi>
In-Reply-To: <4C4F171C.9010106@FreeBSD.org>
References:  <4C4ED619.7050305@FreeBSD.org> <27237.1280241532@critter.freebsd.dk> <AANLkTi=uRPV2T0=t_1s=Jc4PmBtai=__HqhCtYpiDdTQ@mail.gmail.com> <AANLkTikvV4oymBBA%2B_0zbzd_edS8dRfqqJRODE0989%2Bn@mail.gmail.com> <4C4F171C.9010106@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Hi,

On 2010-07-27, Alexander Motin wrote:
> Marius NĂ¼nnerich wrote:
> > On Tue, Jul 27, 2010 at 18:07, Marius NĂ¼nnerich <marius@nuenneri.ch> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101021174301.GA1381>