[CS61C FA20] Lecture 29.2 - Virtual Memory I: Physical Memory and Storage — Transcript
Full transcript
- 0:00[Music]
- 0:08hello
- 0:09and welcome back to our discussion about
- 0:12operating system support and virtual
- 0:14memory
- 0:15as we are getting into understanding how
- 0:18does
- 0:19virtual memory work it is useful to know
- 0:22some of the physical principles of
- 0:24how do the memory
- 0:27and storage devices work so let's start
- 0:30with the memory
- 0:32memory in this case dynamic random
- 0:35access memory
- 0:37or dram for short is built in a
- 0:40different process than our logic process
- 0:44it is also a cmos type of a process but
- 0:46it is optimized differently
- 0:50dram has special dram bit cells
- 0:53those are the cells optimized in a
- 0:56technology
- 0:56that store one bit of information
- 1:00on the other hand logic process is
- 1:02optimized for speed
- 1:04interconnect and also for logic
- 1:07density
- 1:10as a result when we compare
- 1:14um dram bit cell with an
- 1:17sram bit cell we find out that the dram
- 1:21cell is much smaller
- 1:23sram cells are those for that are being
- 1:25used in
- 1:26for building microprocessor caches and
- 1:28dram
- 1:29is our external main memory
- 1:33in comparison dram is almost 10 times
- 1:38denser than the sram so when we look at
- 1:40the modern microprocessor we'll find in
- 1:43its spec sheets that it has perhaps tens
- 1:45of megabytes
- 1:46of cache on the other hand a dram chip
- 1:49with about the same
- 1:50area may have more than
- 1:5310 gigabits of dram cells on it
- 1:58so technology for all
- 2:01dram chips is pretty much the same or
- 2:05very similar
- 2:06to each other but their protocols or
- 2:10interfaces that they use for talking to
- 2:12the microprocessors
- 2:13and the packaging may differ so in this
- 2:15case we are looking at
- 2:17a type of dram that is used in desktops
- 2:20and servers it is so-called
- 2:23dem or a dual in-line memory that has
- 2:278 or 16 dram chips on this small
- 2:31printed circuit board that plugs in into
- 2:35a desktop or a server anybody who has
- 2:37built
- 2:39a home ground workstation
- 2:43or a gaming rig has done that inserted
- 2:45these dram chips
- 2:46into the motherboard on the other hand
- 2:49most
- 2:51laptops nowadays don't really have room
- 2:54to
- 2:55fit these drams
- 2:58instead the dram chips are
- 3:01soldered directly onto the motherboard
- 3:03in this case
- 3:04we have a bit older version of a
- 3:06microsoft surface book
- 3:09that has these orange chips which are
- 3:12dram chips
- 3:13soldered onto the motherboard very close
- 3:16to the microprocessor by the way take a
- 3:19look at this microprocessor
- 3:20this is an intel microprocessor uh from
- 3:23a few years ago
- 3:24the microprocessor was here and it had
- 3:26uh two layers of
- 3:28or three levels of cache on it and there
- 3:30was a last level cache that was built in
- 3:32the dram process as a separate chip
- 3:34next to the microprocessor onto the same
- 3:36on the same package
- 3:38and then when we get to to cell phones
- 3:40we perhaps see a third incarnation
- 3:43of dram in case of uh i've
- 3:48mobile phones like apple iphone and in
- 3:51this case
- 3:51um a few year old apple a12 bionic
- 3:55fits four dram chips on top of it so it
- 3:58uses these
- 4:00ddr interfaces which is a protocol that
- 4:02is
- 4:03one of the protocols that is used for
- 4:05talking to a dram
- 4:08four dram interfaces connect to four
- 4:11dram chips that are placed
- 4:13on top of the microprocessor
- 4:16so regardless of a packaging all
- 4:20dram chips and all dram memory
- 4:24is volatile what does that mean that
- 4:26means when we turn off the power it
- 4:28forgets
- 4:29so all the data that is stored in the
- 4:32ram is lost
- 4:33it is the same for both dram and sram
- 4:35microprocessors need power to retain
- 4:38data
- 4:38in their caches so do dram chips need
- 4:42supply voltage to retain the the data
- 4:45that is stored in them
- 4:47so that's why we call them volatile
- 4:51now some of the specific some of the
- 4:53characteristics of dram
- 4:55latency to access the first world is
- 4:57roughly the first word
- 4:58is roughly 10 nanoseconds um
- 5:02and when we compare that to a processor
- 5:03speed that's like you know 30 to 40
- 5:05processor cycles
- 5:06can be more or less depending on the
- 5:09class of dram
- 5:11and the speed of a microprocessor
- 5:14then important thing to notice that each
- 5:18successive read or write is much faster
- 5:20if we are
- 5:21writing to a nearby
- 5:25place on the dram so each successive
- 5:28read or write
- 5:29happens every 0.5 to 1 nanoseconds
- 5:34in every axis we bring 64 bits and
- 5:37theorem typically supports something
- 5:38that is called the burst
- 5:41mode meaning that we can typically do
- 5:44these bursts of 8 or 16
- 5:47reads or writes which would essentially
- 5:50bring 8 or 16 times 64 bits and fill
- 5:55a cache line now
- 5:59going back to you know just a few words
- 6:01about
- 6:02volatility dram is a little bit more
- 6:05volatile
- 6:06than the sram and what does that mean
- 6:10well sram will retain data
- 6:13as long as the supply is on but dram
- 6:17forgets that's why it's called dynamic
- 6:20random access memory
- 6:21the data is called so stored dynamically
- 6:24in the form of a charge
- 6:25and the charge may leak away from the
- 6:28dram cell
- 6:29so it needs to be refreshed so every few
- 6:33hundreds of milliseconds this controller
- 6:37that
- 6:38lives on the microprocessor accesses the
- 6:41ram
- 6:41reads the contents and writes it back
- 6:44into the dram that's a process of
- 6:45refresh
- 6:47processor doesn't have to do anything
- 6:48with that it's a function
- 6:50of the controller there that's it
- 6:53uh that's what we need to know about the
- 6:55memory let's get into the storage
- 6:58storage is what we typically called
- 7:02the disk and there are two types of
- 7:05disks that we will encounter solid-state
- 7:08disks and hard disk drives
- 7:12they're both attached as a peripheral io
- 7:14device using
- 7:15some of the principles that we have kind
- 7:17of outlined but we are going to discuss
- 7:18more in a
- 7:19couple of lectures
- 7:22both ssd and hdt are so-called
- 7:25non-volatile memory types which means
- 7:28they retain
- 7:29the value even when the power is off
- 7:33that's very convenient otherwise our
- 7:34computers will be forgetting everything
- 7:36we would have to
- 7:37load the operating system and everything
- 7:40into the
- 7:40the drives every time we would like to
- 7:43boot
- 7:44them ssd
- 7:48and hdd have very different
- 7:50characteristics in different price
- 7:52ssd is a lot faster so each access is
- 7:55something like
- 7:5640 to 100 microseconds meaning
- 7:59it is slower than the the ram
- 8:02significantly slower than the dram
- 8:04[Music]
- 8:06taking say 100 000 processor cycles to
- 8:09access the ssd hdd
- 8:12is even slower it takes like 3 to 10
- 8:15milliseconds to access
- 8:19a sector in a hard disk drive
- 8:22which corresponds to a couple of tenths
- 8:24of micro
- 8:26a couple of tens of millions of
- 8:27microplastic
- 8:29cycles but there is also a big
- 8:32difference in price
- 8:33you know according to today's um
- 8:36data or today's prices
- 8:41it's about five times ssd
- 8:45is about five times more expensive than
- 8:48the hdd
- 8:49ssd also comes in different shapes and
- 8:52forms
- 8:54you know it can be in this shape that is
- 8:57resembles
- 8:58the shape of small disk drives hard disk
- 9:01drives
- 9:02or it can be in more modern one m2 forms
- 9:07um a few notes about these drives and
- 9:11why are they
- 9:11so slow and why is data so cheap
- 9:14there um the discs are
- 9:19mostly mechanical they're
- 9:20electromechanical very sophisticated
- 9:22electromechanical systems
- 9:24that store data in iron oxide
- 9:27like rust so there is a platter here
- 9:31that is spinning and there is a
- 9:33mechanical
- 9:34arm that flies
- 9:37over that
- 9:41surface and magnetizes
- 9:44the data magnet is the surface to store
- 9:47the data
- 9:49conversely when it is in a read mode it
- 9:52just
- 9:53hovers over the surface and reads the
- 9:56data
- 9:56now these magnetic domains are so small
- 9:58they're like a
- 10:00few nanometers on the side so in order
- 10:03to
- 10:04recognize the bits this arm flies
- 10:07a few nanometers above the surface i
- 10:09mean it's a really sophisticated
- 10:10technology
- 10:11you know pretty crazy stuff out there
- 10:15data is generally organized in so-called
- 10:18concentric circles or
- 10:19called tracks and
- 10:25the the this arm is suspended and again
- 10:28as i said
- 10:29um flies over it's actually designed
- 10:31like a wing
- 10:32and it flies over the surface of a disk
- 10:36there are disks come again in different
- 10:39classes
- 10:40most of them go from
- 10:447200 rpm to 10 000 rpm there were some
- 10:47that were built with
- 10:48uh 15 000 uh revolutions per minute
- 10:51that's
- 10:52really really fast i mean it's like not
- 10:54quite a
- 10:55um dental drill but like a ferrari
- 10:59um so if you convert that in
- 11:03milliseconds it takes about six
- 11:05milliseconds per evolution which means
- 11:06that the
- 11:07for this kind of a disk average random
- 11:09access time
- 11:10will be three milliseconds or so maybe a
- 11:14little bit less
- 11:15for a typical disk drive with 7200 rpm
- 11:18it'll be about 5 milliseconds
- 11:21that is why this corresponds to 10
- 11:23million processor cycles
- 11:26now um when
- 11:30we take these apart it's really fun to
- 11:33understand how
- 11:34they work and why they're actually so
- 11:36slow because they're mechanical
- 11:38i took this video which is a
- 11:41very good from nick parlante
- 11:45that i encourage you to watch
- 11:48entirely where he discusses the
- 11:50operation of
- 11:52disassembles the hard disk drive and
- 11:54operates it
- 11:56with the lid open remember they're not
- 11:58in vacuum because that
- 11:59head needs to fly over the surface so it
- 12:02needs some air
- 12:04if you look at it he opens it up over
- 12:07here so you can see
- 12:09the the the spindle the head
- 12:13and you know he plays with it
- 12:17and then you can see when you go towards
- 12:18the end of the video
- 12:20you can see it in action in this case it
- 12:23is
- 12:24most likely copying a file from one
- 12:26location to another
- 12:28so you can see the arm moving it from
- 12:31like physically moving a file from one
- 12:34track to another
- 12:39um a few other notes about that these
- 12:42drives come in different sizes and i
- 12:43know a lot about drives because they
- 12:45used to work
- 12:46uh i designed three channels for these
- 12:49drives
- 12:49this is a three and a half inch disk
- 12:52drive which is typical for
- 12:54for um desktops and you know when i
- 12:57designed the chip it's actually in these
- 12:59more modern drives
- 13:00they're flipped the board is flipped um
- 13:02inside out so you could see
- 13:04who made the the read channel and i used
- 13:07to go to fry's and flip every single
- 13:09drive to see if they have my chip on it
- 13:13this is a more of a laptop drive that is
- 13:16two and a half inch and
- 13:17when they got in this race when this
- 13:19drives got in the race
- 13:20um with the uh solid state drives with
- 13:24flash memory cards they made really
- 13:26these one inch drives
- 13:27this there is an actual real moving disc
- 13:30inside
- 13:30this was like a two gigabyte micro drive
- 13:33that would go into cameras
- 13:35so speaking about flash memory
- 13:39and solid state drives now there is
- 13:42nothing mechanical in there
- 13:43solid state drives are built up
- 13:45something that is called the flash
- 13:47memory
- 13:48there is it's kind of similar to our
- 13:51dram
- 13:52except the technology is different um
- 13:55it is built up out of these non-volatile
- 13:58cells so
- 13:59you somehow trap the charge inside the
- 14:01cell in dram you just store the charge
- 14:03in here
- 14:04you trap it so that it stays inside the
- 14:07bit cell even if we turn off the power
- 14:12in organizations kind of similar to dram
- 14:15but it's just
- 14:16packed really densely even dense denser
- 14:18than the dram
- 14:21it is fairly fast it's a lot faster it's
- 14:23slower than dram but a lot faster than
- 14:25the disc
- 14:27um but the key things it's organized
- 14:29such that we always
- 14:30read and write blocks we never access
- 14:32bytes or words
- 14:35um and it has some unusual requirements
- 14:38if you want to erase it if you want to
- 14:39set everything to zero you have to erase
- 14:41the whole block one thing that
- 14:45people kind of are mistaken because of
- 14:47this trapping of the charge
- 14:51the flash drives have a limited lifetime
- 14:56so you can completely erase them only a
- 14:58few thousand times
- 15:00nowadays and there are spares and stuff
- 15:01like that spare blocks and spare sectors
- 15:04um on that drive to
- 15:07extend the longevity but solid state
- 15:10drives are generally
- 15:12less reliable than the mechanical hard
- 15:14disk drives
- 15:16um one thing with flash drives their
- 15:19flash memory
- 15:20it is kind of a miracle of technology
- 15:24really nowadays
- 15:25it has become very cheap and it really
- 15:29is not slowing down with scaling
- 15:31although we can't make these individual
- 15:33pixels
- 15:34much smaller in area what this industry
- 15:37has
- 15:38have been doing is stacking them on top
- 15:40of each other so
- 15:42you kind of see these silos now
- 15:45there is an array of cells in each layer
- 15:47and then they stack layers on top of
- 15:48them i think now current production is
- 15:50128 layers
- 15:52but i think
- 15:55256 layers are coming in now so that
- 15:59basically um extends
- 16:03the technology scaling so
- 16:06flash memory is going to continue going
- 16:09in the third dimension
- 16:11for years to come and that's it we are
- 16:14going to get
- 16:15more into virtual memory after a break
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 29.2 - Virtual Memory I: Physical Memory and Storage by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 2,194 words across 404 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.