linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [BUG] mm, thp: khugepaged can't allocate on requested node when confined to a cpuset
@ 2014-10-08 19:10 Alex Thorlton
  2014-10-10  9:20 ` Peter Zijlstra
  2014-10-14 11:48 ` Kirill A. Shutemov
  0 siblings, 2 replies; 13+ messages in thread
From: Alex Thorlton @ 2014-10-08 19:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrew Morton, Mel Gorman, Rik van Riel, Ingo Molnar,
	Peter Zijlstra, Kirill A. Shutemov, Hugh Dickins, Bob Liu,
	Johannes Weiner, linux-mm

Hey everyone,

I've run into a some frustrating behavior from the khugepaged thread,
that I'm hoping to get sorted out.  It appears that if you pin
khugepaged to a cpuset (i.e. node 0), and it begins scanning/collapsing
pages for a process on a cpuset that doesn't have any memory nodes in
common with kugepaged (i.e. node 1), then the collapsed pages will all
be allocated khugepaged's node (in this case node 0), clearly breaking
the cpuset boundary set up for the process in question.

I'm aware that there are some known issues with khugepaged performing
off-node allocations in certain situations, but I believe this is a bit
of a special circumstance since, in this situation, there's no way for
khugepaged to perform an allocation on the desired node.

The problem really stems from the way that we determine the allowed
memory nodes in get_page_from_freelist.  When we call down to
cpuset_zone_allowed_softwall, we check current->mems_allowed to
determine what nodes we're allowed on.  In the case of khugepaged, we'll
be making allocations for the mm of the process we're collapsing for,
but we'll be checking the mems_allowed of khugepaged, which can
obviously cause some problems.

Is this particular bug a known issue?  I've been trying to come up with
a simple way to fix the bug, but it's a bit difficult since we no longer
have a way to trace back to the task_struct that we're collapsing for
once we've reached get_page_from_freelist.  I'm wondering if we might
want to make the cpuset check higher up in the call-chain and then pass
that nodemask down instead of sending a NULL nodemask, as we end up
doing in many (most?) situations.  I can think of several problems with
that approach as well, but it's all I've come up with so far.

The obvious workaround is to not isolate khugepaged to a cpuset, but
since we're allowed to do so, I think the thread should probably behave
appropriately when pinned to a cpuset.

Any input on this issue is greatly appreciated.  Thanks, guys!

- Alex

--
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] 13+ messages in thread

end of thread, other threads:[~2014-10-21 16:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-08 19:10 [BUG] mm, thp: khugepaged can't allocate on requested node when confined to a cpuset Alex Thorlton
2014-10-10  9:20 ` Peter Zijlstra
2014-10-10 18:56   ` Alex Thorlton
2014-10-10 21:57     ` Vlastimil Babka
2014-10-14 14:58       ` Alex Thorlton
2014-10-21 10:59       ` Peter Zijlstra
2014-10-21 10:55     ` Peter Zijlstra
2014-10-21 16:25       ` Alex Thorlton
2014-10-14 11:48 ` Kirill A. Shutemov
2014-10-14 14:54   ` Peter Zijlstra
2014-10-14 15:31     ` Rik van Riel
2014-10-14 17:38     ` Kirill A. Shutemov
2014-10-21 10:17       ` Peter Zijlstra

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).