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

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

 




On February 24, 2015 10:07:59 PM EST, manty kuma <mantykuma@xxxxxxxxx> wrote:
>Dear All,
>
>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?
>
>Best Regards,
>Manty
>
>
Manty,

I admit to never looking, but I think you will find printk is atomic in someway.  You should review the source code to be sure.

Also remember the kernel is smp (symmetric multi-processing), so if printks were not atomic you would have line corruption far more frequently than just when an interrupt hits at the wrong time.

I've never seen corruption of that type. (Or at least not recently.  I seem to remember that issue in the 1980's, but that was the UNIX kernel.)

Greg
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

_______________________________________________
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