And it does get caught on that in small memory machines. This
deadlock is easily reproducable on a 32MB UML instance. I haven't yet
tested with the per-bdi patches, but I don't think they make a
difference in this case.
I think nr_dirty is totally irrelevant. Since we don't care about
case 1), and in case 2) nr_dirty doesn't play any role.
Why?
Sure, if we do need to globally limit the number of under-writeback
pages, then I think we need to do it independently of the dirty
accounting.
Miklos
-