Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
authorAlex Elder <aelder@sgi.com>
Mon, 17 Oct 2011 20:42:02 +0000 (15:42 -0500)
committerAlex Elder <aelder@sgi.com>
Mon, 17 Oct 2011 20:42:02 +0000 (15:42 -0500)
Resolved conflicts:
  fs/xfs/xfs_trans_priv.h:
    - deleted struct xfs_ail field xa_flags
    - kept field xa_log_flush in struct xfs_ail
  fs/xfs/xfs_trans_ail.c:
    - in xfsaild_push(), in XFS_ITEM_PUSHBUF case, replaced
      "flush_log = 1" with "ailp->xa_log_flush++"

Signed-off-by: Alex Elder <aelder@sgi.com>
1  2 
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_inode_item.c
fs/xfs/xfs_super.c
fs/xfs/xfs_trans.h
fs/xfs/xfs_trans_ail.c
fs/xfs/xfs_trans_priv.h

Simple merge
Simple merge
Simple merge
Simple merge
@@@ -502,22 -496,7 +498,8 @@@ out_done
        if (!count) {
                /* We're past our target or empty, so idle */
                ailp->xa_last_pushed_lsn = 0;
 +              ailp->xa_log_flush = 0;
  
-               /*
-                * We clear the XFS_AIL_PUSHING_BIT first before checking
-                * whether the target has changed. If the target has changed,
-                * this pushes the requeue race directly onto the result of the
-                * atomic test/set bit, so we are guaranteed that either the
-                * the pusher that changed the target or ourselves will requeue
-                * the work (but not both).
-                */
-               clear_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags);
-               smp_rmb();
-               if (XFS_LSN_CMP(ailp->xa_target, target) == 0 ||
-                   test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags))
-                       return;
                tout = 50;
        } else if (XFS_LSN_CMP(lsn, target) >= 0) {
                /*
                 * were stuck.
                 *
                 * Backoff a bit more to allow some I/O to complete before
 -               * continuing from where we were.
 +               * restarting from the start of the AIL. This prevents us
 +               * from spinning on the same items, and if they are pinned will
 +               * all the restart to issue a log force to unpin the stuck
 +               * items.
                 */
                tout = 20;
 +              ailp->xa_last_pushed_lsn = 0;
        }
  
-       /* There is more to do, requeue us.  */
-       queue_delayed_work(xfs_syncd_wq, &ailp->xa_work,
-                                       msecs_to_jiffies(tout));
+       return tout;
+ }
+ static int
+ xfsaild(
+       void            *data)
+ {
+       struct xfs_ail  *ailp = data;
+       long            tout = 0;       /* milliseconds */
+       while (!kthread_should_stop()) {
+               if (tout && tout <= 20)
+                       __set_current_state(TASK_KILLABLE);
+               else
+                       __set_current_state(TASK_INTERRUPTIBLE);
+               schedule_timeout(tout ?
+                                msecs_to_jiffies(tout) : MAX_SCHEDULE_TIMEOUT);
+               try_to_freeze();
+               tout = xfsaild_push(ailp);
+       }
+       return 0;
  }
  
  /*
@@@ -68,14 -69,9 +69,10 @@@ struct xfs_ail 
        xfs_lsn_t               xa_target;
        struct list_head        xa_cursors;
        spinlock_t              xa_lock;
-       struct delayed_work     xa_work;
        xfs_lsn_t               xa_last_pushed_lsn;
-       unsigned long           xa_flags;
 +      int                     xa_log_flush;
  };
  
- #define XFS_AIL_PUSHING_BIT   0
  /*
   * From xfs_trans_ail.c
   */