xfs
[Top] [All Lists]

Re: dm_write_invis() blocking problem

To: Mike Montour <mmontour@xxxxxxxxxx>
Subject: Re: dm_write_invis() blocking problem
From: Dean Roehrich <roehrich@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 24 Feb 2004 17:56:53 -0600
Cc: linux-xfs@xxxxxxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
Mike,

  Can you try this new version of the patch for fixing the invis I/O blocking?
This goes on top of the last patch--or, on top of the code on oss.sgi.com.

thanks

Dean


----------

===========================================================================
fs/xfs/dmapi/dmapi_xfs.c
===========================================================================

*** /usr/tmp/TmpDir.14847134-0/fs/xfs/dmapi/dmapi_xfs.c_1.31    Tue Feb 24 
14:37:17 2004
--- fs/xfs/dmapi/dmapi_xfs.c    Tue Feb 24 14:34:03 2004
***************
*** 181,188 ****
  
                if (flags & DM_FLAGS_ISEM)
                        up(&inode->i_sem);
! #ifdef DM_FLAGS_IALLOCSEM
!               else if (flags & DM_FLAGS_IALLOCSEM)
                        up_read(&inode->i_alloc_sem);
  #endif
  
--- 181,192 ----
  
                if (flags & DM_FLAGS_ISEM)
                        up(&inode->i_sem);
! #ifdef DM_FLAGS_IALLOCSEM_WR
!               if (flags & DM_FLAGS_IALLOCSEM_WR)
!                       up_write(&inode->i_alloc_sem);
! #endif
! #ifdef DM_FLAGS_IALLOCSEM_RD
!               if (flags & DM_FLAGS_IALLOCSEM_RD)
                        up_read(&inode->i_alloc_sem);
  #endif
  
***************
*** 191,198 ****
  
                if (flags & DM_FLAGS_ISEM)
                        down(&inode->i_sem);
! #ifdef DM_FLAGS_IALLOCSEM
!               else if (flags & DM_FLAGS_IALLOCSEM)
                        down_read(&inode->i_alloc_sem);
  #endif
  
--- 195,206 ----
  
                if (flags & DM_FLAGS_ISEM)
                        down(&inode->i_sem);
! #ifdef DM_FLAGS_IALLOCSEM_WR
!               if (flags & DM_FLAGS_IALLOCSEM_WR)
!                       down_write(&inode->i_alloc_sem);
! #endif
! #ifdef DM_FLAGS_IALLOCSEM_RD
!               if (flags & DM_FLAGS_IALLOCSEM_RD)
                        down_read(&inode->i_alloc_sem);
  #endif
  

===========================================================================
fs/xfs/linux-2.4/xfs_lrw.c
===========================================================================

*** /usr/tmp/TmpDir.14847134-0/fs/xfs/linux-2.4/xfs_lrw.c_1.213 Tue Feb 24 
14:37:17 2004
--- fs/xfs/linux-2.4/xfs_lrw.c  Tue Feb 24 14:33:00 2004
***************
*** 311,317 ****
            !(ioflags & IO_INVIS)) {
                int error;
                vrwlock_t locktype = VRWLOCK_READ;
!               int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG(ioflags);
  
                error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp), 
*offset, size,
                                      dmflags, &locktype);
--- 311,317 ----
            !(ioflags & IO_INVIS)) {
                int error;
                vrwlock_t locktype = VRWLOCK_READ;
!               int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags);
  
                error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp), 
*offset, size,
                                      dmflags, &locktype);
***************
*** 654,660 ****
        if ((DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_WRITE) &&
            !(ioflags & IO_INVIS) && !eventsent)) {
                loff_t          savedsize = *offset;
!               int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG(ioflags);
  
                xfs_iunlock(xip, XFS_ILOCK_EXCL);
                error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, vp,
--- 654,660 ----
        if ((DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_WRITE) &&
            !(ioflags & IO_INVIS) && !eventsent)) {
                loff_t          savedsize = *offset;
!               int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags);
  
                xfs_iunlock(xip, XFS_ILOCK_EXCL);
                error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, vp,

===========================================================================
fs/xfs/linux-2.6/xfs_lrw.c
===========================================================================

*** /usr/tmp/TmpDir.14847134-0/fs/xfs/linux-2.6/xfs_lrw.c_1.205 Tue Feb 24 
14:37:17 2004
--- fs/xfs/linux-2.6/xfs_lrw.c  Tue Feb 24 14:35:51 2004
***************
*** 739,745 ****
        if ((DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_WRITE) &&
            !(ioflags & IO_INVIS) && !eventsent)) {
                loff_t          savedsize = *offset;
!               int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG(ioflags);
  
                xfs_iunlock(xip, XFS_ILOCK_EXCL);
                error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, vp,
--- 739,745 ----
        if ((DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_WRITE) &&
            !(ioflags & IO_INVIS) && !eventsent)) {
                loff_t          savedsize = *offset;
!               int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags);
  
                xfs_iunlock(xip, XFS_ILOCK_EXCL);
                error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, vp,

===========================================================================
fs/xfs/xfs_dmapi.h
===========================================================================

*** /usr/tmp/TmpDir.14847134-0/fs/xfs/xfs_dmapi.h_1.44  Tue Feb 24 14:37:17 2004
--- fs/xfs/xfs_dmapi.h  Tue Feb 24 14:33:00 2004
***************
*** 169,175 ****
  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
  #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,21)
  /* i_alloc_sem was added in 2.4.22-pre1 */
! #define DM_FLAGS_IALLOCSEM    0x010   /* thread holds i_alloc_sem */
  #endif
  #endif
  
--- 169,176 ----
  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
  #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,21)
  /* i_alloc_sem was added in 2.4.22-pre1 */
! #define DM_FLAGS_IALLOCSEM_RD 0x010   /* thread holds i_alloc_sem rd */
! #define DM_FLAGS_IALLOCSEM_WR 0x020   /* thread holds i_alloc_sem wr */
  #endif
  #endif
  
***************
*** 176,187 ****
  /*
   *    Based on IO_ISDIRECT, decide which i_ flag is set.
   */
! #ifdef DM_FLAGS_IALLOCSEM
! #define DM_SEM_FLAG(ioflags) (((ioflags) & IO_ISDIRECT) ? \
!                             DM_FLAGS_IALLOCSEM : DM_FLAGS_ISEM)
  #else
! #define DM_SEM_FLAG(ioflags) (((ioflags) & IO_ISDIRECT) ? \
                              0 : DM_FLAGS_ISEM)
  #endif
  
  /*
--- 177,190 ----
  /*
   *    Based on IO_ISDIRECT, decide which i_ flag is set.
   */
! #ifdef DM_FLAGS_IALLOCSEM_RD
! #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \
!                             DM_FLAGS_IALLOCSEM_RD : DM_FLAGS_ISEM)
! #define DM_SEM_FLAG_WR        (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_ISEM)
  #else
! #define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \
                              0 : DM_FLAGS_ISEM)
+ #define DM_SEM_FLAG_WR        (DM_FLAGS_ISEM)
  #endif
  
  /*

===========================================================================
fs/xfs/xfs_vnodeops.c
===========================================================================

*** /usr/tmp/TmpDir.14847134-0/fs/xfs/xfs_vnodeops.c_1.619      Tue Feb 24 
14:37:17 2004
--- fs/xfs/xfs_vnodeops.c       Tue Feb 24 14:33:00 2004
***************
*** 413,420 ****
        } else {
                if (DM_EVENT_ENABLED (vp->v_vfsp, ip, DM_EVENT_TRUNCATE) &&
                    !(flags & ATTR_DMI)) {
                        code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, vp,
!                               vap->va_size, 0, AT_DELAY_FLAG(flags), NULL);
                        if (code) {
                                lock_flags = 0;
                                goto error_return;
--- 413,421 ----
        } else {
                if (DM_EVENT_ENABLED (vp->v_vfsp, ip, DM_EVENT_TRUNCATE) &&
                    !(flags & ATTR_DMI)) {
+                       int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR;
                        code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, vp,
!                               vap->va_size, 0, dmflags, NULL);
                        if (code) {
                                lock_flags = 0;
                                goto error_return;


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