From: Daniel Kiper Subject: Re: [PATCH] console: allocate ring buffer earlier Date: Fri, 5 Dec 2014 18:22:57 +0100 Message-ID: <20141205172257.GC16236@olila.local.net-space.pl> References: <5481F18C020000780004D535@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xwwb0-0001u9-Hm for xen-devel@lists.xenproject.org; Fri, 05 Dec 2014 17:23:10 +0000 Content-Disposition: inline In-Reply-To: <5481F18C020000780004D535@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Keir Fraser , Ian Jackson , Tim Deegan , Ian Campbell , xen-devel List-Id: xen-devel@lists.xenproject.org On Fri, Dec 05, 2014 at 04:55:24PM +0000, Jan Beulich wrote: > ... when "conring_size=" was specified on the command line. We can't > really do this as early as we would want to when the option was not > specified, as the default depends on knowing the system CPU count. Yet > the parsing of the ACPI tables is one of the things that generates a > lot of output especially on large systems. > > I didn't change ARM, as I wasn't sure how far ahead this call could be > pulled. > > Signed-off-by: Jan Beulich Make sense for me but I think that we should have the same thing for ARM too. > --- a/xen/arch/x86/setup.c > +++ b/xen/arch/x86/setup.c > @@ -1187,6 +1187,7 @@ void __init noreturn __start_xen(unsigne > } > > vm_init(); > + console_init_mem(); > vesa_init(); > > softirq_init(); > --- a/xen/drivers/char/console.c > +++ b/xen/drivers/char/console.c > @@ -744,15 +744,14 @@ void __init console_init_preirq(void) > } > } > > -void __init console_init_postirq(void) > +void __init console_init_mem(void) > { > char *ring; > unsigned int i, order, memflags; > - > - serial_init_postirq(); > + unsigned long flags; > > if ( !opt_conring_size ) > - opt_conring_size = num_present_cpus() << (9 + xenlog_lower_thresh); > + return; > > order = get_order_from_bytes(max(opt_conring_size, conring_size)); > memflags = MEMF_bits(crashinfo_maxaddr_bits); > @@ -763,17 +762,28 @@ void __init console_init_postirq(void) > } > opt_conring_size = PAGE_SIZE << order; > > - spin_lock_irq(&console_lock); > + spin_lock_irqsave(&console_lock, flags); I am not sure why are you change spin_lock_irq() to spin_lock_irqsave() here. Could you explain this in commit message? > for ( i = conringc ; i != conringp; i++ ) > ring[i & (opt_conring_size - 1)] = conring[i & (conring_size - 1)]; > conring = ring; > smp_wmb(); /* Allow users of console_force_unlock() to see larger buffer. */ > conring_size = opt_conring_size; > - spin_unlock_irq(&console_lock); > + spin_unlock_irqrestore(&console_lock, flags); Ditto. Daniel