Re: Kernel code interrupted by Timer

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

 





On Sat, Feb 9, 2013 at 8:08 AM, Peter Teoh <htmldeveloper@xxxxxxxxx> wrote:


On Sat, Feb 9, 2013 at 1:08 AM, Gaurav Jain <gjainroorkee@xxxxxxxxx> wrote:
What happens if the kernel executing in some process context (let's say executing a time-consuming syscall) gets interrupted by the Timer - which is apparently allowed in 2.6 onwards kernels.

My understanding is that once the interrupt handler is done executing, we should switch back to where the kernel code was executing. Specifically, the interrupt handler for the Timer interrupt should not schedule some other task since that might leave kernel data in an inconsistent state - kernel didn't finish doing whatever it was doing when interrupted. 

at the microscopic level, every stream of assembly instructions can always be broken up and intercepted by interrupt, and possibly switched into another stream of assembly instruction or logic, the maintenance of state "consistency" is done via context switching.

context switching is done at software level, and i am not if there is difference between process context switch or thread/task level context switching, but hardware only guarantee register context switch - and not sure if it covers all the floating point (SSE) registers too (unlikely, performance overheads)....so.."consistency" is really how you write your software.   and u also have multiple switching (by different CPU) all taking place independently all the time, writing into the same piece of RAM.

I also know that nvidia GPU does not clean up its memory/state when switching from one process to another process, but that is beyond the control of hardware switching logic of the CPU anyway.



So, does the Timer interrupt handler include such a policy for the above case? 

--
Gaurav Jain




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




--
Regards,
Peter Teoh



--
Regards,
Peter Teoh
_______________________________________________
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