[PATCH 6.15 493/515] mm/shmem, swap: improve cached mTHP handling and fix potential hang