lkml.org 
[lkml]   [2006]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 10/33] readahead: support functions
    Wu Fengguang wrote:

    >+#ifdef CONFIG_ADAPTIVE_READAHEAD
    >+
    >+/*
    >+ * The nature of read-ahead allows false tests to occur occasionally.
    >+ * Here we just do not bother to call get_page(), it's meaningless anyway.
    >+ */
    >+static inline struct page *__find_page(struct address_space *mapping,
    >+ pgoff_t offset)
    >+{
    >+ return radix_tree_lookup(&mapping->page_tree, offset);
    >+}
    >+
    >+static inline struct page *find_page(struct address_space *mapping,
    >+ pgoff_t offset)
    >+{
    >+ struct page *page;
    >+
    >+ read_lock_irq(&mapping->tree_lock);
    >+ page = __find_page(mapping, offset);
    >+ read_unlock_irq(&mapping->tree_lock);
    >+ return page;
    >+}
    >
    >

    Meh, this is just open-coded elsewhere in readahead.c; I'd either
    open code it, or do a new patch to replace the existing callers.
    find_page should be in mm/filemap.c, btw (or include/linux/pagemap.h).

    >+
    >+/*
    >+ * Move pages in danger (of thrashing) to the head of inactive_list.
    >+ * Not expected to happen frequently.
    >+ */
    >+static unsigned long rescue_pages(struct page *page, unsigned long nr_pages)
    >
    >

    Should probably be in mm/vmscan.c

    --

    Send instant messages to your online friends http://au.messenger.yahoo.com

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

    \
     
     \ /
      Last update: 2006-05-25 07:15    [W:0.024 / U:94.456 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site