yhzhang0128 / egos-2000

Envision a future where every student can read all the code of a teaching operating system.
Other
2.2k stars 157 forks source link

Optimized System Calls #29

Closed yacyam closed 3 months ago

yacyam commented 3 months ago

Here is what I found from the changes you proposed.

  1. Entering the shell now takes 7-8 seconds instead of 15-16 seconds
  2. Shell no longer lags while typing
  3. Spawning processes takes around 4-5 seconds instead of 9-10 seconds.

I tried testing another scheme of directly writing and reading from the User Space Syscall Struct during a system call, removing mmu_switch in proc_try_recv, but it is not any faster. The bottleneck seems to be switching between processes with mmu_switch in proc_yield. This is apparent when loading a process, due to the number of switches between GPID_PROC and GPID_FILE.