The patch titled Subject: mm/readahead: add readahead_control->dropbehind member has been added to the -mm mm-unstable branch. Its filename is mm-readahead-add-readahead_control-dropbehind-member.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-readahead-add-readahead_control-dropbehind-member.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Jens Axboe <axboe@xxxxxxxxx> Subject: mm/readahead: add readahead_control->dropbehind member Date: Fri, 20 Dec 2024 08:47:43 -0700 If ractl->dropbehind is set to true, then folios created are marked as dropbehind as well. Link: https://lkml.kernel.org/r/20241220154831.1086649-6-axboe@xxxxxxxxx Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Brian Foster <bfoster@xxxxxxxxxx> Cc: Chris Mason <clm@xxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/pagemap.h | 1 + mm/readahead.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) --- a/include/linux/pagemap.h~mm-readahead-add-readahead_control-dropbehind-member +++ a/include/linux/pagemap.h @@ -1369,6 +1369,7 @@ struct readahead_control { pgoff_t _index; unsigned int _nr_pages; unsigned int _batch_count; + bool dropbehind; bool _workingset; unsigned long _pflags; }; --- a/mm/readahead.c~mm-readahead-add-readahead_control-dropbehind-member +++ a/mm/readahead.c @@ -181,7 +181,13 @@ static void read_pages(struct readahead_ static struct folio *ractl_alloc_folio(struct readahead_control *ractl, gfp_t gfp_mask, unsigned int order) { - return filemap_alloc_folio(gfp_mask, order); + struct folio *folio; + + folio = filemap_alloc_folio(gfp_mask, order); + if (folio && ractl->dropbehind) + __folio_set_dropbehind(folio); + + return folio; } /** _ Patches currently in -mm which might be from axboe@xxxxxxxxx are mm-filemap-change-filemap_create_folio-to-take-a-struct-kiocb.patch mm-filemap-use-page_cache_sync_ra-to-kick-off-read-ahead.patch mm-readahead-add-folio-allocation-helper.patch mm-add-pg_dropbehind-folio-flag.patch mm-readahead-add-readahead_control-dropbehind-member.patch mm-truncate-add-folio_unmap_invalidate-helper.patch fs-add-rwf_dontcache-iocb-and-fop_dontcache-file_operations-flag.patch mm-filemap-add-read-support-for-rwf_dontcache.patch mm-filemap-drop-streaming-uncached-pages-when-writeback-completes.patch mm-filemap-add-filemap_fdatawrite_range_kick-helper.patch mm-call-filemap_fdatawrite_range_kick-after-iocb_dontcache-issue.patch mm-add-fgp_dontcache-folio-creation-flag.patch