Re: Deadlock problems

From: Andrew Morton
Date: Mon May 03 2004 - 13:19:05 EST


Jan Kara <jack@xxxxxx> wrote:
>
> Hi Andrew!
>
> I've found hard to fix problem causing deadlock - call path is
> generally following:
> some operation -> quota code -> read/write quota -> vfs -> needs a page ->
> shrink caches -> free inodes -> free quota -> Ouch... (we need to acquire
> some lock which is already held by the quota code)
>
> I hope I can fix the problems with quota locks but there's also a
> problem that transaction can be already started when we want to free
> some inodes etc.

yes, there could be any number of deadlocks due to this.

> So I'd like to ask: Is there somewhere documented what
> can/cannot hold a caller using GFP_FS?

I don't understand the question, sorry. But memory allocations while
holding fs locks should not be using __GFP_FS.

> One a bit hacky solution would also be to clear GFP_FS from i_mapping
> of quotafile inode. Do you think that is a reasonable solution?

yes, I think that is a reasonable expression of what is going on.

It would be better to rework the filesystems so that it is not necessary,
but I assume that is complex.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/