@@ -2352,15 +2352,15 @@ static void unmap_page(struct page *page)
2352
2352
{
2353
2353
enum ttu_flags ttu_flags = TTU_IGNORE_MLOCK | TTU_SYNC |
2354
2354
TTU_RMAP_LOCKED | TTU_SPLIT_HUGE_PMD ;
2355
- bool unmap_success ;
2356
2355
2357
2356
VM_BUG_ON_PAGE (!PageHead (page ), page );
2358
2357
2359
2358
if (PageAnon (page ))
2360
2359
ttu_flags |= TTU_SPLIT_FREEZE ;
2361
2360
2362
- unmap_success = try_to_unmap (page , ttu_flags );
2363
- VM_BUG_ON_PAGE (!unmap_success , page );
2361
+ try_to_unmap (page , ttu_flags );
2362
+
2363
+ VM_WARN_ON_ONCE_PAGE (page_mapped (page ), page );
2364
2364
}
2365
2365
2366
2366
static void remap_page (struct page * page , unsigned int nr )
@@ -2671,7 +2671,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
2671
2671
struct deferred_split * ds_queue = get_deferred_split_queue (head );
2672
2672
struct anon_vma * anon_vma = NULL ;
2673
2673
struct address_space * mapping = NULL ;
2674
- int count , mapcount , extra_pins , ret ;
2674
+ int extra_pins , ret ;
2675
2675
pgoff_t end ;
2676
2676
2677
2677
VM_BUG_ON_PAGE (is_huge_zero_page (head ), head );
@@ -2730,7 +2730,6 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
2730
2730
}
2731
2731
2732
2732
unmap_page (head );
2733
- VM_BUG_ON_PAGE (compound_mapcount (head ), head );
2734
2733
2735
2734
/* block interrupt reentry in xa_lock and spinlock */
2736
2735
local_irq_disable ();
@@ -2748,9 +2747,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
2748
2747
2749
2748
/* Prevent deferred_split_scan() touching ->_refcount */
2750
2749
spin_lock (& ds_queue -> split_queue_lock );
2751
- count = page_count (head );
2752
- mapcount = total_mapcount (head );
2753
- if (!mapcount && page_ref_freeze (head , 1 + extra_pins )) {
2750
+ if (page_ref_freeze (head , 1 + extra_pins )) {
2754
2751
if (!list_empty (page_deferred_list (head ))) {
2755
2752
ds_queue -> split_queue_len -- ;
2756
2753
list_del (page_deferred_list (head ));
@@ -2770,16 +2767,9 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
2770
2767
__split_huge_page (page , list , end );
2771
2768
ret = 0 ;
2772
2769
} else {
2773
- if (IS_ENABLED (CONFIG_DEBUG_VM ) && mapcount ) {
2774
- pr_alert ("total_mapcount: %u, page_count(): %u\n" ,
2775
- mapcount , count );
2776
- if (PageTail (page ))
2777
- dump_page (head , NULL );
2778
- dump_page (page , "total_mapcount(head) > 0" );
2779
- BUG ();
2780
- }
2781
2770
spin_unlock (& ds_queue -> split_queue_lock );
2782
- fail : if (mapping )
2771
+ fail :
2772
+ if (mapping )
2783
2773
xa_unlock (& mapping -> i_pages );
2784
2774
local_irq_enable ();
2785
2775
remap_page (head , thp_nr_pages (head ));
0 commit comments