Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1639277

Re: [patch] mm, thp: copying user pages must schedule on collapse

From Vlastimil Babka <vbabka@suse.cz>
Newsgroups linux.kernel
Subject Re: [patch] mm, thp: copying user pages must schedule on collapse
Date 2017-05-11 12:00 +0200
Message-ID <tFT34-4G6-9@gated-at.bofh.it> (permalink)
References <tFHlf-5PH-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@google.com>

Acked-by: Vlastimil Babka <vbabka@suse.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();
>  	}
>  }
>  
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[patch] mm, thp: copying user pages must schedule on collapse David Rientjes <rientjes@google.com> - 2017-05-10 23:30 +0200
  Re: [patch] mm, thp: copying user pages must schedule on collapse Vlastimil Babka <vbabka@suse.cz> - 2017-05-11 12:00 +0200

csiph-web