This is because we found that the behavior of small io sequential
read is different from v4.19 to v5.10.
At first, when mark_page_accessed() is called the second time,
the page will be moved to active list, thus when reading same file
the second time, performance will drop a little. However, in v5.10
we found that when reading the file by 4k, performance is always
good, and when reading by 1m, performance will drop at second
read like v4.19.
The root cause is the following judgement:
ki_pos >> PAGE_SHIFT != pre_pos >> PAGE_SHIFT
The former should represent current page, while the latter should
represent previous page.
For example, ki_pos = 0, after reading page 0, pre_pos will set to
4k. Thus in the next read of page 1, current page and previous
page will both be 1, and page 1 won't mark accessed.
Set pre_pos to the end of previous read is ok, however I think it
should be ki_pos + copied - 1.
Thanks,
Kuai