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/20241220154831.1086649-5-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Brian Foster <bfoster@redhat.com> Cc: Chris Mason <clm@meta.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 1963de7 commit cceba6f

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

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)