Tag: KERNEL-2-2-18-PRE11-PATCH-8 Patch: IO-wait-2 From: Andrea Arcangeli Avoid spurious unplug of the I/O queue. Index: linux/fs/buffer.c diff -u linux/fs/buffer.c:1.2 linux/fs/buffer.c:1.2.14.1 --- linux/fs/buffer.c:1.2 Thu Jul 6 22:41:37 2000 +++ linux/fs/buffer.c Wed Sep 27 23:57:09 2000 @@ -143,13 +143,14 @@ bh->b_count++; wait.task = tsk; add_wait_queue(&bh->b_wait, &wait); -repeat: - tsk->state = TASK_UNINTERRUPTIBLE; - run_task_queue(&tq_disk); - if (buffer_locked(bh)) { + do { + run_task_queue(&tq_disk); + tsk->state = TASK_UNINTERRUPTIBLE; + mb(); + if (!buffer_locked(bh)) + break; schedule(); - goto repeat; - } + } while (buffer_locked(bh)); tsk->state = TASK_RUNNING; remove_wait_queue(&bh->b_wait, &wait); bh->b_count--; Index: linux/mm/filemap.c diff -u linux/mm/filemap.c:1.4 linux/mm/filemap.c:1.4.4.1 --- linux/mm/filemap.c:1.4 Thu Sep 21 19:43:11 2000 +++ linux/mm/filemap.c Wed Sep 27 23:57:09 2000 @@ -357,13 +357,14 @@ wait.task = tsk; add_wait_queue(&page->wait, &wait); -repeat: - tsk->state = TASK_UNINTERRUPTIBLE; - sync_page(page); - if (PageLocked(page)) { + do { + sync_page(page); + tsk->state = TASK_UNINTERRUPTIBLE; + mb(); + if (!PageLocked(page)) + break; schedule(); - goto repeat; - } + } while (PageLocked(page)); tsk->state = TASK_RUNNING; remove_wait_queue(&page->wait, &wait); }