Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1611021

Re: lockdep warning: console vs. mem hotplug

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: lockdep warning: console vs. mem hotplug
Date 2017-03-28 16:30 +0200
Message-ID <tq0id-ss-7@gated-at.bofh.it> (permalink)
References <tn9i1-7Yx-9@gated-at.bofh.it> <tnjU6-6J9-25@gated-at.bofh.it> <toHrk-ZP-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.
> 
> 
> Sebastian, does this change make lockdep happy?
> 
> it removes console drivers from the __offline_isolated_pages(). not the
> best solution I can think of, but the simplest one.
> 
> ---
> 
>  mm/page_alloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index f749b7ff7c50..eb61e6ab5f4f 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -7705,7 +7705,7 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
>  		BUG_ON(!PageBuddy(page));
>  		order = page_order(page);
>  #ifdef CONFIG_DEBUG_VM
> -		pr_info("remove from free list %lx %d %lx\n",
> +		printk_deferred(KERN_INFO "remove from free list %lx %d %lx\n",
>  			pfn, 1 << order, end_pfn);
>  #endif
>  		list_del(&page->lru);

I believe this is not a proper fix. Although this code is ugly and maybe
it doesn't really need zone->lock because that should be the page
allocator internal thing the problem is that printk shouldn't impose
such a subtle dependency on locks. Why does the timer needs to allocate
at all?

-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: lockdep warning: console vs. mem hotplug Michal Hocko <mhocko@kernel.org> - 2017-03-28 16:30 +0200
  Re: lockdep warning: console vs. mem hotplug Petr Mladek <pmladek@suse.com> - 2017-03-28 18:10 +0200
    Re: lockdep warning: console vs. mem hotplug Michal Hocko <mhocko@kernel.org> - 2017-03-29 09:40 +0200
      Re: lockdep warning: console vs. mem hotplug Petr Mladek <pmladek@suse.com> - 2017-03-30 11:50 +0200
  Re: lockdep warning: console vs. mem hotplug Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-03-30 06:10 +0200

csiph-web