__add_to_page_cache() - why alias check?

From: Mark Hemment (markhe@veritas.com)
Date: Mon Jul 31 2000 - 09:51:15 EST


Hi,

  I'm looking at 2.4.0-test5, but the code has been present in earlier
kernels.

  __add_to_page_cache(), in mm/filemap.c, is re-checking the page cache
after adding a new entry;

        __add_to_page_cache(...)
        {
                ....
                alias = __find_page_nolock(mapping, offset, *hash);
                if (alias != page)
                        BUG();
        }

  Obviously, this is good for debugging, but will it still be there when
2.4 becomes stable? There isn't a comment suggesting its removal.

  BTW: As new pages appear to always be added to the head of a chain in
the page cache, and searches always start at a head, the alias check isn't
much of a debug check; it should find the page just added. Given this,
the above check isn't much of a performance hit, either.

Mark

-
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/



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:33 EST