Hyperactive g_event thread

Alexander Motin mav at FreeBSD.org
Tue Jul 27 12:51:52 UTC 2010


Poul-Henning Kamp wrote:
> In message <4C4E919C.2060009 at 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


More information about the freebsd-geom mailing list