/* Case 1 above */ if (current_is_kswapd() && folio_test_reclaim(folio) && @@ -1201,7 +1205,9 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, /* Case 2 above */ } else if (writeback_throttling_sane(sc) || !folio_test_reclaim(folio) || - !may_enter_fs(folio, sc->gfp_mask)) { + !may_enter_fs(folio, sc->gfp_mask) || + (mapping && + mapping_writeback_may_deadlock_on_reclaim(mapping))) {
Nit: Would have put that into a single line (we can exceed 80c where reasonable)
Thanks! Acked-by: David Hildenbrand <david@xxxxxxxxxx> -- Cheers, David / dhildenb