Re: What happens when an interrupt comes while in middle of printk?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> [2015-02-25T08:37:59+0530]: "manty kuma" (manty-kuma):
,----[ manty-kuma ]
| What happens if an interrupt comes while in middle of printk execution and
| the interrupt handler has a printk in it?
| 
| There is a chance that the log_buf could be corrupted. isn't it?
`----
no this doesn't happen. look at vprintk_emit(...) which invokes
local_irq_save(...).

essentially, printk tries to acquire console_lock. if it succeeds all is
well. otherwise, output is dumped to a log buffer. when the current
holder of console_lock, unlocks it, log buffer is emptied...

---
thanks
anupam

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux