Re: [PATCH 2/2] memcg: do not report racy no-eligible OOM tasks

From: Michal Hocko
Date: Tue Jan 08 2019 - 04:40:03 EST


On Tue 08-01-19 16:35:42, kbuild test robot wrote:
[...]
> All warnings (new ones prefixed by >>):
>
> include/linux/rcupdate.h:659:9: warning: context imbalance in 'find_lock_task_mm' - wrong count at exit
> include/linux/sched/mm.h:141:37: warning: dereference of noderef expression
> mm/oom_kill.c:225:28: warning: context imbalance in 'oom_badness' - unexpected unlock
> mm/oom_kill.c:406:9: warning: context imbalance in 'dump_tasks' - different lock contexts for basic block
> >> mm/oom_kill.c:918:17: warning: context imbalance in '__oom_kill_process' - unexpected unlock

What exactly does this warning say? I do not see anything wrong about
the code. find_lock_task_mm returns a locked task when t != NULL and
mark_oom_victim doesn't do anything about the locking. Am I missing
something or the warning is just confused?

[...]
> 00508538 Michal Hocko 2019-01-07 915 t = find_lock_task_mm(p);
> 00508538 Michal Hocko 2019-01-07 916 if (!t)
> 00508538 Michal Hocko 2019-01-07 917 continue;
> 00508538 Michal Hocko 2019-01-07 @918 mark_oom_victim(t);
> 00508538 Michal Hocko 2019-01-07 919 task_unlock(t);
> 647f2bdf David Rientjes 2012-03-21 920 }

--
Michal Hocko
SUSE Labs