[PATCH] xfs: Remove the entries from the queue while waking them up.
Christoph Hellwig
hch at infradead.org
Tue Nov 22 04:23:31 CST 2011
On Mon, Nov 21, 2011 at 01:11:41PM -0600, Chandra Seetharaman wrote:
> The code does not assume that it got the space when it wakes up. After
> every wake up it does check for free bytes available and compares to
> required bytes before granting the bytes to itself. (IOW, after waking
> up it behaves the same way as the lock-less case)
>
> As Dave pointed, I can see only the signal case to be effecting this
> scenario. With that case in mind, I can see one change required to my
> patch: Add the ticket to the list the second time (in a function) only
> if the t_queue is not empty.
You can still leak with the process added to the queue if you get a
wakeup and there is space available. And your second patch now has
to re-add conditional add to queue band aids that the first one so
nicely removed. My version of that patch has the big advantage of
actually making the whole scheme mirror that of a wait queue. In fact
we could use workqueues and the helpers for it later (except for the
waker side, which is special).
More information about the xfs
mailing list