lkml.org 
[lkml]   [2023]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 9/9] x86/clear_huge_page: make clear_contig_region() preemptible
Date
clear_contig_region() can be used for clearing  regions as large as a
gigantic page. Allow preemption in irqentry_exit to make sure we don't
hold on to the CPU for an arbitrarily long period.

Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
---
arch/x86/mm/hugetlbpage.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 0b9f7a6dad93..55d1d15ea618 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -152,7 +152,12 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
#ifndef CONFIG_HIGHMEM
static void clear_contig_region(struct page *page, unsigned int npages)
{
+ /*
+ * We might be clearing a large region. Allow rescheduling.
+ */
+ allow_resched();
clear_pages(page_address(page), npages);
+ disallow_resched();
}

/*
--
2.31.1
\
 
 \ /
  Last update: 2023-08-30 22:55    [W:0.333 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site