[Devel] [PATCH VZ9 0/2] mm: fix livelock caused by thp pages migration

2024-03-06 Thread Pavel Tikhomirov
https://virtuozzo.atlassian.net/browse/PSBM-153264 Charan Teja Kalla (1): mm: migrate high-order folios in swap cache correctly Pavel Tikhomirov (1): mm: migrate page private for high-order folios in swap cache correctly mm/migrate.c | 13 - 1 file changed, 12 insertions(+), 1 d

[Devel] [PATCH VZ9 1/2] mm: migrate high-order folios in swap cache correctly

2024-03-06 Thread Pavel Tikhomirov
From: Charan Teja Kalla Large folios occupy N consecutive entries in the swap cache instead of using multi-index entries like the page cache. However, if a large folio is re-added to the LRU list, it can be migrated. The migration code was not aware of the difference between the swap cache and

[Devel] [PATCH VZ9 2/2] mm: migrate page private for high-order folios in swap cache correctly

2024-03-06 Thread Pavel Tikhomirov
We have a check in do_swap_page that page from lookup_swap_cache should have private field equal to the swapcache index we searched it at (page_private(page) != entry.val). So folio_migrate_mapping should preserve page private for each page of a huge folio to satisfy this check else we get infinite