Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1474157
| From | Petr Mladek <pmladek@suse.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() |
| Date | 2016-09-01 10:20 +0200 |
| Message-ID | <scvo5-6SP-5@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <sbM7D-1Ul-7@gated-at.bofh.it> <sbNdo-2Ps-23@gated-at.bofh.it> <sbNGp-2Zk-1@gated-at.bofh.it> <sbPfb-44D-5@gated-at.bofh.it> <scv4J-6oI-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu 2016-09-01 16:55:07, Sergey Senozhatsky wrote: > On (08/30/16 13:19), Petr Mladek wrote: > > > > I see. But then we will need to be more careful because printk_func > > and printk_func_saved will be manipulated in different contexts: > > normal, irq, nmi. A solution might be using an atomic counter > > and selecting the right vprintk_func according to the value. > > alt_printk_enter() must be done with local IRQs disabled. so IRQ cannot > race with `normal' alt_printk. other IRQs cannot race with the current IRQ, > because we have local IRQs disabled. the only thing that can race here is - NMI. > both `normal' and IRQ alt_printk can use the same per-CPU buffer, they never > race. NMI needs to have its own. Yes. Well, my concern was how to atomically change the printk_func pointer and save the previous value at the same time. You could not use locks because NMIs are involved. Best Regards, Petr
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-08-29 14:40 +0200
Re: [PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Petr Mladek <pmladek@suse.com> - 2016-08-29 17:20 +0200
Re: [PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-08-30 03:10 +0200
Re: [PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-08-30 10:00 +0200
Re: [PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Petr Mladek <pmladek@suse.com> - 2016-08-30 11:10 +0200
Re: [PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-08-30 11:40 +0200
Re: [PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Petr Mladek <pmladek@suse.com> - 2016-08-30 13:20 +0200
Re: [PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-08-31 06:10 +0200
Re: [PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-09-01 10:00 +0200
Re: [PATCH] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Petr Mladek <pmladek@suse.com> - 2016-09-01 10:20 +0200
csiph-web