The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Sebastian Ott <sebott@linux.vnet.ibm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Subject: Re: lockdep warning: console vs. mem hotplug
Date: Thu, 30 Mar 2017 11:45:00 +0200	[thread overview]
Message-ID: <20170330094500.GN2846@pathway.suse.cz> (raw)
In-Reply-To: <20170329073146.GA27994@dhcp22.suse.cz>

On Wed 2017-03-29 09:31:47, Michal Hocko wrote:
> On Tue 28-03-17 18:00:16, Petr Mladek wrote:
> > On Tue 2017-03-28 16:22:27, Michal Hocko wrote:
> > > On Sat 25-03-17 09:04:42, Sergey Senozhatsky wrote:
> > > > On (03/21/17 13:44), Sergey Senozhatsky wrote:
> > > > [..]
> > > > > so we probably can
> > > > > 
> > > > > 
> > > > > 1) move pr_info() out of zone->lock in __offline_isolated_pages().
> > > > >    meh...
> > > > > 
> > > > > 
> > > > > 2) switch to printk_deferred() in __offline_isolated_pages().
> > > > >    meh.. there might a bunch of other printks done from under zone->lock.
> > > > > 
> > > > > 
> > > > > 3) move add_timer() out of sclp_con_lock console in sclp_console_write().
> > > > >    well, there can be other consoles that do something similar.
> > > > > 
> > > > > 
> > > > > 4) ... something smart.
> > > > 
> > > > 
> > Regarding the timer code. The problem seems to be with static
> > timers. They call debug_object_init() when the timer is used
> > for the first time. See the special handling of not-found
> > objects in debug_object_activate().
> 
> Thanks for the clarification!
> 
> > Now, __debug_object_init() calls fill_pool() that allocates
> > the memory. A solution would be to either use static
> > struct kmem_cache
> 
> I am not sure what do you mean by that.

The problem is when the timer is defined using
DEFINE_TIMER() and initialized using __TIMER_INITIALIZER().

I had an unclear idea about extending the macro to define
also the needed structure that might later be used by
debug_object_init() instead of taking it from the pool.

I am sorry for the confusion with struct kmem_cache.
It is the type of the pointer that is passed when
allocating the memory in fill_pool(). It seems
we actually need struct debug_obj. But it might
be even more complicated.


> > for statically defined timers and avoid the allocation. Or we should
> > call fill_pool() asynchronously from a safe context.
> 
> I think we should avoid the allocation completely. It is GFP_ATOMIC and
> so likely to fail under heavy memory pressure. Async fill will make it
> slightly more complicated but still unreliable.
>  
> > What do you think?
> 
> Why cannot we simply embed this debugging data into the timer itself?
> It will make the structure larger (I didn't check how much) but this is
> an opt in feature so it should be acceptable.

This sounds reasonable to me.

> A subtle dependecny on the allocator is really bad and
> we should get rid of it.

Yup.

Best Regards,
Petr

  reply	other threads:[~2017-03-30  9:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 16:43 lockdep warning: console vs. mem hotplug Sebastian Ott
2017-03-21  4:44 ` Sergey Senozhatsky
2017-03-21  5:04   ` Sergey Senozhatsky
2017-03-25  0:04   ` Sergey Senozhatsky
2017-03-25  1:08     ` Steven Rostedt
2017-03-25  1:37       ` Sergey Senozhatsky
2017-03-25 10:59     ` Sebastian Ott
2017-03-28 14:22     ` Michal Hocko
2017-03-28 16:00       ` Petr Mladek
2017-03-29  7:31         ` Michal Hocko
2017-03-30  9:45           ` Petr Mladek [this message]
2017-03-30  3:59       ` Sergey Senozhatsky
2017-07-24 12:46   ` Sebastian Ott
2017-07-24 13:32     ` Sergey Senozhatsky
2017-03-24 16:39 ` Steven Rostedt
2017-03-24 16:57   ` Sebastian Ott
2017-03-25  0:00   ` Sergey Senozhatsky
2017-03-25  1:00     ` Steven Rostedt

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=20170330094500.GN2846@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.vnet.ibm.com \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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