Re: [RFC][PATCH 1/3] radix priority search tree - objrmap complexity fix

From: Andrew Morton (akpm_at_osdl.org)
Date: 04/02/04

  • Next message: Tomas Vinar: "bug: hid module crashed"
    Date:	Thu, 1 Apr 2004 16:52:16 -0800
    To: Andrea Arcangeli <andrea@suse.de>
    
    

    Andrea Arcangeli <andrea@suse.de> wrote:
    >
    > > @@ -149,8 +149,14 @@ int rw_swap_page_sync(int rw, swp_entry_
    > > };
    > >
    > > lock_page(page);
    > > -
    > > + /*
    > > + * This library call can be only used to do I/O
    > > + * on _private_ pages just allocated with alloc_pages().
    > > + */
    > > BUG_ON(page->mapping);
    > > + BUG_ON(PageSwapCache(page));
    > > + BUG_ON(PageAnon(page));
    > > + BUG_ON(PageLRU(page));
    > > ret = add_to_page_cache(page, &swapper_space, entry.val, GFP_KERNEL);
    > > if (unlikely(ret)) {
    > > unlock_page(page);
    >
    >
    > the good thing is that I believe this fix will make it work with the -mm
    > writeback changes. However this fix now collides with anon-vma since
    > swapsuspend passes compound pages to rw_swap_page_sync and
    > add_to_page_cache overwrites page->private and the kernel crashes at the
    > next page_cache_get() since page->private is now the swap entry and not
    > a page_t pointer.

    Why do swapcache pages have their ->index in ->private? That should have
    been commented.

    (hugetlb pages are also added to pagecache, and they are compound, but the
    code looks OK).

    > So I guess I've a good reason now to giveup trying to
    > add the page to the swapcache, and to just fake the radix tree like I
    > did in my original fix. That way the page won't be swapcache either so I
    > don't even need to use get_page to avoid remove_exclusive_swap_page to
    > mess with it.

    The BUG_ON in radix_tree_tag_set() is a fairly arbitrary sanity check:
    "hey, why are you tagging a non-existent item?".

    We could simply replace it with a `return NULL;'?
    -
    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/


  • Next message: Tomas Vinar: "bug: hid module crashed"

    Relevant Pages

    • Re: Power Management Update
      ... I encountered this problem by having an IDE CD-ROM, ... He mentioned producing a cleaner patch, but this should at least fix the ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] fs/fcntl.c : dont test unsigned value for less than zero
      ... I think the real problem here is that 'arg' ... architecture's ptrace code could easily make use of the latter, ... But be careful not to "fix up" ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Testing RC kernels [KORG]
      ... Can someone with access to the html for kernel.org please fix that? ... We've had several messages now complaining about this. ... Copyright 2005 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.4.22-rc2 ext2 filesystem corruption
      ... > # Without this fix it mistakenly assumes that the empty drive slot ... the 64K cylinders problem) I know I saw transfer speeds greater than ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: deadlocks caused by ext3/reiser dirty_inode calls during do_mmap_pgoff
      ... The patch tries to fix both reiserfs and generic_file_write. ... int status; ... * returns zero on success, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)