linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch for-4.12] mm, thp: remove cond_resched from __collapse_huge_page_copy
@ 2017-06-19 20:43 David Rientjes
  2017-06-23 13:24 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: David Rientjes @ 2017-06-19 20:43 UTC (permalink / raw)
  To: Andrew Morton, Larry Finger; +Cc: Vlastimil Babka, LKML, linux-mm

This is a partial revert of commit 338a16ba1549 ("mm, thp: copying user
pages must schedule on collapse") which added a cond_resched() to
__collapse_huge_page_copy().

On x86 with CONFIG_HIGHPTE, __collapse_huge_page_copy is called in atomic
context and thus scheduling is not possible.  This is only a possible
config on arm and i386.

Although need_resched has been shown to be set for over 100 jiffies while
doing the iteration in __collapse_huge_page_copy, this is better than
doing

	if (in_atomic())
		cond_resched()

to cover only non-CONFIG_HIGHPTE configs.

Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 Note: Larry should be back as of June 17 to test if this fixes the
 reported issue.

 mm/khugepaged.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/khugepaged.c b/mm/khugepaged.c
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -652,7 +652,6 @@ static void __collapse_huge_page_copy(pte_t *pte, struct page *page,
 			spin_unlock(ptl);
 			free_page_and_swap_cache(src_page);
 		}
-		cond_resched();
 	}
 }
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch for-4.12] mm, thp: remove cond_resched from __collapse_huge_page_copy
  2017-06-19 20:43 [patch for-4.12] mm, thp: remove cond_resched from __collapse_huge_page_copy David Rientjes
@ 2017-06-23 13:24 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2017-06-23 13:24 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Larry Finger, Vlastimil Babka, LKML, linux-mm

On Mon 19-06-17 13:43:11, David Rientjes wrote:
> This is a partial revert of commit 338a16ba1549 ("mm, thp: copying user
> pages must schedule on collapse") which added a cond_resched() to
> __collapse_huge_page_copy().
> 
> On x86 with CONFIG_HIGHPTE, __collapse_huge_page_copy is called in atomic
> context and thus scheduling is not possible.  This is only a possible
> config on arm and i386.
> 
> Although need_resched has been shown to be set for over 100 jiffies while
> doing the iteration in __collapse_huge_page_copy, this is better than
> doing
> 
> 	if (in_atomic())
> 		cond_resched()
> 
> to cover only non-CONFIG_HIGHPTE configs.
> 
> Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  Note: Larry should be back as of June 17 to test if this fixes the
>  reported issue.
> 
>  mm/khugepaged.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -652,7 +652,6 @@ static void __collapse_huge_page_copy(pte_t *pte, struct page *page,
>  			spin_unlock(ptl);
>  			free_page_and_swap_cache(src_page);
>  		}
> -		cond_resched();
>  	}
>  }
>  
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-23 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-19 20:43 [patch for-4.12] mm, thp: remove cond_resched from __collapse_huge_page_copy David Rientjes
2017-06-23 13:24 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).