On Tue, 26 Dec 2000, Rajagopal Ananthanarayanan wrote:
> [ just getting back to mail after a vacation ]
> Indeed this is a problem; the patch I've been sending out
> pushes the balance_dirty call after all xfs locks have been
> dropped. If you haven't seen the patch, I can send it again.
> Even with that patch, we have a different issue. All write paths
> take the xfs iolock (think of it as a inode lock) before checking
> the pagecache for a given page. If the page is not in the pagecache
> then it needs to be allocated - see __pagebuf_do_delwri() calls
> to grab_cache_page(). This allocation can sleep for bdflush().
> However, bdflush can call prune_dcache(), which inturn can wait for
> this inode's iolock. I don't have a fix for this problem.
> In general, it appears that any filesystem (FS) code that allocates
> memory needs to be very careful, since it can wait for bdflush;
> the latter, in turn, can do FS related activity that needs FS locks.
> Any suggestions?
The correct solution to your problem is to not pass __GFP_IO in the
allocation flag passed to __alloc_pages.
This way the allocation routines will not try to do any kind of IO and
will not wait for kswapd.
Its pretty easy to change page_cache_alloc() to pass our own
allocation flag and fix this problem.
I'm going home soon but I'll do that tomorrow if you're not going to do