mm/readahead: add readahead_control->dropbehind member
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@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>
This commit is contained in:
parent
cceba6f7e4
commit
77d075221a
2 changed files with 8 additions and 1 deletions
|
@ -1358,6 +1358,7 @@ struct readahead_control {
|
|||
pgoff_t _index;
|
||||
unsigned int _nr_pages;
|
||||
unsigned int _batch_count;
|
||||
bool dropbehind;
|
||||
bool _workingset;
|
||||
unsigned long _pflags;
|
||||
};
|
||||
|
|
|
@ -181,7 +181,13 @@ static void read_pages(struct readahead_control *rac)
|
|||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue