lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 8 Sep 2023 14:45:21 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Ankur Arora <ankur.a.arora@...cle.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org, x86@...nel.org,
        akpm@...ux-foundation.org, luto@...nel.org, bp@...en8.de,
        dave.hansen@...ux.intel.com, hpa@...or.com, mingo@...hat.com,
        juri.lelli@...hat.com, vincent.guittot@...aro.org,
        willy@...radead.org, mgorman@...e.de, rostedt@...dmis.org,
        tglx@...utronix.de, jon.grimm@....com, bharata@....com,
        raghavendra.kt@....com, boris.ostrovsky@...cle.com,
        konrad.wilk@...cle.com
Subject: Re: [PATCH v2 9/9] x86/clear_huge_page: make clear_contig_region()
 preemptible

On Wed, Aug 30, 2023 at 11:49:58AM -0700, Ankur Arora wrote:
> 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.

It would be very nice to quantify the latency improvement here. At the
very least perhaps mention how long a 2M or 1G clear takes (on you
favourite machine) to illustrate why this is needed.

> Signed-off-by: Ankur Arora <ankur.a.arora@...cle.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();
>  }

Why is this in clear_contig_region() and not clear_pages() ? Any other
clear_pages() user will have the same problems no?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ