Skip to content

Commit cceba6f

Browse files
axboeakpm00
authored andcommitted
mm: add PG_dropbehind folio flag
Add a folio flag that file IO can use to indicate that the cached IO being done should be dropped from the page cache upon completion. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]> Reviewed-by: Kirill A. Shutemov <[email protected]> Cc: Brian Foster <[email protected]> Cc: Chris Mason <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 1963de7 commit cceba6f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

include/linux/page-flags.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ enum pageflags {
110110
PG_reclaim, /* To be reclaimed asap */
111111
PG_swapbacked, /* Page is backed by RAM/swap */
112112
PG_unevictable, /* Page is "unevictable" */
113+
PG_dropbehind, /* drop pages on IO completion */
113114
#ifdef CONFIG_MMU
114115
PG_mlocked, /* Page is vma mlocked */
115116
#endif
@@ -562,6 +563,10 @@ PAGEFLAG(Reclaim, reclaim, PF_NO_TAIL)
562563
FOLIO_FLAG(readahead, FOLIO_HEAD_PAGE)
563564
FOLIO_TEST_CLEAR_FLAG(readahead, FOLIO_HEAD_PAGE)
564565

566+
FOLIO_FLAG(dropbehind, FOLIO_HEAD_PAGE)
567+
FOLIO_TEST_CLEAR_FLAG(dropbehind, FOLIO_HEAD_PAGE)
568+
__FOLIO_SET_FLAG(dropbehind, FOLIO_HEAD_PAGE)
569+
565570
#ifdef CONFIG_HIGHMEM
566571
/*
567572
* Must use a macro here due to header dependency issues. page_zone() is not

include/trace/events/mmflags.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@
116116
DEF_PAGEFLAG_NAME(head), \
117117
DEF_PAGEFLAG_NAME(reclaim), \
118118
DEF_PAGEFLAG_NAME(swapbacked), \
119-
DEF_PAGEFLAG_NAME(unevictable) \
119+
DEF_PAGEFLAG_NAME(unevictable), \
120+
DEF_PAGEFLAG_NAME(dropbehind) \
120121
IF_HAVE_PG_MLOCK(mlocked) \
121122
IF_HAVE_PG_HWPOISON(hwpoison) \
122123
IF_HAVE_PG_IDLE(idle) \

0 commit comments

Comments
 (0)