I've been working on this for quite some time. And should post again
soon. Please see the patches:
http://programming.kicks-ass.net/kernel-patches/vm_deadlock/current/
For now it requires one uses SLUB, I hope that SLAB will go away (will
save me the trouble of adding support) and I guess I ought to do SLOB
some time (if that does stay).
You'd need the first 22 patches of that series, and then call
sk_set_memalloc(sk) on the proper socket, and do some fiddling with the
reconnect logic. See nfs-swapfile.patch for examples.