updating notes with rest of modules

This commit is contained in:
left_adjoint 2024-03-14 17:33:39 -07:00
parent 2d60fcc798
commit 9af88d50e8
1 changed files with 153 additions and 6 deletions

View File

@ -10,6 +10,10 @@ https://docs.google.com/document/d/1GuMczYrPDQ8X0SfKO3VuuTSJf6yAwlFCYZNsXZqSTMc/
https://online.pcc.edu/d2l/home/387733
https://www.pcc.edu/ccog/cs/201/
For the optimization section of cs201: https://lore.kernel.org/netdev/20231129072756.3684495-1-lixiaoyan@google.com/
A really cool example of a patch that massively sped-up TCP because it played with the layout of structs to change the cache-line behavior and reduce misses
* Random notes about development
+ It lists figure 8.26 that shows all possible signals but doesn't include them, which I think is kinda bad for these purposes. Should include figure in the site if its referenced.
+ Module 8 needs a section about user defined signals since they're needed for the homework
@ -125,6 +129,31 @@ Week 10.
6. 3.13 (L8)
** Module 5
1. 13.12 (L4)
** Module 6
1. 3.8 (L2)
2. 3.9 (L2)
3. 3.10 (L2)
4. 3.11 ??
** Module 7
1. 8.1 (L3)
2. 8.2 (L3)
3. 8.3 (L3)
4. 8.4 (L6)
5. 8.5 (L6)
6. 8.6 (L6)
7. 8.7 (L7)
8. 8.8 (L7)
** Module 8
There are no practice problems
** Module 9
1. 6.2 (L6)
2. 6.3 (L6)
3. 6.4 (L6)
4. 6.5 (L6)
** Module 10
1. 5.1 (L4)
2. 5.2 (L4)
3. 5.3 (L4)
* Section by section summary
** Module 1: C language and numeric representation
*** Lesson 1 - C++ to C Language
@ -252,43 +281,161 @@ Week 10.
** Module 5: Object code: control
*** Lesson 1: Logical and Shift Operators
+ Content: complete
*** Lesson 2: Accessing the Condition Codes
+ Should we really be talking about IA-64 though? The architecture is deprecated and yet it's not even made clear that this is an architecture that no longer is in use (even wikipedia lists it as a discontinued processor architecture https://en.wikipedia.org/wiki/IA-64)
*** lesson 2: Accessing the Condition Codes
+ Content: complete
+ Programming examples:
+ Need full examples of condition setting and jumping
+ Activity needed:
+ give a full example that uses labels and jumps
+ give instructions for how to read the objdump
*** Lesson 3: If Statements
+ Content: mostly complete
+ Show how to reconstruct the if-statement from the assembly
+ Practice problem needed:
+ Need a problem like 13.12 for lesson 4
*** Lesson 4: Loop Statements
+ 13.12
+ Content: mostly complete
+ Show how to reconstruct the loop from the assembly
+ Practice problem:
+ 13.12
*** Lesson 5: Switch Statements
+ Content: complete (but with an edit suggestion)
+ Personally I don't like the aside about gcc optimization avoiding division
+ It's a good lesson!
+ But don't do the "leave this to students to figure out"
+ We should work out the unoptimized version and show the differences between them
+ Programming example
+ Need comparison between generated assembly of if-else statements vs. the same logic expressed as a switch/case
** Module 6: Object code: Procedures and Floating Point
*** Lesson 1: Procedures
+ Content: editing fixes
+ This bit about "procedures are what C language calls functions" isn't right. C calls functions "functions". I *think* the author meant to say something more like "In most assembly languages, functions are labeled sequences of code called 'procedures'" or something like that
+ In comparison to a lot of lessons this one is dense and introduces
+ Procedure definitions in assembly
+ Calling conventions and "the stack"
+ Inlining code
+ How to handle large numbers of arguments to functions
+ Maybe should break it up into pieces
+ Practice problem:
+ Need a problem here related to looking at assembly and reconstructing a possible function definition that could result in it
*** Lesson 2: Heterogenous Data Structures
+ 3.8
+ 3.9
+ 3.10
+ Content: Complete
+ Practice problems
+ 3.8
+ 3.9
+ 3.10
+ Programming example:
+ Need full examples for each category showing how arrays, unions, and structs compile down
*** Lesson 3: Buffer Overflows and Security Issues
+ Content: Needs expanding
+ Need real-world examples and resources to explore about buffer overruns
+ Programming examples:
+ Hands-on demo of how a buffer overflow would work
*** Lesson 4: Floating Point
+ Content: complete
+ Programming example:
+ It needs to be inlined rather than be a separate file
** Module 7: Processes
*** Lesson 1: Flow Control
+ Content: Complete
+ But very very tiny
*** Lesson 2: Exceptions
+ Content: complete
*** Lesson 3: Classes of Exceptions
+ Content: complete
+ Practice problems:
+ 8.1
+ 8.2
+ 8.3
*** Lesson 4: Exceptions in Linux/x86-64
+ Content: complete
+ Programming examples:
+ Need some complete examples showing code that demonstrates the exceptions/faults, at least of a divide error and a general protection fault
*** Lesson 5: Processes
+ Content: Complete but denser than the rest of the section
+ Might not need to be broken up but definitely needs self-assessment because these are heavier concepts
+ Practice problems:
+ Need something here!
*** Lesson 6: Process Control
+ Content: Complete
+ Practice problems
+ 8.4
+ 8.5
+ 8.6
*** Lesson 7: Examples of Fork
+ Content: needs expanding (or potentially redistribution)
+ Basically all the programming examples from this module are right here, right now
+ This might need to be re-organized into the rest of the sections so that there's things to test out in each lesson rather than it all being at the end
+ Practice problems
+ 8.7
+ 8.8
** Module 8: Signal handling
*All lessons here need practice problems*
*** Lesson 1: Signals in Linux Systems
+ Content: complete
*** Lesson 2: Signal Management
+ Content: complete
+ Programming examples:
+ Need complete examples of signal handling instead of just a line or two, shouldn't be redundant with L5
+ Practice problems:
+ Needed
*** Lesson 3: Blocking and Unblocking Signals
+ Content: complete
+ Programming example:
+ Just need to expand the partial examples into entire, compilable examples
+ Practice problems:
+ Needed
*** Lesson 4: Writing Signal Handlers
+ Content: refactor
+ I think this section needs to be redistributed into lessons 2 and 3
+ Explain what =volatile= and =sig_atomic_flag= mean
+ Recall this later when dealing with *caching* in Module 9
*** Lesson 5: Signal Handler Examples
+ Content: needs expansion
+ These are not full examples
+ Need more examples that actually match to the kinds of parent/child relations like in the shoot-out assignment
** Module 9: Memory systems
Okay I'll be honest I think this entire module is basically just one lesson stretched out. It's a very superficial look at what memory is, the kind of thing that you can explain in 10-15 minutes at a time. We can collapse lessons 1/2/4 into one, 3/5 into one, and then lesson 6 should perhaps get expanded significantly with some actual diagrams and examples.
This would be a great place to include the TCP speed up linked above as a case-study in a more fleshed out final lesson
*** Lesson 1: RAM
+ Content: complete
*** Lesson 2: Other types of Memory
+ Content: complete (but extremely short)
*** Lesson 3: Accessing Main Memory
+ Content: complete
*** Lesson 4: Disk Storage
+ Content: complete
*** Lesson 5: Locality
*** Lesson 6: Memory Hierarchies and Caches
+ Practice problems
+ 6.2
+ 6.3
+ 6.4
+ 6.5
** Module 10: Optimzation
*** Lesson 1: Optimization
+ Content: needs expansion
+ Needs to explain more clearly that optimization is primarily done during execution by the architecture, secondarily by the compiler, and finally if it can't be done by the compiler it falls to you
*** Lesson 2: gcc Optimization levels
+ Content: complete...ish
+ It's actually not just O3 that can cause problems, I've seen it happen at even lower compilation
+ Also need to check if there is an alias that makes gcc on replit default to something other than -O0 because I've seen optimization bugs happen without specifying an optimization level
+ Need to provide some concrete examples of what optimization caused bugs can look like
+ iterating through an array with a while loop where the order of conditions matters
+ show generated assembly and how it differs
*** Lesson 3: How to measure performance?
+ Content: complete but very short
+ Needs a couple of examples to show and test out measurement
*** Lesson 4: How to Optimize Code
+ Content:
+ Needs to be split into multiple segments, too much in one thing
+ Need to show the actual assembly for these different manual optimizations in order to show how the optimizations are implemented
+ There's some slightly out of date stuff in here about recursion, function calls, and things like that
+ Practice problems
+ 5.1
+ 5.2
+ 5.3