Re: __lock_page calls run_task_queue(&tq_disk) unecessarily?

Andrea Arcangeli (andrea@suse.de)
Tue, 20 Feb 2001 17:00:00 +0100


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/