task_will_free_mem() requires the task_lock lock is held or the function
is called on the current, but this is just a function comment,
let's add the proper lockdep check according to this comment.

https://jira.sw.ru/browse/PSBM-143283

Signed-off-by: Konstantin Khorenko <khore...@virtuozzo.com>
Suggested-by: Nikolay Borisov <nikolay.bori...@virtuozzo.com>
---
 include/linux/oom.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/oom.h b/include/linux/oom.h
index ef0096799ee3..17f5612625f1 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -133,6 +133,8 @@ static inline bool task_will_free_mem(struct task_struct 
*task)
 {
        struct mm_struct *mm = task->mm;
 
+       lockdep_assert(lockdep_is_held(&task->alloc_lock) || task == current);
+
        /*
         * Skip tasks without mm because it might have passed its exit_mm and
         * exit_oom_victim. oom_reaper could have rescued that but do not rely
-- 
2.24.3

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to