Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1331299
| From | Petr Mladek <pmladek@suse.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] printk: avoid livelock if another CPU printks continuously |
| Date | 2016-02-10 17:20 +0100 |
| Message-ID | <r0FEK-4vM-23@gated-at.bofh.it> (permalink) |
| References | <r00Lh-1TO-41@gated-at.bofh.it> <r0EfF-3qm-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed 2016-02-10 09:44:07, Steven Rostedt wrote: > On Wed, 10 Feb 2016 15:36:49 +0100 > Petr Mladek <pmladek@suse.com> wrote: > > > Bcc: > > Subject: Re: [PATCH] printk: avoid livelock if another CPU printks > > continuously > > Reply-To: > > In-Reply-To: <1454963703-20433-1-git-send-email-dvlasenk@redhat.com> > > > > Hmm, playing with mail headers? Yeah. I am trying to do this reply back in the original thread. > > > + /* Good, other CPU entered "for(;;)" loop */ > > > + goto out; > > > + } > > > + } > > > + /* No one seems to be willing to take it... */ > > > + if (console_trylock()) > > > + goto again; /* we took it */ > > > + /* Nope, someone else holds console_sem! Good */ > > > > The cycle gives a big chance other CPUs to enter console_unlock(). > > It means that more CPUs might end up in the above busy cycle. > > > > It gives a chance to move the printing to another CPU. It likely > > slows down the flood of messages because the producer end up > > here as well. > > > > So, it probably works but the performance is far from optimal. > > Many CPUs might end up doing nothing. I am afraid that this is > > not the right way to go. > > Note, it's not that performance critical, and the loop only happens if > someone else is adding to the console, which hopefully, should be rare. I probably used too strong words. It is possible that the performance impact will not be critical. But the behavior is non-deterministic. I think that the approach taken by Jack is more promising. I mean the offloading of the console stuff to a workqueue. Best Regards, Petr
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Petr Mladek <pmladek@suse.com> - 2016-02-10 15:50 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Petr Mladek <pmladek@suse.com> - 2016-02-10 17:20 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Steven Rostedt <rostedt@goodmis.org> - 2016-02-10 17:30 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Peter Hurley <peter@hurleysoftware.com> - 2016-02-10 18:00 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-02-11 09:30 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Petr Mladek <pmladek@suse.com> - 2016-02-11 12:50 +0100
csiph-web