Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1330455
| From | Denys Vlasenko <dvlasenk@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] printk: avoid livelock if another CPU printks continuously |
| Date | 2016-02-09 17:50 +0100 |
| Message-ID | <r0jEd-6IG-7@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <r01nX-2ow-11@gated-at.bofh.it> <r0i5t-5IR-37@gated-at.bofh.it> <r0if8-5Nd-17@gated-at.bofh.it> <r0ioQ-5QL-87@gated-at.bofh.it> <r0iRQ-678-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 02/09/2016 04:50 PM, Steven Rostedt wrote: > On Tue, 09 Feb 2016 16:24:29 +0100 >>>>>> + /* 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 */ >>>>> >>>>> Perhaps add a few loops to the taking of the console sem. >>>> >>>> Why? >>>> >>>> If we fail to take the lock, another CPU took it. >>>> There is no need to try harder, as soon as we know that any >>>> other CPU took that lock, we can safely exit this function. >>> >>> Because if this CPU is the one spamming the other CPU, it will widen >>> the window to be the one that takes the lock. >> >> If we reached this code, we aren't the spamming CPU. We are the CPU >> which is being spammed (we are in the loop which services the backlog). > > No, I mentioned the taking of console sem. The spamming task will be > trying that a bit, failing and then letting this CPU continue doing its > bidding. That's exactly what we *don't* want to happen. We want that other CPU to get the lock. How do you plan to achieve that, if not by giving it a grace period when it can grab a lock?
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] printk: avoid livelock if another CPU printks continuously Denys Vlasenko <dvlasenk@redhat.com> - 2016-02-08 21:40 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Steven Rostedt <rostedt@goodmis.org> - 2016-02-08 22:20 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Denys Vlasenko <dvlasenk@redhat.com> - 2016-02-09 16:10 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Steven Rostedt <rostedt@goodmis.org> - 2016-02-09 16:20 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Denys Vlasenko <dvlasenk@redhat.com> - 2016-02-09 16:30 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Steven Rostedt <rostedt@goodmis.org> - 2016-02-09 17:00 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Denys Vlasenko <dvlasenk@redhat.com> - 2016-02-09 17:10 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Steven Rostedt <rostedt@goodmis.org> - 2016-02-09 17:40 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Denys Vlasenko <dvlasenk@redhat.com> - 2016-02-09 17:50 +0100
Re: [PATCH] printk: avoid livelock if another CPU printks continuously Steven Rostedt <rostedt@goodmis.org> - 2016-02-09 18:00 +0100
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