]> Git Repo - linux.git/commit - mm/rmap.c
mm: fix sleeping function warning from __put_anon_vma
authorHugh Dickins <[email protected]>
Wed, 4 Jun 2014 23:05:33 +0000 (16:05 -0700)
committerLinus Torvalds <[email protected]>
Wed, 4 Jun 2014 23:53:51 +0000 (16:53 -0700)
commit7f39dda9d86fb4f4f17af0de170decf125726f8c
tree30c87e21eb0ad3366033a8d93f70a08dc02b7df0
parentf9625c48ecca4aa850b50ecbbb540228ad59e92e
mm: fix sleeping function warning from __put_anon_vma

Trinity reports BUG:

  sleeping function called from invalid context at kernel/locking/rwsem.c:47
  in_atomic(): 0, irqs_disabled(): 0, pid: 5787, name: trinity-c27

__might_sleep < down_write < __put_anon_vma < page_get_anon_vma <
migrate_pages < compact_zone < compact_zone_order < try_to_compact_pages ..

Right, since conversion to mutex then rwsem, we should not put_anon_vma()
from inside an rcu_read_lock()ed section: fix the two places that did so.
And add might_sleep() to anon_vma_free(), as suggested by Peter Zijlstra.

Fixes: 88c22088bf23 ("mm: optimize page_lock_anon_vma() fast-path")
Reported-by: Dave Jones <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/rmap.c
This page took 0.043508 seconds and 4 git commands to generate.