Re: 2.4.0-test10-pre3:Oops in mm/filemap.c:filemap_write_pa

From: Trond Myklebust (trond.myklebust@fys.uio.no)
Date: Thu Oct 19 2000 - 20:28:03 EST


>>>>> " " == Linus Torvalds <torvalds@transmeta.com> writes:

> Btw, that "invalidate_inode_pages()" thing is just wrong - we
> can't just remove pages that are mapped etc, because that would
> result in no end of fun aliasing problems etc.

<snip>
> How about adding a test in invalidate_inode_pages() like

> /* We cannot invalidate a locked page */ if
> (TryLockPage(page))
> continue;

> + /* We cannot invalidate a page that is in use */
> + if (page_count(page) != 1) {
> + UnlockPage(page);
> + continue;
> + }
> +
> __lru_cache_del(page); __remove_inode_page(page);

The problem here is that NFS pages have 3 rather than 2 states:
  1) mmapped & correct.
  2) mmapped & incorrect. (but possibly dirty)
  3) Unmapped

For case 1), we clearly want to have the page in inode->i_mapping.
For cases 2) & 3) we don't.

However for case 2) we still have a weak association to the inode
itself, and we want to be able to reference inode metadata etc. Would
it make sense then to remove these pages from i_mapping, but to hang
them onto a new struct address_space (call it i_unmapped for want of a
better name)?

That would allow you to keep a consistent state for the page, while
still allowing you to 'invalidate' it (by removing it from the
i_mapping) and hence maintain a consistent cache.

invalidate_inode_pages() would then reduce to

   remove_page_from_inode_queue(page);
   remove_page_from_hash_queue(page);
   if (page_count(page))
         add_page_to_inode_unmapped(page);

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



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:17 EST