On Thu, 11 Jul 2013 12:26:34 +1000 Dave Chinner <da...@fromorbit.com> wrote:
> > Just for reference. wait_on_page_writeback is issued only for memcg > > reclaim because there is no other throttling mechanism to prevent from > > too many dirty pages on the list, thus pre-mature OOM killer. See > > e62e384e9d (memcg: prevent OOM with too many dirty pages) for more > > details. The original patch relied on may_enter_fs but that check > > disappeared by later changes by c3b94f44fc (memcg: further prevent OOM > > with too many dirty pages). > > Aye. That's the exact code I was looking at yesterday and wondering > "how the hell is waiting on page writeback valid in GFP_NOFS > context?". It seems that memcg reclaim is intentionally ignoring > GFP_NOFS to avoid OOM issues. That's a memcg implementation problem, > not a filesystem or LRU infrastructure problem.... Yup, c3b94f44fc shouldn't have done that. Throttling by waiting on a specific page is indeed prone to deadlocks and has a number of efficiency problems as well: if 1,000,000 pages came clean while you're waiting for *this* page to come clean, you're left looking pretty stupid. Hence congestion_wait(), which perhaps can save us here. I'm not sure how the wait_on_page_writeback() got back in there - I must have been asleep at the time. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/