Re: [PATCH v2 1/4] mm/filemap: Add folio_lock_timeout()

Hillf Danton
2023-04-28T08:17:47Z

On 27 Apr 2023 10:48:47 +0100 Mel Gorman <mgorman@techsingularity.net>
>
> Matthew's suggestion on checking uptodate is a good one. If he's right,
> the problem goes away. If the problem still persists, I am willing to bet
> that it's mitigated a lot *and* it becomes interesting to find out why a
> !uptodate page could take a very long time to lock because it's possibly
> revealing another real bug. If the idea does not work at all, the timeout
> patch still exists, add to the changelog why checking uptodate doesn't
> work and Linus spelled out clearly why it should be ok in this specific
> case even if we have to watch out for bad users of the new interface.

Timeout detects slow IO in this case, while hardware vonders provide IO
speed info for free, so SYNC_LIGHT likely breaks with slow hardware after
adding timeout.