Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skyzh/oom_killer
Project 2 of SJTU CS356 Operating System Projects
https://github.com/skyzh/oom_killer
Last synced: about 1 month ago
JSON representation
Project 2 of SJTU CS356 Operating System Projects
- Host: GitHub
- URL: https://github.com/skyzh/oom_killer
- Owner: skyzh
- License: mit
- Created: 2020-05-02T09:31:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-04T08:27:18.000Z (over 4 years ago)
- Last Synced: 2024-10-12T09:19:13.235Z (2 months ago)
- Language: Makefile
- Homepage:
- Size: 3.42 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cs - @skyzh, 2020 Spring
README
# OS Project 2
## TL;DR
First of all, you need to patch the original kernel. Here I provide 2 ways.
1. Use `kernel_space/patch.diff`. Apply it on goldfish-3.4 from AOSP project.
2. Copy all files from `kernel_space/archive.zip`. They are kept to have the same structure as in Linux kernel.Then, you may build and run the kernel. After the emulator is boot with new kernel, use Makefile in user_land to run tests.
```bash
make notifier # run user-space daemon
make test
```This will automatically build test program, push it to `/data/local`, and run it with 10070 user.
## Project Structure
```
.
├── kernel_space files modified in Linux Kernel
│ ├── archive.zip all modified files in original folder structure
│ ├── patch.diff patch file, should be applied on git repo
│ └── patch.sh script used to generate patch file
└── user_land
├── Makefile
├── benchmark benchmark program
│ ├── jni
│ │ ├── Android.mk
│ │ └── benchmark.c
│ ├── out
│ │ └── dummy.txt
│ └── result benchmark raw result
│ ├── goldfish_3.4.out
│ ├── kernel_log.txt
│ ├── kernel_log_notifier.txt
│ ├── kernel_log_timer.txt
│ ├── kernel_log_trivial.txt
│ ├── oom_killer_disabled.out
│ ├── oom_killer_enabled.out
│ ├── oom_killer_trivial.out
│ ├── oom_killer_with_limit.out
│ └── original.out
├── benchmark_analysis benchmark analysis scripts
│ ├── analysis.Rmd
│ ├── analysis_overcommit.Rmd
│ ├── kernel_log_parser.py
│ ├── parse.sh
│ ├── parser.py
│ ├── result.csv
│ └── result_overcommit.csv
├── common.h contains all syscall wrapper and tmalloc
├── mm_get_limit program to get all limit in system
│ └── jni
│ ├── Android.mk
│ └── mm_get_limit.c
├── mm_notifier the user-space daemon
│ └── jni
│ ├── Android.mk
│ ├── Application.mk
│ └── mm_notifier.cpp
├── mm_set_limit program to set a user limit
│ └── jni
│ ├── Android.mk
│ └── mm_set_limit.c
├── project2_test test program provided by TA
│ └── jni
│ ├── Android.mk
│ └── project2_test.c
└── trace debug scripts for event tracing
├── Makefile
├── enable_trace.sh
└── test.cpp
```## Acknowledgement
The design of this OOM killer is inspired by a lot of things. This includes:
1. Linux kernel documentation. In that, I find a lot of tools useful for tracing.
2. Linux community. Some un-merged patches inspired me of OOM design.
3. My classmates. When discussing about and solving problems they encountered,
I also came up with some new ideas. Thanks Zefu Wang, Bugen Zhao, and Yimin Zhao
for their open-minded sharing.