mm: have folio_mark_accessed() return whether the folio is hot
Each call of folio_mark_accessed() moves a folio one step up what the LRU records of its accesses: on the classic LRU from inactive to inactive and referenced, active, and active and referenced; on the multi-gen LRU through PG_referenced, the refs bits and PG_workingset. Have it return whether the folio was already at the top of that when it was called, which is when the call leaves it as it was: active and referenced and not idle on the classic LRU, PG_referenced, all the refs bits and PG_workingset set on the multi-gen LRU. lru_gen_inc_refs() returns that for the multi-gen LRU. An unevictable folio counts as hot once it is referenced: it stays in memory in any case. On the multi-gen LRU it is hot from the first call, because lru_gen_inc_refs() returns before it changes anything of an unevictable folio. A dropbehind folio is not hot, though the call leaves it as it was too: it is to be dropped after the read. No caller uses the value yet. A later patch of this series marks the folios that it calls hot, for reads from the page cache without a folio reference. Assisted-by: LLM Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>