xfs
[Top] [All Lists]

TAKE - Locking fixes for the xfs I/O path

To: unlisted-recipients:; (no To-header on input)
Subject: TAKE - Locking fixes for the xfs I/O path
From: Steve Lord <lord@xxxxxxx>
Date: Tue, 23 Jan 2001 13:56:34 -0600
Sender: owner-linux-xfs@xxxxxxxxxxx
This fixes xfs_strategy so that it does not attempt to allocate space
for a delalloc extent when that extent has been truncated out of the
file. This was panicing debug kernels as it became a true allocation
request and the transaction had no associated space allocation. This 
will protect against truncations, but not against someone doing
hole punching which may show up with dmapi.

Also remove the rwlock from the page read and write paths. This removes
some deadlocks, and lessens contention. The writepage path was safe, the
readpage path needed to cope with racing with a delalloc extent creation.

Finally change the flags on memory allocations which happen under filesystem
locks (usually the xfs inode lock) to use GFP_BUFFER rather than GFP_KERNEL.
This stops the memory reclaim threads from pushing back into the filesystem
again to free memory and deadlocking.

I have not yet managed to deadlock a system due to memory pressure with
these changes. dbench throughput also appears to improve.

Date:  Tue Jan 23 11:48:45 PST 2001
Workarea:  128.162.184.86:/src/lord/xfs-linux.2.4

The following file(s) were checked into:
  bonnie.engr.sgi.com:/isms/slinx/2.4.x-xfs


Modid:  2.4.x-xfs:slinx:82766a
linux/fs/xfs/linux/xfs_lrw.c - 1.73
        - Change strategy to atomically restrain extent conversions to the 
current
          last block in the extents, avoiding the problem where another thread
          truncates the file during the strategy call.

linux/fs/xfs/linux/xfs_iops.c - 1.92
        - Remove linvfs_read_full_page and linvfs_write_full_page, we now go
          direct to pagebuf functions without getting the rwlock.

linux/include/linux/page_buf.h - 1.70
        - remove pagebuf_sethole prototype - it is gone.

linux/fs/pagebuf/page_buf.c - 1.47
        - For metadata pagebuf allocations use GFP_BUFFER not GFP_KERNEL, we 
often
          have a filesystem lock here and there is deadlock potential with 
GFP_KERNEL.

linux/fs/pagebuf/page_buf_io.c - 1.44
        - Cleanup read_full_page and change write_full_page to unlock the page
          on completion.

linux/fs/xfs/support/kmem.c - 1.5
        - use GFP_BUFFER not GFP_KERNEL for memory allocations to avoid possible
          deadlock from memory reclaim code pushing back into the filesystem.



<Prev in Thread] Current Thread [Next in Thread>