Hugh Dickins 7f39dda9d8 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 <davej@redhat.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-06-04 16:53:51 -07:00
..
2014-05-05 15:44:47 +02:00
2012-01-03 22:54:56 -05:00
2011-07-26 16:49:47 -07:00
2014-04-07 16:35:58 -07:00
2014-05-20 08:58:39 +02:00
2014-03-04 07:55:47 -08:00
2014-05-19 20:01:52 -06:00
2014-05-22 10:28:56 +02:00
2014-01-27 21:02:39 -08:00
2014-04-07 16:35:53 -07:00
2010-05-21 18:31:21 -04:00
2012-06-20 14:39:36 -07:00
2014-04-07 16:35:58 -07:00
2014-05-06 14:02:53 -04:00