P22: Implement Sleep Locks, Scheduler Support and FS Concurrency (Built on P21)#215
Closed
illuminati2285 wants to merge 5 commits intocodenet:p22-sleeplocksfrom
Closed
P22: Implement Sleep Locks, Scheduler Support and FS Concurrency (Built on P21)#215illuminati2285 wants to merge 5 commits intocodenet:p22-sleeplocksfrom
illuminati2285 wants to merge 5 commits intocodenet:p22-sleeplocksfrom
Conversation
Owner
|
There are merge conflicts now. Can you please merge |
Author
|
Done, I have merged p22-sleeplocks into my branch and manually resolved all the merge conflicts |
Owner
|
GitHub is still not happy with the diff. This happened because of some mess in It might be better to create a new branch from |
Author
|
Link to the clean PR [#226] |
Owner
|
ok closing this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note:
This branch (p22) is built directly on top of my completed p21 branch(for which I have already raised a PR[#214 ]). I am pointing this PR to p20-exec as the base branch since the official upstream p22 branch is not available yet. (Once the p22 branch is created, the base branch of this PR can be changed to p22 for merging.)
For the P21 changes, please see my previous PR here: [#214 ]
The changes below specifically outline the P22 architecture(built on top of my p21 branch).
Overview
This PR fulfills the P22 requirements by implementing sleep locks and adding sleeping process support to the scheduler. As per the
xv6-publicdesign, processes can nowsleepand bewoken up. Sleep locks have been incorporated everywhere across the file system, allowing a process to safely sleep on a disk buffer and get woken up inside a disk interrupt.Key Changes
sleeplock.c,sleeplock.h,proc.csleep()and bewakeup().ide.c,bio.cxv6-public.ideintr).bget()to prevent stale data corruption if a block is recycled while a process is sleeping.fs.c,file.cvalidflag disk reads withilock()andiunlock()wrappers.log.cbegin_op()andend_op()using the new sleep/wakeup logic to guarantee safe log commits across multiple concurrent file system calls.main.c,proc.cinitlog,mknod) out ofmain.c. Setting these up now uses the disk, which means the system needs to be able tosleep().forkret()instead, so the very first process takes care of it.yield()) inforkret(). This forces any other starting processes to patiently wait until the first process finishes loading the main disk info (Superblock) before they try to run.Testing(until now)
Multi-process boot succeeds (race condition mitigated).
Standard single-process commands execute normally. (Note: High contention stress-testing triggers the expected lost-wakeup deadlock, which is addressed in P23).