On Mon, Sep 07, 2015 at 08:47:54PM -0400, Theodore Ts'o wrote: > On Tue, Sep 08, 2015 at 12:22:06AM +0100, Al Viro wrote: > > You don't want e.g. to have allocation request triggering an attempt to write > > a dirty page on a shared mapping of a file from your fs while you are holding > > a mutex that would block that attempt *and* waiting for a allocation to > > succeed. > > Mike, > > To be more explicit --- any code in your writepage/writepages > function, or code called from your writepage/writepages function has > to do all of its allocations using GFP_NOFS. Otherwise, you can end > up in a recursion where an attempt to writeback a page can trigger the > VM system to try to writeback either the same page or another page, > and then Hilarity Ensues, with either the code self-deadlocking, or in > the best case, the kernel stack getting overrun. FWIW, lockdep will issue warnings on these potentially recursive allocations, which can help you find them without having to first deadlock the machine. Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html