Re: NFS got stuck on 2.3.22

Trond Myklebust (trond.myklebust@fys.uio.no)
Thu, 21 Oct 1999 22:59:34 +0200 (CEST)


>>>>> " " == Simon Kirby <sim@netnation.com> writes:

> Hrm...No, it seems to still get stuck as before. "ps l" shows
> "wait_on_page" still, too.

Yup. The invalidate_inode_pages() is causing the rpciod() task to
sleep. At the same time, it is waiting on the lock for those pages
that are being updated by requests that are sleeping on
rpciod(). Bah...

The following should fix it. Since we no longer sleep, and since we're
holding the pagecache_lock throughout the process, I think it should
be safe to revert to the 2.2.x version...

Cheers,
Trond

--- mm/filemap.c.orig Mon Oct 11 19:44:11 1999
+++ mm/filemap.c Thu Oct 21 22:54:49 1999
@@ -110,6 +110,11 @@
spin_unlock(&pagecache_lock);
}

+/*
+ * This function should not call wait_on_page!
+ * It is for invalidating those pages that are
+ * not in the process of being updated.
+ */
void invalidate_inode_pages(struct inode * inode)
{
struct page ** p;
@@ -119,12 +124,9 @@
spin_lock(&pagecache_lock);
p = &inode->i_pages;
while ((page = *p) != NULL) {
- get_page(page);
- if (TryLockPage(page)) {
- spin_unlock(&pagecache_lock);
- wait_on_page(page);
- page_cache_release(page);
- goto repeat;
+ if (PageLocked(page)) {
+ p = &page->next;
+ continue;
}
if (page_count(page) != 2)
printk("hm, busy page invalidated? (not necessarily a bug)\n");
@@ -133,10 +135,7 @@
remove_page_from_inode_queue(page);
remove_page_from_hash_queue(page);
page->inode = NULL;
- UnlockPage(page);
page_cache_release(page);
- page_cache_release(page);
-
}
spin_unlock(&pagecache_lock);
}

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