Matthew Wilcox <willy@xxxxxxxxxxxxx> writes: > On Tue, Sep 15, 2020 at 09:40:45AM +0200, SeongJae Park wrote: >> On Tue, 8 Sep 2020 20:55:38 +0100 "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> wrote: >> > Remove the assumption that a compound page has HPAGE_PMD_NR pins from >> > the page cache. >> > >> > Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> >> > Cc: Huang Ying <ying.huang@xxxxxxxxx> > >> > - int page_cache_pins = PageTransHuge(page) && PageSwapCache(page) ? >> > - HPAGE_PMD_NR : 1; >> > + int page_cache_pins = thp_nr_pages(page); >> >> Is it ok to remove the PageSwapCache() check? > > I think so? My understanding is that it was added in commit bd4c82c22c36 > to catch shmem pages, but there was really no reason to only do this for > shmem pages. The original implementation is to write out Anonymous THP (not shmem). The code should work after the changing, because now any THP except normal Anonymous THP in swap cache will be split during reclaiming already. Acked-by: "Huang, Ying" <ying.huang@xxxxxxxxx> Best Regards, Huang, Ying