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] [day] [month] [year] [list]
Message-ID: <b139f4cc-50b5-dc5d-76c5-1dffe658cd16@suse.cz>
Date:   Thu, 11 May 2017 11:51:37 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     David Rientjes <rientjes@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Mel Gorman <mgorman@...hsingularity.net>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [patch] mm, thp: copying user pages must schedule on collapse

On 05/10/2017 11:27 PM, David Rientjes wrote:
> We have encountered need_resched warnings in __collapse_huge_page_copy()
> while doing {clear,copy}_user_highpage() over HPAGE_PMD_NR source pages.
> 
> mm->mmap_sem is held for write, but the iteration is well bounded.
> 
> Reschedule as needed.
> 
> Signed-off-by: David Rientjes <rientjes@...gle.com>

Acked-by: Vlastimil Babka <vbabka@...e.cz>

> ---
>  mm/khugepaged.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -612,7 +612,8 @@ static void __collapse_huge_page_copy(pte_t *pte, struct page *page,
>  				      spinlock_t *ptl)
>  {
>  	pte_t *_pte;
> -	for (_pte = pte; _pte < pte+HPAGE_PMD_NR; _pte++) {
> +	for (_pte = pte; _pte < pte + HPAGE_PMD_NR;
> +				_pte++, page++, address += PAGE_SIZE) {
>  		pte_t pteval = *_pte;
>  		struct page *src_page;
>  
> @@ -651,9 +652,7 @@ static void __collapse_huge_page_copy(pte_t *pte, struct page *page,
>  			spin_unlock(ptl);
>  			free_page_and_swap_cache(src_page);
>  		}
> -
> -		address += PAGE_SIZE;
> -		page++;
> +		cond_resched();
>  	}
>  }
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ