summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-04-27 17:01:28 -0400
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-05 00:47:29 -0400
commitb9ff43dd27434dbd850b908e2e0e1f6e794efd9b (patch)
tree08b633cfb49cf8ac4a07cb82d926be6d0857a9d9 /README
parent170f37d6aa6ad4582eefd7459015de79e244536e (diff)
mm/readahead: Fix readahead with large foliosfolio-5.18f
Reading 100KB chunks from a big file (eg dd bs=100K) leads to poor readahead behaviour. Studying the traces in detail, I noticed two problems. The first is that we were setting the readahead flag on the folio which contains the last byte read from the block. This is wrong because we will trigger readahead at the end of the read without waiting to see if a subsequent read is going to use the pages we just read. Instead, we need to set the readahead flag on the first folio _after_ the one which contains the last byte that we're reading. The second is that we were looking for the index of the folio with the readahead flag set to exactly match the start + size - async_size. If we've rounded this, either down (as previously) or up (as now), we'll think we hit a folio marked as readahead by a different read, and try to read the wrong pages. So round the expected index to the order of the folio we hit. Reported-by: Guo Xuenan <guoxuenan@huawei.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions