On 21 Apr 2023 15:12:45 -0700 Douglas Anderson <dianders@xxxxxxxxxxxx> > Add a variant of folio_lock() that can timeout. This is useful to > avoid unbounded waits for the page lock in kcompactd. Given no mutex_lock_timeout() (perhaps because timeout makes no sense for spinlock), I suspect your fix lies in the right layer. If waiting for page under IO causes trouble for you, another simpler option is make IO faster (perhaps all you can do) for instance. If kcompactd is waken up by kswapd, waiting for slow IO is the right thing to do.