[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190510151024.GA21421@redhat.com>
Date: Fri, 10 May 2019 17:10:25 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Sultan Alsawaf <sultan@...neltoast.com>
Cc: Christian Brauner <christian@...uner.io>,
Daniel Colascione <dancol@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Steven Rostedt <rostedt@...dmis.org>,
Tim Murray <timmurray@...gle.com>,
Michal Hocko <mhocko@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arve Hjønnevåg <arve@...roid.com>,
Todd Kjos <tkjos@...roid.com>,
Martijn Coenen <maco@...roid.com>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
"open list:ANDROID DRIVERS" <devel@...verdev.osuosl.org>,
linux-mm <linux-mm@...ck.org>,
kernel-team <kernel-team@...roid.com>,
Andy Lutomirski <luto@...capital.net>,
"Serge E. Hallyn" <serge@...lyn.com>,
Kees Cook <keescook@...omium.org>,
Joel Fernandes <joel@...lfernandes.org>
Subject: Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android
On 05/09, Sultan Alsawaf wrote:
>
> On Thu, May 09, 2019 at 05:56:46PM +0200, Oleg Nesterov wrote:
> > Impossible ;) I bet lockdep should report the deadlock as soon as find_victims()
> > calls find_lock_task_mm() when you already have a locked victim.
>
> I hope you're not a betting man ;)
I am starting to think I am ;)
If you have task1 != task2 this code
task_lock(task1);
task_lock(task2);
should trigger print_deadlock_bug(), task1->alloc_lock and task2->alloc_lock are
the "same" lock from lockdep pov, held_lock's will have the same hlock_class().
> CONFIG_PROVE_LOCKING=y
OK,
> And a printk added in vtsk_is_duplicate() to print when a duplicate is detected,
in this case find_lock_task_mm() won't be called, and this is what saves us from
the actual deadlock.
> and my phone's memory cut in half to make simple_lmk do something, this is what
> I observed:
> taimen:/ # dmesg | grep lockdep
> [ 0.000000] \x09RCU lockdep checking is enabled.
this reports that CONFIG_PROVE_RCU is enabled ;)
> taimen:/ # dmesg | grep simple_lmk
> [ 23.211091] simple_lmk: Killing android.carrier with adj 906 to free 37420 kiB
> [ 23.211160] simple_lmk: Killing oadcastreceiver with adj 906 to free 36784 kiB
yes, looks like simple_lmk has at least 2 locked victims. And I have no idea why
you do not see anything else in dmesg. May be debug_locks_off() was already called.
But see above, "grep lockdep" won't work. Perhaps you can do
"grep -e WARNING -e BUG -e locking".
Oleg.
Powered by blists - more mailing lists