Commit 6ef7cd8
committed
in_tail: fix file_cache_advise causing high disk IOPS
The posix_fadvise(POSIX_FADV_DONTNEED) call was placed before the
read and evicted the entire file from the page cache on every chunk
cycle. This forced every subsequent read to go to disk, causing
excessive IOPS.
Move the call to after read and processing, and scope it to only
the already-consumed byte range (0 to stream_offset) so that kernel
readahead pages for upcoming reads are preserved.
Signed-off-by: Anuj Singh <singholt@amazon.com>1 parent 66ffbe4 commit 6ef7cd8
1 file changed
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1698 | 1698 | | |
1699 | 1699 | | |
1700 | 1700 | | |
1701 | | - | |
1702 | | - | |
1703 | | - | |
1704 | | - | |
1705 | | - | |
1706 | | - | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
1710 | 1701 | | |
1711 | 1702 | | |
1712 | 1703 | | |
| |||
1822 | 1813 | | |
1823 | 1814 | | |
1824 | 1815 | | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
1825 | 1825 | | |
1826 | 1826 | | |
1827 | 1827 | | |
| |||
0 commit comments