Re: linux context switching
From: Catalin Marinas (c_marinas_at_yahoo.com)
Date: 02/09/04
- Next message: Måns Rullgård: "Re: Kernel loaded at top of memory"
- Previous message: Kasper Dupont: "Re: Kernel loaded at top of memory"
- In reply to: ¹ßµü¼¼¿ì±â: "linux context switching"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 09 Feb 2004 10:36:22 +0000
> In linux, is there kernel context?
Yes.
> Assume following sistuation,
> 1. a user process is having CPU
> 2. the process calls systems calls such as ioctl()
> 3. the process is excuted in a kernel mode, at this momnet is there context
> switching?
There is no context switching in this case. The kernel address space
(usually starting at 0xc0000000) is mapped in every process address
space. You might get the context switched to a different user process
when returning from the system call.
> 4. H/W interrupt occurs
> 5. save contexts of the process in a kernel mode
> 6. interrupt handler is excuted
> 7. the handler gets finished
> 8. RET is called
> 9. at this moment, without preemption, the interrupted process in a kernel
> mode will be selected again.
> If the steps I mentioned above is right, I think there is no pure kernel
> context to be saved.
There is pure kernel context - the idle task (pid 0) and several kernel
threads.
> I have analyzed source codes. But it's very hard to understand them and
> figure out my questions.
The INIT_TASK definition in include/linux/init_task.h contains active_mm
= &init_mm (which is pure kernel context).
Catalin
- Next message: Måns Rullgård: "Re: Kernel loaded at top of memory"
- Previous message: Kasper Dupont: "Re: Kernel loaded at top of memory"
- In reply to: ¹ßµü¼¼¿ì±â: "linux context switching"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|