On Mon 13-02-23 01:55:04, Christoph Hellwig wrote: > On Fri, Feb 10, 2023 at 12:29:54PM +0100, Jan Kara wrote: > > functionally that would make sense but as I've mentioned in my reply to you > > [1], the problem here is the performance. I've now dug out the discussion > > from 2018 where John actually tried to take pinned pages out of the LRU [2] > > and the result was 20% IOPS degradation on his NVME drive because of the > > cost of taking the LRU lock. I'm not even speaking how costly that would > > get on any heavily parallel direct IO workload on some high-iops device... > > I think we need to distinguish between short- and long terms pins. > For short term pins like direct I/O it doesn't make sense to take them > off the lru, or to do any other special action. Writeback will simplify > have to wait for the short term pin. > > Long-term pins absolutely would make sense to be taken off the LRU list. Yeah, I agree distinguishing these two would be nice as we could treat them differently then. The trouble is a bit with always-crowded struct page. But now it occurred to me that if we are going to take these long-term pinned pages out from the LRU, we could overload the space for LRU pointers with the counter (which is what I think John originally did). So yes, possibly we could track separately long-term and short-term pins. John, what do you think? Maybe time to revive your patches from 2018 in a bit different form? ;) Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR