Commit 49698a6b authored by Glen Overby's avatar Glen Overby Committed by Stephen Lord

[XFS] Ensure that when we unlock a log item when there is someone waiting

for log space, we give at least one thread a chance to flush
metadata and free more log space.

SGI Modid: 2.5.x-xfs:slinx:149321a6
parent b38a168c
...@@ -3003,9 +3003,7 @@ xfs_iflush( ...@@ -3003,9 +3003,7 @@ xfs_iflush(
* see if other inodes can be gathered into this write * see if other inodes can be gathered into this write
*/ */
#ifdef DEBUG ip->i_chash->chl_buf = bp;
ip->i_chash->chl_buf = bp; /* inode clustering debug */
#endif
ch = XFS_CHASH(mp, ip->i_blkno); ch = XFS_CHASH(mp, ip->i_blkno);
s = mutex_spinlock(&ch->ch_lock); s = mutex_spinlock(&ch->ch_lock);
......
...@@ -192,9 +192,7 @@ typedef struct xfs_chashlist { ...@@ -192,9 +192,7 @@ typedef struct xfs_chashlist {
struct xfs_inode *chl_ip; struct xfs_inode *chl_ip;
xfs_daddr_t chl_blkno; /* starting block number of xfs_daddr_t chl_blkno; /* starting block number of
* the cluster */ * the cluster */
#ifdef DEBUG struct xfs_buf *chl_buf; /* the inode buffer */
struct xfs_buf *chl_buf; /* debug: the inode buffer */
#endif
} xfs_chashlist_t; } xfs_chashlist_t;
typedef struct xfs_chash { typedef struct xfs_chash {
......
...@@ -794,8 +794,9 @@ xfs_log_move_tail(xfs_mount_t *mp, ...@@ -794,8 +794,9 @@ xfs_log_move_tail(xfs_mount_t *mp,
do { do {
ASSERT(tic->t_flags & XLOG_TIC_PERM_RESERV); ASSERT(tic->t_flags & XLOG_TIC_PERM_RESERV);
if (free_bytes < tic->t_unit_res) if (free_bytes < tic->t_unit_res && tail_lsn != 1)
break; break;
tail_lsn = 0;
free_bytes -= tic->t_unit_res; free_bytes -= tic->t_unit_res;
sv_signal(&tic->t_sema); sv_signal(&tic->t_sema);
tic = tic->t_next; tic = tic->t_next;
...@@ -814,8 +815,9 @@ xfs_log_move_tail(xfs_mount_t *mp, ...@@ -814,8 +815,9 @@ xfs_log_move_tail(xfs_mount_t *mp,
need_bytes = tic->t_unit_res*tic->t_cnt; need_bytes = tic->t_unit_res*tic->t_cnt;
else else
need_bytes = tic->t_unit_res; need_bytes = tic->t_unit_res;
if (free_bytes < need_bytes) if (free_bytes < need_bytes && tail_lsn != 1)
break; break;
tail_lsn = 0;
free_bytes -= need_bytes; free_bytes -= need_bytes;
sv_signal(&tic->t_sema); sv_signal(&tic->t_sema);
tic = tic->t_next; tic = tic->t_next;
......
...@@ -4883,13 +4883,8 @@ xfsidbg_xchashlist(xfs_chashlist_t *chl) ...@@ -4883,13 +4883,8 @@ xfsidbg_xchashlist(xfs_chashlist_t *chl)
xfs_inode_t *ip; xfs_inode_t *ip;
while (chl != NULL) { while (chl != NULL) {
#ifdef DEBUG kdb_printf("hashlist inode 0x%p blkno %lld buf 0x%p",
kdb_printf("hashlist inode 0x%p blkno %Ld buf 0x%p", chl->chl_ip, (long long) chl->chl_blkno, chl->chl_buf);
chl->chl_ip, chl->chl_blkno, chl->chl_buf);
#else
kdb_printf("hashlist inode 0x%p blkno %lld",
chl->chl_ip, (long long) chl->chl_blkno);
#endif
kdb_printf("\n"); kdb_printf("\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment