]> git.baikalelectronics.ru Git - kernel.git/commit
hugetlb_cgroup: use lockdep_assert_held rather than spin_is_locked
authorMichal Hocko <mhocko@suse.cz>
Fri, 29 Aug 2014 22:18:42 +0000 (15:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Aug 2014 23:28:16 +0000 (16:28 -0700)
commite8478615257195befc944a0f8b8a71525c7a1574
treeb9209f9a97424e987bd0abe1b22abd2fb0e0da05
parentde2d4cac3bfe07eb01157501eb25d7fda835dd1f
hugetlb_cgroup: use lockdep_assert_held rather than spin_is_locked

spin_lock may be an empty struct for !SMP configurations and so
arch_spin_is_locked may return unconditional 0 and trigger the VM_BUG_ON
even when the lock is held.

Replace spin_is_locked by lockdep_assert_held.  We will not BUG anymore
but it is questionable whether crashing makes a lot of sense in the
uncharge path.  Uncharge happens after the last page reference was
released so nobody should touch the page and the function doesn't update
any shared state except for res counter which uses synchronization of
its own.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/hugetlb_cgroup.c