linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qian Cai <cai@lca.pw>
To: David Hildenbrand <david@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	pmladek@suse.com, rostedt@goodmis.org, peterz@infradead.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next v3] mm/hotplug: silence a lockdep splat with printk()
Date: Thu, 16 Jan 2020 11:27:28 -0500	[thread overview]
Message-ID: <A7D86B8F-678F-4159-8796-D358B70BCC79@lca.pw> (raw)
In-Reply-To: <2be969af-53c0-803b-e0b1-eb20d1077dd0@redhat.com>



> On Jan 16, 2020, at 11:04 AM, David Hildenbrand <david@redhat.com> wrote:
> 
> On 16.01.20 16:54, Michal Hocko wrote:
>> On Thu 16-01-20 09:53:13, Qian Cai wrote:
>>> 
>>> 
>>>> On Jan 16, 2020, at 9:28 AM, Michal Hocko <mhocko@kernel.org> wrote:
>>>> 
>>>> On Wed 15-01-20 12:29:16, Qian Cai wrote:
>>>>> It is guaranteed to trigger a lockdep splat if calling printk() with
>>>>> zone->lock held because there are many places (tty, console drivers,
>>>>> debugobjects etc) would allocate some memory with another lock
>>>>> held which is proved to be difficult to fix them all.
>>>> 
>>>> I am still not happy with the above much. What would say about something
>>>> like below instead?
>>>> "
>>>> It is not that hard to trigger lockdep splats by calling printk from
>>>> under zone->lock. Most of them are false positives caused by lock chains
>>>> introduced early in the boot process and they do not cause any real
>>>> problems. There are some console drivers which do allocate from the
>>>> printk context as well and those should be fixed. In any case false
>>>> positives are not that trivial to workaround and it is far from optimal
>>>> to lose lockdep functionality for something that is a non-issue.
>>>> <An example of such a false positive goes here>
>>>> "
>>> 
>>> I feel like I repeated myself too many times. A call trace for one lock dependency
>>> is sometimes from early boot process because lockdep will save the first one it
>>> encountered, but it does not mean the lock dependency will only not happen in
>>> early boot. I spent some time to study those early boot call traces in the given
>>> lockdep splats, and it looks to me the lock dependency is also possible after
>>> the boot.
>> 
>> Then state it explicitly with an example of the trace and explanation
>> that the deadlock is real. If the deadlock is real then it shouldn't be
>> really terribly hard to notice even without lockdep splats which get
>> disabled after the first false positive, right?
> 
> I was asking myself for a long time: did anybody actually see this
> deadlock in real life?

Nobody knows for sure. I think one reason is that not many people will use
memory offiline even if they do, it will mostly not be a continuous activity in
the system. debugobjects make it way easier to reproduce because it allocates
memory in random places, but then it is not all that popular.

  reply	other threads:[~2020-01-16 16:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 17:29 [PATCH -next v3] mm/hotplug: silence a lockdep splat with printk() Qian Cai
2020-01-16 14:28 ` Michal Hocko
2020-01-16 14:53   ` Qian Cai
2020-01-16 15:54     ` Michal Hocko
2020-01-16 16:04       ` David Hildenbrand
2020-01-16 16:27         ` Qian Cai [this message]
2020-01-16 16:05       ` Qian Cai
2020-01-16 17:43         ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A7D86B8F-678F-4159-8796-D358B70BCC79@lca.pw \
    --to=cai@lca.pw \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).