diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 6d53675c2b54..7fbd6720021a 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -109,6 +109,7 @@ enum pageflags { #ifdef CONFIG_TRANSPARENT_HUGEPAGE PG_compound_lock, #endif + PG_readahead, /* page in a readahead window */ __NR_PAGEFLAGS, /* Filesystems */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 209fdf1f0e76..2c72b7f6e35e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6267,6 +6267,7 @@ static const struct trace_print_flags pageflag_names[] = { #ifdef CONFIG_TRANSPARENT_HUGEPAGE {1UL << PG_compound_lock, "compound_lock" }, #endif + {1UL << PG_readahead, "PG_readahead" }, }; static void dump_page_flags(unsigned long flags) diff --git a/mm/readahead.c b/mm/readahead.c index fad249f570f8..12d8707c36e0 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -186,6 +186,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);