thp: fix split vs. unmap race
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 15 lines
(quoted diff) +2
-8@@ -1135,20 +1135,12 @@ void do_page_add_anon_rmap(struct page *page, bool compound = flags & RMAP_COMPOUND; bool first; - if (PageTransCompound(page)) { + if (compound) { + atomic_t *mapcount; VM_BUG_ON_PAGE(!PageLocked(page), page); - if (compound) { - atomic_t *mapcount; - - VM_BUG_ON_PAGE(!PageTransHuge(page), page); - mapcount = compound_mapcount_ptr(page); - first = atomic_inc_and_test(mapcount); - } else {
Review void do_page_add_anon_rmap(struct page *page, · line 1145
Quoted 10 lines
(quoted diff) +3
-5- /* Anon THP always mapped first with PMD */ - first = 0; - VM_BUG_ON_PAGE(!page_mapcount(page), page); - atomic_inc(&page->_mapcount); - } + VM_BUG_ON_PAGE(!PageTransHuge(page), page); + mapcount = compound_mapcount_ptr(page); + first = atomic_inc_and_test(mapcount); } else { VM_BUG_ON_PAGE(compound, page);
Then this debug info is no longer needed.
Review void do_page_add_anon_rmap(struct page *page, · line 1146
Quoted 1 line
(quoted diff) +0
-0first = atomic_inc_and_test(&page->_mapcount);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 19 lines · Hillf Danton
Quoted 19 lines
(quoted diff) +2
-12@@ -1135,20 +1135,12 @@ void do_page_add_anon_rmap(struct page *page, bool compound = flags & RMAP_COMPOUND; bool first; - if (PageTransCompound(page)) { + if (compound) { + atomic_t *mapcount; VM_BUG_ON_PAGE(!PageLocked(page), page); - if (compound) { - atomic_t *mapcount; - - VM_BUG_ON_PAGE(!PageTransHuge(page), page); - mapcount = compound_mapcount_ptr(page); - first = atomic_inc_and_test(mapcount); - } else { - /* Anon THP always mapped first with PMD */ - first = 0; - VM_BUG_ON_PAGE(!page_mapcount(page), page); - atomic_inc(&page->_mapcount);
Quoted 9 lines
Review void do_page_add_anon_rmap(struct page *page, · line 1145
Quoted 6 lines
(quoted diff) +3
-1- } + VM_BUG_ON_PAGE(!PageTransHuge(page), page); + mapcount = compound_mapcount_ptr(page); + first = atomic_inc_and_test(mapcount); } else { VM_BUG_ON_PAGE(compound, page);Then this debug info is no longer needed.
Quoted 1 line
(quoted diff) +0
-0first = atomic_inc_and_test(&page->_mapcount);
Right.
mm/rmap.c +0 -1
@@ -1186,7 +1186,6 @@ void do_page_add_anon_rmap(struct page *page, mapcount =compound_mapcount_ptr (page); first =atomic_inc_and_test (mapcount); }else { -VM_BUG_ON_PAGE (compound, page); first =atomic_inc_and_test (&page->_mapcount); }
Signature · 7 lines
Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>