mm: do not activate swap write failed pages
Sometime back a piece of code was added to activate pages in pageout which failed to writeback. This was done for the case of failed write to zram, with the intention of reducing further zram writes. But this does not make much sense because there can anyway be other pages which the reclaim path can pick to swap out. And this particular logic has a problem. When a write fails, the page is unlocked. Its locked again before activating the page, but the page which is now in swapcache can be brought back with its original mapping through a fault, which can happen during this period. This can result in random bugs, for e.g. when shrink_page_list try to do try_to_free_swap. Here is one such case. In this case PageSwapCache was cleared by the fault path. " zram: Error allocating memory for compressed page: 91433, size=4096 Write-error on swap-device (254:0:731464) page:de866e80 count:3 mapcount:1 mapping:d5368941 index:0xb2ce5 flags: 0x80018(uptodate|dirty|swapbacked) page dumped because: VM_BUG_ON_PAGE(!PageSwapCache(page)) " CRs-Fixed: 988207 Change-Id: I26738d0f8dd3e2dfdb24c25edac24a7d968eeba0 Signed-off-by:Vinayak Menon <vinmenon@codeaurora.org> Signed-off-by:
franciscofranco <franciscofranco.1990@gmail.com>
Loading
Please register or sign in to comment