* System call service routine and interrupt context
@ 2018-04-30 14:43 Pritam Bankar
2018-04-30 15:12 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Pritam Bankar @ 2018-04-30 14:43 UTC (permalink / raw)
To: kernelnewbies
Hi,
My question is, do all the code of interrupt handler in system call
gets executed in interrupt context?
System calls generate software interrupts. So when I do open() syscall
it we call do_sys_open() handler which will eventually call file
system specific open function call. Will all this happen in interrupt
context until I get open file descriptor in user land?
If not when does context change?
Thanks and regards,
Pritam Bankar
^ permalink raw reply [flat|nested] 2+ messages in thread
* System call service routine and interrupt context
2018-04-30 14:43 System call service routine and interrupt context Pritam Bankar
@ 2018-04-30 15:12 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2018-04-30 15:12 UTC (permalink / raw)
To: kernelnewbies
On Mon, Apr 30, 2018 at 08:13:11PM +0530, Pritam Bankar wrote:
> Hi,
>
> My question is, do all the code of interrupt handler in system call
> gets executed in interrupt context?
No.
> System calls generate software interrupts.
Some do, some do not. It all depends :)
> So when I do open() syscall it we call do_sys_open() handler which
> will eventually call file system specific open function call.
Normal file open calls do not generate a hardware interrupt. Some
might, but some might not. It all depends.
> Will all this happen in interrupt context until I get open file
> descriptor in user land?
No, if disk I/O is needed, which requires interrupts, the system call
process (your process) will sleep in the kernel until the needed I/O
happens and is returned. That I/O can cause irq code to run, and if so,
that's fine, it runs in its own context.
> If not when does context change?
Often and frequently :)
Sorry, it's a complex thing, all depending on the hardware, system,
cache, and loads of other things. Try using ftrace or other function
tracing tools to follow a call through the kernel to see how this all
plays out.
hope this helps,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-30 15:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-30 14:43 System call service routine and interrupt context Pritam Bankar
2018-04-30 15:12 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.