aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/page-flags.h1
-rw-r--r--mm/page_alloc.c1
-rw-r--r--mm/readahead.c3
3 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index ebd8640..40edce1 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -113,6 +113,7 @@ enum pageflags {
#ifdef CONFIG_CLEANCACHE
PG_was_active,
#endif
+ PG_readahead, /* page in a readahead window */
__NR_PAGEFLAGS,
/* Filesystems */
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 470993a..4410edd 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5846,6 +5846,7 @@ static struct trace_print_flags pageflag_names[] = {
#ifdef CONFIG_MEMORY_FAILURE
{1UL << PG_hwpoison, "hwpoison" },
#endif
+ {1UL << PG_readahead, "PG_readahead" },
{-1UL, NULL },
};
diff --git a/mm/readahead.c b/mm/readahead.c
index df60df9..4df6dc7 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -210,6 +210,9 @@ __do_page_cache_readahead(struct address_space *mapping, struct file *filp,
if (!page)
break;
page->index = page_offset;
+
+ page->flags |= (1L << PG_readahead);
+
list_add(&page->lru, &page_pool);
if (page_idx == nr_to_read - lookahead_size)
SetPageReadahead(page);