Re: __lock_page calls run_task_queue(&tq_disk) unecessarily?

From: Andrea Arcangeli (andrea@suse.de)
Date: Tue Feb 20 2001 - 11:00:00 EST


On Mon, Feb 19, 2001 at 11:05:23PM -0200, Marcelo Tosatti wrote:
> --- linux/mm/filemap.c.orig Mon Feb 19 23:51:02 2001
> +++ linux/mm/filemap.c Mon Feb 19 23:51:33 2001
> @@ -611,11 +611,11 @@
>
> add_wait_queue(&page->wait, &wait);
> do {
> - sync_page(page);
> set_task_state(tsk, TASK_UNINTERRUPTIBLE);
> if (!PageLocked(page))
> break;
> - run_task_queue(&tq_disk);
> +
> + sync_page(page);
> schedule();
> } while (PageLocked(page));
> tsk->state = TASK_RUNNING;
> @@ -633,10 +633,9 @@
>
> add_wait_queue_exclusive(&page->wait, &wait);
> for (;;) {
> - sync_page(page);
> set_task_state(tsk, TASK_UNINTERRUPTIBLE);
> if (PageLocked(page)) {
> - run_task_queue(&tq_disk);
> + sync_page(page);
> schedule();
> continue;
                          ^^^^^^^^
> }

Looks perfect. I'd also remove the `continue' from __lock_page, it's wake-one
so it should get the wakeup only when it's time to lock the page down.

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 23 2001 - 21:00:22 EST