<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/understanding-you-are-not-expected-to-understand-this--dow1im2vr" -->

---
title: Understanding "You are not expected to understand this."
description: The 'not expected to understand' comment in Unix V6's swtch() guards a rare path for a process that was swapped out during fork() because memory ran short. The...
canonical: https://daily.dev/posts/understanding-you-are-not-expected-to-understand-this--dow1im2vr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Understanding "You are not expected to understand this." | daily.dev
og:description: The 'not expected to understand' comment in Unix V6's swtch() guards a rare path for a process that was swapped out during fork() because memory ran short. The...
og:url: https://daily.dev/posts/understanding-you-are-not-expected-to-understand-this--dow1im2vr
og:image: https://api.daily.dev/og/posts/dOw1iM2VR.png
og:image:alt: Understanding "You are not expected to understand this."
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding "You are not expected to understand this."

**[Lobsters](https://daily.dev/sources/lobsters)** · 8 min read · 0 upvotes · 0 comments

## Summary

The 'not expected to understand' comment in Unix V6's swtch() guards a rare path for a process that was swapped out during fork() because memory ran short. The flag SSWAP is set in newproc() after savu(u.u_ssav) and xswap(). When that process is swapped back in, aretu(u.u_ssav) reloads the stack and frame pointers from newproc(), but the PC stays in swtch(). So return(1) hands 1 back to the caller of newproc(), fork() or main(). The local variable rp likely survives in callee-saved r4, since savu and retu leave r2-r4 untouched.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.taniwha.com/~paul/not.html>

## Questions this post answers

### What does the 'You are not expected to understand this' comment in Unix V6 swtch() actually do?

It guards a path for a process that was swapped out during fork() because memory was short. newproc() sets SSWAP after savu(u.u_ssav) and xswap(). On swap-in, swtch() clears SSWAP and calls aretu(u.u_ssav), restoring newproc()'s stack and frame pointers while the PC remains in swtch(), so return(1) goes to newproc()'s caller.

_Developers who enjoy operating system internals follow deep dives like this on daily.dev._

### How do savu(), retu() and aretu() differ in Unix V6 on the PDP-11?

savu() saves the stack pointer (r6) and frame pointer (r5) without touching r2-r4. aretu() restores those two registers from a save area. retu() does the same but first maps the process's udot, given by physical address, into the MMU at the kernel virtual address of u., since the first words of the udot hold u.u_rsav.

_Understanding low-level context switching is easier when you keep up with systems programming on daily.dev._

## Similar posts on daily.dev

- [Odd Comments and Strange Doings in Unix](https://daily.dev/posts/odd-comments-and-strange-doings-in-unix-mxq3migig) · Lobsters · 0 upvotes · 0 comments
- [Math is hard](https://daily.dev/posts/math-is-hard-g7pgrr2pz) · Hacker News · 0 upvotes · 0 comments
- [Linux 7.4 Adding New Emulation Function While Some Old CPUs May Soon Be Phased Out](https://daily.dev/posts/linux-7-4-adding-new-emulation-function-while-some-old-cpus-may-soon-be-phased-out-lgzaonjts) · Phoronix · 0 upvotes · 0 comments
- [How a System Call Actually Works in Linux](https://daily.dev/posts/how-a-system-call-actually-works-in-linux-kj1mr4pdv) · freeCodeCamp · 1 upvotes · 0 comments
- [OpenAI Fixes 18-Year-Old GNU libunwind Bug by Treating Crash Debugging Like Epidemiology](https://daily.dev/posts/openai-fixes-18-year-old-gnu-libunwind-bug-by-treating-crash-debugging-like-epidemiology-laln47lxr) · InfoQ · 0 upvotes · 0 comments

---

Tags: [#c](https://daily.dev/tags/c), [#unix](https://daily.dev/tags/unix)

[View this post on daily.dev](https://daily.dev/posts/understanding-you-are-not-expected-to-understand-this--dow1im2vr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Understanding \"You are not expected to understand this.\"","url":"https://daily.dev/posts/understanding-you-are-not-expected-to-understand-this--dow1im2vr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/understanding-you-are-not-expected-to-understand-this--dow1im2vr"},"datePublished":"2026-11-27T14:21:09.040Z","dateModified":"2026-11-27T14:21:28.389Z","description":"The 'not expected to understand' comment in Unix V6's swtch() guards a rare path for a process that was swapped out during fork() because memory ran short. The...","image":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","thumbnailUrl":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/understanding-you-are-not-expected-to-understand-this--dow1im2vr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c,unix","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"Understanding \"You are not expected to understand this.\""}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/understanding-you-are-not-expected-to-understand-this--dow1im2vr#faq","mainEntity":[{"@type":"Question","name":"What does the 'You are not expected to understand this' comment in Unix V6 swtch() actually do?","acceptedAnswer":{"@type":"Answer","text":"It guards a path for a process that was swapped out during fork() because memory was short. newproc() sets SSWAP after savu(u.u_ssav) and xswap(). On swap-in, swtch() clears SSWAP and calls aretu(u.u_ssav), restoring newproc()'s stack and frame pointers while the PC remains in swtch(), so return(1) goes to newproc()'s caller. Developers who enjoy operating system internals follow deep dives like this on daily.dev."}},{"@type":"Question","name":"How do savu(), retu() and aretu() differ in Unix V6 on the PDP-11?","acceptedAnswer":{"@type":"Answer","text":"savu() saves the stack pointer (r6) and frame pointer (r5) without touching r2-r4. aretu() restores those two registers from a save area. retu() does the same but first maps the process's udot, given by physical address, into the MMU at the kernel virtual address of u., since the first words of the udot hold u.u_rsav. Understanding low-level context switching is easier when you keep up with systems programming on daily.dev."}}]}
```

