On Fri, Oct 14, 2022 at 11:28:53AM -0700, Jiaqi Yan wrote: > > > > Looks very broken. Or just hard to follow. Or both. > > Do you think the logic looks correct (and just hard to follow) after > these explanation? Yes. > Currently the rollback operations are soaked with > the copy_succeed code to minimize lines of code. But I can definitely > rewrite to something like this if you think the rollback logic is > correct: > > if (copy_succeeded) { > ... > } else { > re-populate PMD; > if (!pte_none && !zero_pfn && !PageCompound(src_page)) > release_pte_page(src_page); > for(page in compound_list) { > release_pte_page(page); > } > } > return copy_succeeded; Looks sane to me. -- Kiryl Shutsemau / Kirill A. Shutemov