Kernel code interrupted by Timer

Frederic Weisbecker fweisbec at gmail.com
Sat Feb 9 11:22:48 EST 2013


2013/2/9 Peter Teoh <htmldeveloper at gmail.com>:
> A search in the entire subtree of arch/x86/ and including all its
> subdirectories, (for 3.2.0 kernel) return only TWO result where
> preempt_schedule_irq is called:   kernel/entry_64.S and kernel/entry_32.S.
> And the called is in fact resume_kernel(),   ie, it is NOT called from timer
> interrupt, but from wakeup context of the CPU, and is only executed ONCE
> upon waking up from hibernation.
>
> for example, calling from here:
>
> https://lkml.org/lkml/2012/5/2/298
>
> so definitely this preempt_schedule_irq() calling from irq mode is rare - at
> least for x86.

The name "resume_kernel" can indeed sound like something that is
called on hibernation resume. It's actually not related at all. It's a
piece of code that is called at the end of every irq and exception
when the interrupted code was running in the kernel. If the
interrupted code was running in userspace, we jump to
resume_userspace.



More information about the Kernelnewbies mailing list