* Re: [PATCH 8/9] mm/hugetlb: convert hugetlb_wp() to take in a folio [not found] ` <20230119211446.54165-9-sidhartha.kumar@oracle.com> @ 2023-01-24 15:23 ` Gerald Schaefer 2023-01-24 18:38 ` Sidhartha Kumar 0 siblings, 1 reply; 2+ messages in thread From: Gerald Schaefer @ 2023-01-24 15:23 UTC (permalink / raw) To: Sidhartha Kumar Cc: linux-kernel, linux-mm, akpm, songmuchun, mike.kravetz, willy, jhubbard, linux-s390 On Thu, 19 Jan 2023 13:14:45 -0800 Sidhartha Kumar <sidhartha.kumar@oracle.com> wrote: [...] > page = pte_page(entry); > - if (page != pagecache_page) > + if (page_folio(page) != pagecache_folio) > if (!trylock_page(page)) { > need_wait_lock = 1; > goto out_ptl; > } > > - get_page(page); > + folio_get(pagecache_folio); > We get a kernel crash on s390 in mprotect testcase from libhugetlbfs testsuite, starting with next-20230120, bisected to this commit. We get here with pagecache_folio == NULL, and crash in folio_get(). It doesn´t seem right to replace the get_page() with folio_get() here, the matching put_page() at out_put_page: also wasn't changed correspondingly. Also, pagecache_folio == NULL seems to be a valid case here, on all architectures. Reverting this folio_get() to get_page() fixes the crash. Not sure though if I missed something. I think you only want to replace pagecache_page with pagecache_folio, like in the rest of the commit, and not page -> pagecache_folio for this get_page(). ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 8/9] mm/hugetlb: convert hugetlb_wp() to take in a folio 2023-01-24 15:23 ` [PATCH 8/9] mm/hugetlb: convert hugetlb_wp() to take in a folio Gerald Schaefer @ 2023-01-24 18:38 ` Sidhartha Kumar 0 siblings, 0 replies; 2+ messages in thread From: Sidhartha Kumar @ 2023-01-24 18:38 UTC (permalink / raw) To: Gerald Schaefer Cc: linux-kernel, linux-mm, akpm, songmuchun, mike.kravetz, willy, jhubbard, linux-s390 On 1/24/23 7:23 AM, Gerald Schaefer wrote: > On Thu, 19 Jan 2023 13:14:45 -0800 > Sidhartha Kumar <sidhartha.kumar@oracle.com> wrote: > > [...] >> page = pte_page(entry); >> - if (page != pagecache_page) >> + if (page_folio(page) != pagecache_folio) >> if (!trylock_page(page)) { >> need_wait_lock = 1; >> goto out_ptl; >> } >> >> - get_page(page); >> + folio_get(pagecache_folio); >> > > We get a kernel crash on s390 in mprotect testcase from libhugetlbfs > testsuite, starting with next-20230120, bisected to this commit. > > We get here with pagecache_folio == NULL, and crash in folio_get(). > It doesn´t seem right to replace the get_page() with folio_get() > here, the matching put_page() at out_put_page: also wasn't changed > correspondingly. Also, pagecache_folio == NULL seems to be a valid > case here, on all architectures. > > Reverting this folio_get() to get_page() fixes the crash. Not sure > though if I missed something. I think you only want to replace > pagecache_page with pagecache_folio, like in the rest of the commit, > and not page -> pagecache_folio for this get_page(). Ya that get_page(page) line should have stayed how it was before as pagecache_folio is replacing instances of pagecache_page. Thanks for catching this, I'll fix this change in a v2 of this patch series. Thanks, Sidhartha Kumar ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-24 19:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230119211446.54165-1-sidhartha.kumar@oracle.com>
[not found] ` <20230119211446.54165-9-sidhartha.kumar@oracle.com>
2023-01-24 15:23 ` [PATCH 8/9] mm/hugetlb: convert hugetlb_wp() to take in a folio Gerald Schaefer
2023-01-24 18:38 ` Sidhartha Kumar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox