lkml.org 
[lkml]   [2006]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/33] readahead: refactor __do_page_cache_readahead()
Wu Fengguang <wfg@mail.ustc.edu.cn> wrote:
>
> Add look-ahead support to __do_page_cache_readahead(),
> which is needed by the adaptive read-ahead logic.

You'd need to define "look-ahead support" before telling us you've added it ;)

> @@ -302,6 +303,8 @@ __do_page_cache_readahead(struct address
> break;
> page->index = page_offset;
> list_add(&page->lru, &page_pool);
> + if (page_idx == nr_to_read - lookahead_size)
> + __SetPageReadahead(page);
> ret++;
> }

OK. But the __SetPageFoo() things still give me the creeps.


OT: look:

read_unlock_irq(&mapping->tree_lock);
page = page_cache_alloc_cold(mapping);
read_lock_irq(&mapping->tree_lock);

we should have a page allocation function which just allocates a page from
this CPU's per-cpu-pages magazine, and fails if the magazine is empty:

page = alloc_pages_local(mapping_gfp_mask(x)|__GFP_COLD);
if (!page) {
read_unlock_irq(&mapping->tree_lock);
/*
* This will refill the per-cpu-pages magazine
*/
page = page_cache_alloc_cold(mapping);
read_lock_irq(&mapping->tree_lock);
}
-
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 18:33    [from the cache]
©2003-2011 Jasper Spaans