Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61567
b: refs/heads/master
c: f615bfc
h: refs/heads/master
i:
  61565: 78d8091
  61563: a569e77
  61559: c5712bf
  61551: 94823ed
  61535: 8fe5d1e
  61503: 46bc74b
  61439: aaeee93
v: v3
  • Loading branch information
Fengguang Wu authored and Linus Torvalds committed Jul 19, 2007
1 parent 2f79f35 commit 56fcb65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 46fc3e7b4e7233a0ac981ac9084b55217318d04d
refs/heads/master: f615bfca468c9b80ed2d09be5fdbaf470a32c045
12 changes: 10 additions & 2 deletions trunk/mm/readahead.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
}
EXPORT_SYMBOL(default_unplug_io_fn);

/*
* Convienent macros for min/max read-ahead pages.
* Note that MAX_RA_PAGES is rounded down, while MIN_RA_PAGES is rounded up.
* The latter is necessary for systems with large page size(i.e. 64k).
*/
#define MAX_RA_PAGES (VM_MAX_READAHEAD*1024 / PAGE_CACHE_SIZE)
#define MIN_RA_PAGES DIV_ROUND_UP(VM_MIN_READAHEAD*1024, PAGE_CACHE_SIZE)

struct backing_dev_info default_backing_dev_info = {
.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE,
.ra_pages = MAX_RA_PAGES,
.state = 0,
.capabilities = BDI_CAP_MAP_COPY,
.unplug_io_fn = default_unplug_io_fn,
Expand Down Expand Up @@ -51,7 +59,7 @@ static inline unsigned long get_max_readahead(struct file_ra_state *ra)

static inline unsigned long get_min_readahead(struct file_ra_state *ra)
{
return (VM_MIN_READAHEAD * 1024) / PAGE_CACHE_SIZE;
return MIN_RA_PAGES;
}

static inline void reset_ahead_window(struct file_ra_state *ra)
Expand Down

0 comments on commit 56fcb65

Please sign in to comment.