Baokun Li 4e63aeb5d0 blk-wbt: don't throttle swap writes in direct reclaim
Now we avoid throttling swap writes by determining whether the current
process is kswapd (aka current_is_kswapd()), but swap writes can come
from either kswapd or direct reclaim, so the swap writes from direct
reclaim will still be throttled.

When a process holds a lock to allocate a free page, and enters direct
reclaim because there is no free memory, then it might trigger a hung
due to the wbt throttling that causes other processes to fail to get
the lock.

Both kswapd and direct reclaim set the REQ_SWAP flag, so use REQ_SWAP
instead of current_is_kswapd() to avoid throttling swap writes. Also
renamed WBT_KSWAPD to WBT_SWAP and WBT_RWQ_KSWAPD to WBT_RWQ_SWAP.

Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240604030522.3686177-1-libaokun@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-07-01 06:51:53 -06:00
..
2024-05-21 13:02:56 -07:00
2024-06-18 09:22:45 -06:00
2024-06-18 09:22:45 -06:00
2024-06-28 14:34:54 -06:00
2024-05-14 17:25:36 -07:00
2024-06-18 09:22:45 -06:00
2023-06-26 12:47:20 -07:00
2024-06-28 10:29:42 -06:00
2023-06-30 11:57:07 -07:00
2024-06-26 09:37:35 -06:00
2024-05-21 13:02:56 -07:00
2024-03-11 11:43:44 -07:00
2024-06-28 10:29:42 -06:00