lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071101152714.GA2489@Krystal>
Date:	Thu, 1 Nov 2007 11:27:14 -0400
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	Pavel Machek <pavel@....cz>
Cc:	Tim Bird <tim.bird@...sony.com>, Matt Mackall <mpm@...enic.com>,
	linux kernel <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...hat.com>, Jon Smirl <jonsmirl@...oo.com>
Subject: Re: IRQ off latency of printk is very high

* Pavel Machek (pavel@....cz) wrote:
> Hi!
> 
> > > Hmm, I see this at the beginning of the post-BK era (2.6.12-rc2):
> > > 
> > > 	        spin_lock_irqsave(&logbuf_lock, flags);
> > > 		...
> > > 		spin_unlock(&logbuf_lock);
> > > 		call_console_drivers(_con_start, _log_end);
> > > 		local_irq_restore(flags);
> > > 
> > 
> > Well, I need to do some more research.  This must be in
> > release_console_sem().  I was looking at vprintk, through
> > the ages.  At 2.6.16, it looked like this:
> > 
> >         spin_lock_irqsave(&logbuf_lock, flags);
> >         ...
> >               spin_unlock_irqrestore(&logbuf_lock, flags);
> >               console_may_schedule = 0;
> >               release_console_sem();
> > 
> > but the irq restore has been moving around to different places
> > in that function over the last few years.  I suspect that in the
> > common case the irqsave in vprintk is the one that disables
> > ints.
> > 
> > It appears that formerly interrupts were enabled in vprintk but
> > re-disabled immediately upon entering release_console_sem().
> > As it is now, they're held during formatting, buffering,
> > and output, which seems excessive.
> > 
> > It seems draconian to drain the entire buffer with ints disabled.
> > Is it possible to break this up and send out smaller chunks
> > at a time?  Maybe by putting a chunk loop in release_console_sem()?
> 
> Well, I believe someone got
> 
> DDetetccctted ed 113223 HHzz CPUCPU
> 
> in his dmesg, and now we have this 'draconian' locking. How can we
> prevent mangled messages without it?
> 							Pavel


The main interest seems to be to protect from mixed printk output
between different CPUs in process context. I don't think it would be
that bad if interrupts come and output error messages in the middle of a
printk, isn't it ?

therefore, could we do something like :


if (!in_irq())
  spin_lock(&logbuf_lock);
...
if (!in_irq())
  spin_unlock(&logbuf_lock);

? (yes, this is a crazy idea)

Mathieu


> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ