Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jul 2012 00:15:45 +0200
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-fs@freebsd.org
Subject:   wdrain hang
Message-ID:  <jtktul$6j3$1@dough.gmane.org>

next in thread | raw e-mail | index | archive | help
Hello,

I started writing a tutorial on ggate and have encountered a bug I
thought was solved long ago, but aparrently it was only worked around:

http://ivoras.net/blog/tree/2012-07-06.writing-a-geom-gate-module-part-4.html

The problem is that writing to a file system from within a ggate module
(and a similar thing used to happen with md(4)) hangs when a certain
amount of data gets in-flight.

I think this happens when the amount of in-flight data from the upper
layer (i.e. the file system sitting on top a ggate device) + the amount
of data on the lower layer (the file system to which the userland ggate
module writes) gets greater than hirunningspace, which somehow causes a
 deadlock in waitrunningbufspace().

I don't understand exactly how this deadlock happens, since it looks
like one of the processes which does the writing (either the one writing
to the ggate module or the ggate module itself) should probably hang in
mtx_lock() but apparently both hang in the "wdrain" state. Can someone
explain what happens here?

So far this issue has been worked around by using O_DIRECT, but in the
case of this tutorial I'm doing it's not possible, so I'm wondering if
there is another workaround?





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?jtktul$6j3$1>