From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A379C04AAF for ; Thu, 16 May 2019 13:54:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75A4320657 for ; Thu, 16 May 2019 13:54:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727592AbfEPNym (ORCPT ); Thu, 16 May 2019 09:54:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57527 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727533AbfEPNym (ORCPT ); Thu, 16 May 2019 09:54:42 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4ED73082B22; Thu, 16 May 2019 13:54:41 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.159]) by smtp.corp.redhat.com (Postfix) with SMTP id CF85D5D6A9; Thu, 16 May 2019 13:54:37 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 16 May 2019 15:54:40 +0200 (CEST) Date: Thu, 16 May 2019 15:54:36 +0200 From: Oleg Nesterov To: Sultan Alsawaf Cc: Christian Brauner , Daniel Colascione , Suren Baghdasaryan , Steven Rostedt , Tim Murray , Michal Hocko , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Ingo Molnar , Peter Zijlstra , LKML , "open list:ANDROID DRIVERS" , linux-mm , kernel-team , Andy Lutomirski , "Serge E. Hallyn" , Kees Cook , Joel Fernandes Subject: Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android Message-ID: <20190516135435.GA22564@redhat.com> References: <20190320015249.GC129907@google.com> <20190507021622.GA27300@sultan-box.localdomain> <20190507153154.GA5750@redhat.com> <20190507163520.GA1131@sultan-box.localdomain> <20190509155646.GB24526@redhat.com> <20190509183353.GA13018@sultan-box.localdomain> <20190510151024.GA21421@redhat.com> <20190513164555.GA30128@sultan-box.localdomain> <20190515145831.GD18892@redhat.com> <20190515172728.GA14047@sultan-box.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190515172728.GA14047@sultan-box.localdomain> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 16 May 2019 13:54:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/15, Sultan Alsawaf wrote: > > On Wed, May 15, 2019 at 04:58:32PM +0200, Oleg Nesterov wrote: > > Could you explain in detail what exactly did you do and what do you see in dmesg? > > > > Just in case, lockdep complains only once, print_circular_bug() does debug_locks_off() > > so it it has already reported another false positive __lock_acquire() will simply > > return after that. > > > > Oleg. > > This is what I did: > diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c > index 774ab79d3ec7..009e7d431a88 100644 > --- a/kernel/locking/lockdep.c > +++ b/kernel/locking/lockdep.c > @@ -3078,6 +3078,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, > int class_idx; > u64 chain_key; > > + BUG_ON(!debug_locks || !prove_locking); > if (unlikely(!debug_locks)) > return 0; > > diff --git a/lib/debug_locks.c b/lib/debug_locks.c > index 124fdf238b3d..4003a18420fb 100644 > --- a/lib/debug_locks.c > +++ b/lib/debug_locks.c > @@ -37,6 +37,7 @@ EXPORT_SYMBOL_GPL(debug_locks_silent); > */ > int debug_locks_off(void) > { > + return 0; > if (debug_locks && __debug_locks_off()) { > if (!debug_locks_silent) { > console_verbose(); OK, this means that debug_locks_off() always returns 0, as if debug_locks was already cleared. Thus print_deadlock_bug() will do nothing, it does if (!debug_locks_off_graph_unlock() || debug_locks_silent) return 0; iow this means that even if lockdep finds a problem, the problem won't be reported. > [ 1.492128] BUG: key 0000000000000000 not in .data! > [ 1.492141] BUG: key 0000000000000000 not in .data! > [ 1.492152] BUG: key 0000000000000000 not in .data! > [ 1.492228] BUG: key 0000000000000000 not in .data! > [ 1.492238] BUG: key 0000000000000000 not in .data! > [ 1.492248] BUG: key 0000000000000000 not in .data! I guess this is lockdep_init_map() which does printk("BUG:") itself, but due to your change above it doesn't do WARN(1) and thus there is no call trace. Oleg.