mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	mm/hugetlb.c: add cond_resched_lock() in return_unused_surplus_pages()
soft lockup in freeing gigantic hugepage fixed in commit 55f67141a8 "mm:
hugetlb: fix softlockup when a large number of hugepages are freed." can
happen in return_unused_surplus_pages(), so let's fix it.
Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Aneesh Kumar <aneesh.kumar@linux.vnet.ibm.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
			
			
This commit is contained in:
		
							parent
							
								
									8b32201de1
								
							
						
					
					
						commit
						7848a4bf51
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -1172,6 +1172,7 @@ static void return_unused_surplus_pages(struct hstate *h,
 | 
				
			||||||
	while (nr_pages--) {
 | 
						while (nr_pages--) {
 | 
				
			||||||
		if (!free_pool_huge_page(h, &node_states[N_MEMORY], 1))
 | 
							if (!free_pool_huge_page(h, &node_states[N_MEMORY], 1))
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
 | 
							cond_resched_lock(&hugetlb_lock);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue