Thread (14 messages) 14 messages, 5 authors, 2020-06-23

Re: [RFC PATCH v5 3/3] docs: scheduler: Add introduction to scheduler context-switch

From: Srikar Dronamraju <hidden>
Date: 2020-05-26 10:27:02
Also in: linux-mips, lkml

* john mathew [off-list ref] [2020-05-14 12:26:37]:
+
+Context Switching
+-----------------
+
+Context switching, the switching from a running task to another,
+is done by the context_switch() function defined in kernel/sched.c.
context_switch is defined in kernel/sched/core.c 
+It is called by __schedule() when a new process has been selected to run.
+The execution flow is as follows:
+
+
+  For a kernel task switching to a user task, switch_mm_irqs_off()
+  replaces the address space of prev kernel task with the next from the user
+  task. Same as for exiting process in this case, the context_switch()
Did you mean existing instead of exiting?
+  function saves the pointer to the memory descriptor used by prev in the
+  runqueue???s prev_mm field and resets prev task active address space.
+
-- 
Thanks and Regards
Srikar Dronamraju
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help