xfs
[Top] [All Lists]

TAKE 797457 - Swap deadlock bug

To: ananth@xxxxxxxxxxxxxxxxxxxx
Subject: TAKE 797457 - Swap deadlock bug
From: pv@xxxxxxxxxxxxxxxxxxxxxx (ananth@xxxxxxxxxxxx)
Date: Tue, 5 Sep 2000 20:30:03 -0700 (PDT)
Cc: linux-xfs@xxxxxxxxxxx, linux-xfs@xxxxxxxxxxx
Reply-to: sgi.bugs.xfs@xxxxxxxxxxxxxxxxx
Sender: owner-linux-xfs@xxxxxxxxxxx
 Submitter : ananth                   *Status : closed                      
 Assigned Engineer : ananth           *Fixed By : ananth                    
*Fixed By Domain : engr               *Closed Date : 09/05/00               
 Priority : 2                         *Modified Date : 09/05/00             
*Modified User : ananth               *Modified User Domain : engr          
*Fix Description :
From: ananth ananthanarayanan <ananth@waco> (TAKE)
Date: Sep 05 2000 08:30:03PM
[pvnews version: 1.71]
----------------------------

Date:  Tue Sep  5 20:26:55 PDT 2000
Workarea:  waco.engr.sgi.com:/build1/ananth/xfs-new

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


Modid:  2.4.0-test1-xfs:slinx:73739a
linux/mm/vmscan.c - 1.35
linux/mm/filemap.c - 1.53
linux/include/linux/fs.h - 1.57
linux/fs/xfs/linux/xfs_iops.c - 1.66
        - Workaround for swap deadlock problem.
Description :
In general, the kernel
shouldn't be swapping a page from a file on
which a write is in progress ... following is
a old backtrace but doio-2threads can reproduce
the problem at will on a 64MB system.


-------------
[1]kdb> btp 569
    EBP       EIP         Function(args)

.....


==========================
ADDITIONAL INFORMATION (ADD)
From: ananth@engr (BugWorks)
Date: Sep 05 2000 05:22:58PM
==========================


Following is a workaround for this bug:
basically the scheme uses the fact that
writepage can return failure in the swapcase.

I'll do some more testing and check-in later.

-----------
===========================================================================
linux/fs/xfs/linux/xfs_iops.c
===========================================================================

802c802
< int
---
> STATIC int
805c805,806
<       struct page *page)
---
>       struct page *page,
>       int wait)
821a823,825
>               if (!wait)
>                       return -EBUSY;
> 
832a837,852
> int
> linvfs_write_full_page_sync(
>       struct file *filp,
>       struct page *page)
> {
>       return(linvfs_write_full_page(filp, page, 1));
> }
> 
> int
> linvfs_write_full_page_async(
>       struct file *filp,
>       struct page *page)
> {
>       return(linvfs_write_full_page(filp, page, 0));
> }
> 
910c930
<   writepage:          linvfs_write_full_page,
---
>   writepage:          linvfs_write_full_page_sync,
913a934
>   writepage_async:    linvfs_write_full_page_async,

===========================================================================
linux/include/linux/fs.h
===========================================================================

364a365
>       int (*writepage_async)(struct file *, struct page *);

===========================================================================
linux/mm/filemap.c
===========================================================================

1592c1592,1605
<       return page->mapping->a_ops->writepage(file, page);
---
>       if (wait) {
>               return page->mapping->a_ops->writepage(file, page);
>       } else {
>               int (*wpf)(struct file *, struct page *);
> 
>               /*
>                * If async write is supported call that
>                * otherwise use synchronous write.
>                */
>               wpf = page->mapping->a_ops->writepage_async;
>               if (!wpf)
>                       wpf = page->mapping->a_ops->writepage;
>               return(wpf(file, page));
>       }

===========================================================================
linux/mm/vmscan.c
===========================================================================

414c414,419
<                       if (!ret)
---
>                       /*
>                        * Kludge for XFS: if swap_out's write page
>                        * returned EBUSY due to filesystem locking
>                        * issues, be forgiving.
>                        */
>                       if (!ret || ret == -EBUSY)
-----------------

<Prev in Thread] Current Thread [Next in Thread>
  • TAKE 797457 - Swap deadlock bug, ananth@xxxxxxxxxxxx <=