Hyperactive g_event thread

Jaakko Heinonen jh at FreeBSD.org
Thu Oct 21 17:43:11 UTC 2010


Hi,

On 2010-07-27, Alexander Motin wrote:
> Marius Nünnerich wrote:
> > On Tue, Jul 27, 2010 at 18:07, Marius Nünnerich <marius at 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


More information about the freebsd-geom mailing list