public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* __lock_page calls run_task_queue(&tq_disk) unecessarily?
@ 2001-02-19 23:02 Marcelo Tosatti
  2001-02-20  1:05 ` Marcelo Tosatti
  0 siblings, 1 reply; 5+ messages in thread
From: Marcelo Tosatti @ 2001-02-19 23:02 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: lkml


Hi Linus,

Take a look at __lock_page:

static void __lock_page(struct page *page)
{
        struct task_struct *tsk = current;
        DECLARE_WAITQUEUE(wait, tsk);

        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);
                        schedule();
                        continue;
                }
                if (!TryLockPage(page))
                        break;
        }
        tsk->state = TASK_RUNNING;
        remove_wait_queue(&page->wait, &wait);
}


Af a process sleeps in __lock_page, sync_page() will be called even if the
page is already unlocked. (block_sync_page(), the sync_page routine for
generic block based filesystem calls run_task_queue(&tq_disk)).

I don't see any problem if we remove the run_task_queue(&tq_disk) and put
sync_page(page) there instead, removing the other sync_page(page) at the
beginning of the loop.

Comments?


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-02-20 18:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-19 23:02 __lock_page calls run_task_queue(&tq_disk) unecessarily? Marcelo Tosatti
2001-02-20  1:05 ` Marcelo Tosatti
2001-02-20 16:00   ` Andrea Arcangeli
2001-02-20 17:11     ` Linus Torvalds
2001-02-20 18:10       ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox