summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.cz>2014-08-29 15:18:42 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-29 16:28:16 -0700
commit7ea8574e5fa31f43d8098a028f12ba6a9c9f3530 (patch)
treeb9209f9a97424e987bd0abe1b22abd2fb0e0da05 /mm
parent137f8cff505ace6251dc442c7aa973d60c801a79 (diff)
downloadlinux-stable-7ea8574e5fa31f43d8098a028f12ba6a9c9f3530.tar.gz
linux-stable-7ea8574e5fa31f43d8098a028f12ba6a9c9f3530.tar.bz2
linux-stable-7ea8574e5fa31f43d8098a028f12ba6a9c9f3530.zip
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/hugetlb_cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index 9eebfadeeee1..a67c26e0f360 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -217,7 +217,7 @@ void hugetlb_cgroup_uncharge_page(int idx, unsigned long nr_pages,
if (hugetlb_cgroup_disabled())
return;
- VM_BUG_ON(!spin_is_locked(&hugetlb_lock));
+ lockdep_assert_held(&hugetlb_lock);
h_cg = hugetlb_cgroup_from_page(page);
if (unlikely(!h_cg))
return;