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


Groups > linux.kernel > #1669941

[patch for-4.12] mm, thp: remove cond_resched from __collapse_huge_page_copy

From David Rientjes <rientjes@google.com>
Newsgroups linux.kernel
Subject [patch for-4.12] mm, thp: remove cond_resched from __collapse_huge_page_copy
Date 2017-06-19 22:50 +0200
Message-ID <tUbMu-7Ag-31@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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();
 	}
 }
 

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


Thread

[patch for-4.12] mm, thp: remove cond_resched from  __collapse_huge_page_copy David Rientjes <rientjes@google.com> - 2017-06-19 22:50 +0200
  Re: [patch for-4.12] mm, thp: remove cond_resched from  __collapse_huge_page_copy Michal Hocko <mhocko@kernel.org> - 2017-06-23 15:30 +0200

csiph-web