Skip to content

[compute/copy-on-write]: Add a new quiz about Transparent Huge Pages - #220

Closed
robertmercea wants to merge 420 commits into
cs-pub-ro:mainfrom
robertmercea:lab-7-fork-faults-new-quiz
Closed

robertmercea wants to merge 420 commits into
cs-pub-ro:mainfrom
robertmercea:lab-7-fork-faults-new-quiz

Conversation

@robertmercea

@robertmercea robertmercea commented Jan 21, 2026 •

Copy link
Copy Markdown

Prerequisite Checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Updated relevant documentation (if needed).

Description of changes

  • Change NUM_PAGES to 256 in the fork-faults guide to avoid Transparent Huge Pages (THP) being triggered
    • Previously, the number was set to 1024, which triggered the THP mechanism
    • The students would have only seen 2 page faults from the parent program instead of the expected 1024 (as per the course material), which was counterintuitive
  • Create a new quiz about THP
    • Added explanations about THP
    • Included external resources for further reading
  • Add the new quiz in config.yaml

VladNastase and others added 30 commits April 12, 2023 07:26
Adds link resolving and a shorter `config.yaml`

Signed-off-by: Vlad Nastase <vladdnastase@gmail.com>
Fixes an issue with some files not being copied and causing the build process to error

Signed-off-by: Vlad Nastase <vladdnastase@gmail.com>
Replace the D exercices with C one, as the students are more
familiar with C. Add an OpenMP example in the arena, as it
is more accessible.

Signed-off-by: cristian-vijelie <cristianvijelie@gmail.com>
Replace `with event:` with the equivalent `acquire() and `release()`
calls.

Signed-off-by: cristian-vijelie <cristianvijelie@gmail.com>
Leave nothing unexplained!

Signed-off-by: cristian-vijelie <cristianvijelie@gmail.com>
For better understanding and reasons

Signed-off-by: cristian-vijelie <cristianvijelie@gmail.com>
UNIX sockets are not available on non-POSIX systems.
Porting an application that uses UNIX sockets to a non-POSIX system
requires third-party libraries.

Signed-off-by: Alex Apostolescu <alexx.apostolescu@gmail.com>
Include a section that explores the advantages of loading dynamic
libraries using `mmap()`, rather than `read()`.
The main arguments are `demand paging` and convenience.

Signed-off-by: Alex Apostolescu <alexx.apostolescu@gmail.com>
Fixes a bunch of typos and punctuation errors in the compute lab content.

Signed-off-by: Teodor Juravlea <teodorjuravlea@gmail.com>
To force a major page fault, I/O reads are forced.
Getting swap-ins and outs would be another way, but it is more
difficult.

Signed-off-by: Cristian Vijelie <cristianvijelie@gmail.com>
Some will say that C++ is ugly. Google says that <thread> is ugly.

Signed-off-by: Cristian Vijelie <cristianvijelie@gmail.com>
Remove the check for directory name in include directives from cpplint.

Signed-off-by: Alex Apostolescu <alexx.apostolescu@gmail.com>
Nesting Berkley sockets API under Connection shadows its importance.
List it as an independent topic, followed by its practice items.
Add a practice item to implement the C equivalent of the python
sender-receiver example.

Signed-off-by: Alex Apostolescu <alexx.apostolescu@gmail.com>
Reorder tasks in practice: implement the client before running lsof.
State that this example uses SOCK_STREAM sockets.
Allow students to implement the client in C.

Signed-off-by: Alex Apostolescu <alexx.apostolescu@gmail.com>
`strtok_r` takes 3 arguments but only 2 were provided, thus the code didn't compile

Signed-off-by: Teodor Tiron <teotiron@gmail.com>
In this assignment, students will be required to implement basic shell
features such as changing directories (cd), displaying the current
working directory (pwd), handling environment variables, creating pipes,
and implementing logical operators (&& and ||). These features will
provide students with a solid understanding of how a shell operates
and will allow them to gain hands-on experience with the UNIX shell
environment.

Signed-off-by: Costin-Robert Sin <sin.costinrobert@gmail.com>
- Add checker

Signed-off-by: Gabriel Mocanu <gabi.mocanu98@gmail.com>
Move minishell statement to the generic structure for assignments.

Signed-off-by: Gabriel Mocanu <gabi.mocanu98@gmail.com>
Add src for minishell

Signed-off-by: Gabriel Mocanu <gabi.mocanu98@gmail.com>
Co-authored-by: Teodor Dutu <teodor.dutu@gmail.com>
Describe necessary packets

Signed-off-by: Cristian Vijelie <cristianvijelie@gmail.com>
Link all executables with the `Threads` library

Signed-off-by: Cristian Vijelie <cristianvijelie@gmail.com>
Include `cmake` and `libboost` in the installed packets

Signed-off-by: Cristian Vijelie <cristianvijelie@gmail.com>
Updated the DIE() macro with the missing matched open parentheses.

Signed-off-by: Stefan Magirescu <stefanmagirescu@yahoo.com>
- Remove missing reference in `content/overview.md`.
- Suggest usage of `watch` command.
- Fix typo and font in `media/file-descriptors.svg`.
- Rename `pipedes` to `pipe_des` and `filedes` to `file_des`
as they are 2 words.

Signed-off-by: Fabian Patras <patras.fabi@gmail.com>
Fix broken links.

Signed-off-by: Fabian Patras <patras.fabi@gmail.com>
Add a new section to the Arena which will present oneko as an
alterantive to xeyes.
Also add a relevant quiz.

Signed-off-by: Andrei Mutu <andrei.mutu@stud.acs.upb.ro>
Add a better explanatin about the differences between
containers and virtual machines.
Also add relevant quizzes.

Signed-off-by: Andrei Mutu <andrei.mutu@stud.acs.upb.ro>
This fixes 2 broken links to quizzes and enlarges the components of
an SVG image to make it clearer.

Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
Fix found typos in io/lab.

Signed-off-by: Tiberiu Deak <tiberiudeak09@gmail.com>
Fixes typos and punctuation errors in the io lab content.

Signed-off-by: Teodor Juravlea <teodorjuravlea@gmail.com>
CristianSLazar and others added 24 commits October 11, 2025 22:58
Created `static-dynamic` guide folder and moved assosiated files to it.
Modified references to it in `.md` files.

Signed-off-by: Cristian-Stefan Lazar <cristian.lazar1512@gmail.com>
Added go files when generating skels

Signed-off-by: Sorin Birchi <sb.birchi.sorin@gmail.com>
- Fix SPDX license comment to use asm comment style
- Remove redundant calls to 'os_string' functions in task 'libc' (probably a leftover from the other task)
- Change 'putchar_buffer_len' from 'char' to 'int' to hold 1024 characters (had a student ask why the length was stored in a char, it shouldn't)

Signed-off-by: Vlad Grigore <vladgrigore464@gmail.com>
Remove `.zip` from gitignore, this is needed because the workflow will
overwrite the changes to the archive if the file is ignored by git.
Create a commit for removing the outdated archives, since `git
stash pop` will generate a merge conflict otherwise.
Check if the name of the task contains `drills`. If it does not, do not
add it to the archive.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Fix cs-pub-ro#176

Signed-off-by: Mihai-Carol Bazga <carol.baoke@gmail.com>
…r static and dynamic linking

The previous Makefile did not provide both dynamic and static executables.

Signed-off-by: Oprea Stefan Antoniu <sopreaa@gmail.com>
Added new `input` rule to create `in.dat`
containing "Hello, world!". Updated the `all` target
to include `input`, ensuring the file is generated
automatically during the build.

Fixes cs-pub-ro#203

Signed-off-by: Andreia Ocanoaia <andreia.ocanoaia@gmail.com>
This folder is generated by `make skels`.

Signed-off-by: Andrei Lungu <andu.lng05@gmail.com>
Fix: Utils directory is from now on being copied to output.

Signed-off-by: Mihnea Firoiu <mihneafiroiu0@gmail.com>
Fix a typo in drills/questions/syscall-numbers.md

Signed-off-by: nicolasdumitru <nicolas@ndumitru.com>
Suggested students to test manually each task before using
'tests/checher.sh', for a better understanding of the concept.

Added `lab9.md` that instructs students to download the arhive
or use GitHub.

Changed config.yaml to add `lab9.md` to the archive.

Added guidance to tasks directories.

Signed-off-by: Matei Stanuca <unanumearmando@gmail.com>
- Fixed linter errors
- Fixed grammar errors
- Add archive link to lab 7

Signed-off-by: Alex Ocanoaia <alexandru.ocanoaia@stud.acs.upb.ro>
This enables multiple-choice quizzes.

Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
Update hackathon information to have a more generic text

Signed-off-by: Ionut Mihalache <ipopescu46@gmail.com>
Fix linter errors in rules-and-grading.md 

Signed-off-by: Elena Mihailescu <elenamihailescu22@gmail.com>
Fix linter errors in rules-and-grading.md 

Signed-off-by: Elena Mihailescu <elenamihailescu22@gmail.com>
- Fix question rendering in drills/questions/tls-synchronization.md
- Fix typo in drills/questions/tls-var-copies.md

Signed-off-by: RagnarokMew <ragnarokmewdev@gmail.com>
Improve wording for the rules and grading, the assignment section.
State that the points that can be obtain from the assignments are up to
3.5 points.

Signed-off-by: Elena Mihailescu <elenamihailescu22@gmail.com>
Add clarification for lecture quiz about grading rules

Signed-off-by: Costin Carabaș <costin.carabas@gmail.com>
- Fix typo in drills/tasks/atomic-assembly/README.md

Signed-off-by: robertmercea <robertmercea@gmail.com>
- Mention lab zip archive
- Add checker for `client-server` task
- Improve wording for all tasks

Signed-off-by: Rares Balcan <balcanrares@gmail.com>
This adds the link to the lab archive to the rendered website.

Signed-off-by: Rares Balcan <balcanrares@gmail.com>
Add new assignment presentation and tasks

Signed-off-by: Ionut Mihalache <ipopescu46@gmail.com>
- Change NUM_PAGES to 256 in the original code to avoid Transparent Huge
  Pages (THP) being triggered, allowing students to properly view the
  expected page fault numbers, as shown in the course material
- Create a new quiz about THP, explaining the low number of page faults
  caused by the program, despite increasing the page count
- Add the new quiz in config.yaml

Signed-off-by: robertmercea <robertmercea@gmail.com>

@teodutu teodutu left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THP is legit, but not always enabled by default. You'd have to configure them in: /sys/kernel/mm/transparent_hugepage/hugepages-<size>/enabled.

For example, my configs are:

$ cat /sys/kernel/mm/transparent_hugepage/hugepages-2048kB/enabled 
always inherit madvise [never]

Which means they're disabled. So I suggest you add instructions to enable THP of various sizes and then have students re-run the faults demo to see the differences. Also add this link, it explains how they affect the TLB: https://docs.kernel.org/admin-guide/mm/transhuge.html.

- Added details about how Transparent Huge Pages (THP) work in Linux
- Added a simple guide on how to enable THP

Signed-off-by: robertmercea <robertmercea@gmail.com>
@robertmercea
robertmercea force-pushed the lab-7-fork-faults-new-quiz branch from 5b564b6 to 7b8750e Compare January 24, 2026 19:57
@robertmercea

Copy link
Copy Markdown
Author

I've added instructions to enable THP as requested. Further explanations about THP have been added in hopes of encouraging students to do the bonus task, or at least to have a better understanding of the concept.
I've also mentioned that the sudo commands that enable THP only affect their system temporarily, knowing that it might be a deterrent for those who do not wish to tinker too much with their devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.