YouTube2Text

[CS61C FA20] Lecture 29.2 - Virtual Memory I: Physical Memory and Storage — Transcript

by CS 61C Departmental · 2,194 words · 404 segments · language en · Watch on YouTube

Full transcript

  1. 0:00[Music]
  2. 0:08hello
  3. 0:09and welcome back to our discussion about
  4. 0:12operating system support and virtual
  5. 0:14memory
  6. 0:15as we are getting into understanding how
  7. 0:18does
  8. 0:19virtual memory work it is useful to know
  9. 0:22some of the physical principles of
  10. 0:24how do the memory
  11. 0:27and storage devices work so let's start
  12. 0:30with the memory
  13. 0:32memory in this case dynamic random
  14. 0:35access memory
  15. 0:37or dram for short is built in a
  16. 0:40different process than our logic process
  17. 0:44it is also a cmos type of a process but
  18. 0:46it is optimized differently
  19. 0:50dram has special dram bit cells
  20. 0:53those are the cells optimized in a
  21. 0:56technology
  22. 0:56that store one bit of information
  23. 1:00on the other hand logic process is
  24. 1:02optimized for speed
  25. 1:04interconnect and also for logic
  26. 1:07density
  27. 1:10as a result when we compare
  28. 1:14um dram bit cell with an
  29. 1:17sram bit cell we find out that the dram
  30. 1:21cell is much smaller
  31. 1:23sram cells are those for that are being
  32. 1:25used in
  33. 1:26for building microprocessor caches and
  34. 1:28dram
  35. 1:29is our external main memory
  36. 1:33in comparison dram is almost 10 times
  37. 1:38denser than the sram so when we look at
  38. 1:40the modern microprocessor we'll find in
  39. 1:43its spec sheets that it has perhaps tens
  40. 1:45of megabytes
  41. 1:46of cache on the other hand a dram chip
  42. 1:49with about the same
  43. 1:50area may have more than
  44. 1:5310 gigabits of dram cells on it
  45. 1:58so technology for all
  46. 2:01dram chips is pretty much the same or
  47. 2:05very similar
  48. 2:06to each other but their protocols or
  49. 2:10interfaces that they use for talking to
  50. 2:12the microprocessors
  51. 2:13and the packaging may differ so in this
  52. 2:15case we are looking at
  53. 2:17a type of dram that is used in desktops
  54. 2:20and servers it is so-called
  55. 2:23dem or a dual in-line memory that has
  56. 2:278 or 16 dram chips on this small
  57. 2:31printed circuit board that plugs in into
  58. 2:35a desktop or a server anybody who has
  59. 2:37built
  60. 2:39a home ground workstation
  61. 2:43or a gaming rig has done that inserted
  62. 2:45these dram chips
  63. 2:46into the motherboard on the other hand
  64. 2:49most
  65. 2:51laptops nowadays don't really have room
  66. 2:54to
  67. 2:55fit these drams
  68. 2:58instead the dram chips are
  69. 3:01soldered directly onto the motherboard
  70. 3:03in this case
  71. 3:04we have a bit older version of a
  72. 3:06microsoft surface book
  73. 3:09that has these orange chips which are
  74. 3:12dram chips
  75. 3:13soldered onto the motherboard very close
  76. 3:16to the microprocessor by the way take a
  77. 3:19look at this microprocessor
  78. 3:20this is an intel microprocessor uh from
  79. 3:23a few years ago
  80. 3:24the microprocessor was here and it had
  81. 3:26uh two layers of
  82. 3:28or three levels of cache on it and there
  83. 3:30was a last level cache that was built in
  84. 3:32the dram process as a separate chip
  85. 3:34next to the microprocessor onto the same
  86. 3:36on the same package
  87. 3:38and then when we get to to cell phones
  88. 3:40we perhaps see a third incarnation
  89. 3:43of dram in case of uh i've
  90. 3:48mobile phones like apple iphone and in
  91. 3:51this case
  92. 3:51um a few year old apple a12 bionic
  93. 3:55fits four dram chips on top of it so it
  94. 3:58uses these
  95. 4:00ddr interfaces which is a protocol that
  96. 4:02is
  97. 4:03one of the protocols that is used for
  98. 4:05talking to a dram
  99. 4:08four dram interfaces connect to four
  100. 4:11dram chips that are placed
  101. 4:13on top of the microprocessor
  102. 4:16so regardless of a packaging all
  103. 4:20dram chips and all dram memory
  104. 4:24is volatile what does that mean that
  105. 4:26means when we turn off the power it
  106. 4:28forgets
  107. 4:29so all the data that is stored in the
  108. 4:32ram is lost
  109. 4:33it is the same for both dram and sram
  110. 4:35microprocessors need power to retain
  111. 4:38data
  112. 4:38in their caches so do dram chips need
  113. 4:42supply voltage to retain the the data
  114. 4:45that is stored in them
  115. 4:47so that's why we call them volatile
  116. 4:51now some of the specific some of the
  117. 4:53characteristics of dram
  118. 4:55latency to access the first world is
  119. 4:57roughly the first word
  120. 4:58is roughly 10 nanoseconds um
  121. 5:02and when we compare that to a processor
  122. 5:03speed that's like you know 30 to 40
  123. 5:05processor cycles
  124. 5:06can be more or less depending on the
  125. 5:09class of dram
  126. 5:11and the speed of a microprocessor
  127. 5:14then important thing to notice that each
  128. 5:18successive read or write is much faster
  129. 5:20if we are
  130. 5:21writing to a nearby
  131. 5:25place on the dram so each successive
  132. 5:28read or write
  133. 5:29happens every 0.5 to 1 nanoseconds
  134. 5:34in every axis we bring 64 bits and
  135. 5:37theorem typically supports something
  136. 5:38that is called the burst
  137. 5:41mode meaning that we can typically do
  138. 5:44these bursts of 8 or 16
  139. 5:47reads or writes which would essentially
  140. 5:50bring 8 or 16 times 64 bits and fill
  141. 5:55a cache line now
  142. 5:59going back to you know just a few words
  143. 6:01about
  144. 6:02volatility dram is a little bit more
  145. 6:05volatile
  146. 6:06than the sram and what does that mean
  147. 6:10well sram will retain data
  148. 6:13as long as the supply is on but dram
  149. 6:17forgets that's why it's called dynamic
  150. 6:20random access memory
  151. 6:21the data is called so stored dynamically
  152. 6:24in the form of a charge
  153. 6:25and the charge may leak away from the
  154. 6:28dram cell
  155. 6:29so it needs to be refreshed so every few
  156. 6:33hundreds of milliseconds this controller
  157. 6:37that
  158. 6:38lives on the microprocessor accesses the
  159. 6:41ram
  160. 6:41reads the contents and writes it back
  161. 6:44into the dram that's a process of
  162. 6:45refresh
  163. 6:47processor doesn't have to do anything
  164. 6:48with that it's a function
  165. 6:50of the controller there that's it
  166. 6:53uh that's what we need to know about the
  167. 6:55memory let's get into the storage
  168. 6:58storage is what we typically called
  169. 7:02the disk and there are two types of
  170. 7:05disks that we will encounter solid-state
  171. 7:08disks and hard disk drives
  172. 7:12they're both attached as a peripheral io
  173. 7:14device using
  174. 7:15some of the principles that we have kind
  175. 7:17of outlined but we are going to discuss
  176. 7:18more in a
  177. 7:19couple of lectures
  178. 7:22both ssd and hdt are so-called
  179. 7:25non-volatile memory types which means
  180. 7:28they retain
  181. 7:29the value even when the power is off
  182. 7:33that's very convenient otherwise our
  183. 7:34computers will be forgetting everything
  184. 7:36we would have to
  185. 7:37load the operating system and everything
  186. 7:40into the
  187. 7:40the drives every time we would like to
  188. 7:43boot
  189. 7:44them ssd
  190. 7:48and hdd have very different
  191. 7:50characteristics in different price
  192. 7:52ssd is a lot faster so each access is
  193. 7:55something like
  194. 7:5640 to 100 microseconds meaning
  195. 7:59it is slower than the the ram
  196. 8:02significantly slower than the dram
  197. 8:04[Music]
  198. 8:06taking say 100 000 processor cycles to
  199. 8:09access the ssd hdd
  200. 8:12is even slower it takes like 3 to 10
  201. 8:15milliseconds to access
  202. 8:19a sector in a hard disk drive
  203. 8:22which corresponds to a couple of tenths
  204. 8:24of micro
  205. 8:26a couple of tens of millions of
  206. 8:27microplastic
  207. 8:29cycles but there is also a big
  208. 8:32difference in price
  209. 8:33you know according to today's um
  210. 8:36data or today's prices
  211. 8:41it's about five times ssd
  212. 8:45is about five times more expensive than
  213. 8:48the hdd
  214. 8:49ssd also comes in different shapes and
  215. 8:52forms
  216. 8:54you know it can be in this shape that is
  217. 8:57resembles
  218. 8:58the shape of small disk drives hard disk
  219. 9:01drives
  220. 9:02or it can be in more modern one m2 forms
  221. 9:07um a few notes about these drives and
  222. 9:11why are they
  223. 9:11so slow and why is data so cheap
  224. 9:14there um the discs are
  225. 9:19mostly mechanical they're
  226. 9:20electromechanical very sophisticated
  227. 9:22electromechanical systems
  228. 9:24that store data in iron oxide
  229. 9:27like rust so there is a platter here
  230. 9:31that is spinning and there is a
  231. 9:33mechanical
  232. 9:34arm that flies
  233. 9:37over that
  234. 9:41surface and magnetizes
  235. 9:44the data magnet is the surface to store
  236. 9:47the data
  237. 9:49conversely when it is in a read mode it
  238. 9:52just
  239. 9:53hovers over the surface and reads the
  240. 9:56data
  241. 9:56now these magnetic domains are so small
  242. 9:58they're like a
  243. 10:00few nanometers on the side so in order
  244. 10:03to
  245. 10:04recognize the bits this arm flies
  246. 10:07a few nanometers above the surface i
  247. 10:09mean it's a really sophisticated
  248. 10:10technology
  249. 10:11you know pretty crazy stuff out there
  250. 10:15data is generally organized in so-called
  251. 10:18concentric circles or
  252. 10:19called tracks and
  253. 10:25the the this arm is suspended and again
  254. 10:28as i said
  255. 10:29um flies over it's actually designed
  256. 10:31like a wing
  257. 10:32and it flies over the surface of a disk
  258. 10:36there are disks come again in different
  259. 10:39classes
  260. 10:40most of them go from
  261. 10:447200 rpm to 10 000 rpm there were some
  262. 10:47that were built with
  263. 10:48uh 15 000 uh revolutions per minute
  264. 10:51that's
  265. 10:52really really fast i mean it's like not
  266. 10:54quite a
  267. 10:55um dental drill but like a ferrari
  268. 10:59um so if you convert that in
  269. 11:03milliseconds it takes about six
  270. 11:05milliseconds per evolution which means
  271. 11:06that the
  272. 11:07for this kind of a disk average random
  273. 11:09access time
  274. 11:10will be three milliseconds or so maybe a
  275. 11:14little bit less
  276. 11:15for a typical disk drive with 7200 rpm
  277. 11:18it'll be about 5 milliseconds
  278. 11:21that is why this corresponds to 10
  279. 11:23million processor cycles
  280. 11:26now um when
  281. 11:30we take these apart it's really fun to
  282. 11:33understand how
  283. 11:34they work and why they're actually so
  284. 11:36slow because they're mechanical
  285. 11:38i took this video which is a
  286. 11:41very good from nick parlante
  287. 11:45that i encourage you to watch
  288. 11:48entirely where he discusses the
  289. 11:50operation of
  290. 11:52disassembles the hard disk drive and
  291. 11:54operates it
  292. 11:56with the lid open remember they're not
  293. 11:58in vacuum because that
  294. 11:59head needs to fly over the surface so it
  295. 12:02needs some air
  296. 12:04if you look at it he opens it up over
  297. 12:07here so you can see
  298. 12:09the the the spindle the head
  299. 12:13and you know he plays with it
  300. 12:17and then you can see when you go towards
  301. 12:18the end of the video
  302. 12:20you can see it in action in this case it
  303. 12:23is
  304. 12:24most likely copying a file from one
  305. 12:26location to another
  306. 12:28so you can see the arm moving it from
  307. 12:31like physically moving a file from one
  308. 12:34track to another
  309. 12:39um a few other notes about that these
  310. 12:42drives come in different sizes and i
  311. 12:43know a lot about drives because they
  312. 12:45used to work
  313. 12:46uh i designed three channels for these
  314. 12:49drives
  315. 12:49this is a three and a half inch disk
  316. 12:52drive which is typical for
  317. 12:54for um desktops and you know when i
  318. 12:57designed the chip it's actually in these
  319. 12:59more modern drives
  320. 13:00they're flipped the board is flipped um
  321. 13:02inside out so you could see
  322. 13:04who made the the read channel and i used
  323. 13:07to go to fry's and flip every single
  324. 13:09drive to see if they have my chip on it
  325. 13:13this is a more of a laptop drive that is
  326. 13:16two and a half inch and
  327. 13:17when they got in this race when this
  328. 13:19drives got in the race
  329. 13:20um with the uh solid state drives with
  330. 13:24flash memory cards they made really
  331. 13:26these one inch drives
  332. 13:27this there is an actual real moving disc
  333. 13:30inside
  334. 13:30this was like a two gigabyte micro drive
  335. 13:33that would go into cameras
  336. 13:35so speaking about flash memory
  337. 13:39and solid state drives now there is
  338. 13:42nothing mechanical in there
  339. 13:43solid state drives are built up
  340. 13:45something that is called the flash
  341. 13:47memory
  342. 13:48there is it's kind of similar to our
  343. 13:51dram
  344. 13:52except the technology is different um
  345. 13:55it is built up out of these non-volatile
  346. 13:58cells so
  347. 13:59you somehow trap the charge inside the
  348. 14:01cell in dram you just store the charge
  349. 14:03in here
  350. 14:04you trap it so that it stays inside the
  351. 14:07bit cell even if we turn off the power
  352. 14:12in organizations kind of similar to dram
  353. 14:15but it's just
  354. 14:16packed really densely even dense denser
  355. 14:18than the dram
  356. 14:21it is fairly fast it's a lot faster it's
  357. 14:23slower than dram but a lot faster than
  358. 14:25the disc
  359. 14:27um but the key things it's organized
  360. 14:29such that we always
  361. 14:30read and write blocks we never access
  362. 14:32bytes or words
  363. 14:35um and it has some unusual requirements
  364. 14:38if you want to erase it if you want to
  365. 14:39set everything to zero you have to erase
  366. 14:41the whole block one thing that
  367. 14:45people kind of are mistaken because of
  368. 14:47this trapping of the charge
  369. 14:51the flash drives have a limited lifetime
  370. 14:56so you can completely erase them only a
  371. 14:58few thousand times
  372. 15:00nowadays and there are spares and stuff
  373. 15:01like that spare blocks and spare sectors
  374. 15:04um on that drive to
  375. 15:07extend the longevity but solid state
  376. 15:10drives are generally
  377. 15:12less reliable than the mechanical hard
  378. 15:14disk drives
  379. 15:16um one thing with flash drives their
  380. 15:19flash memory
  381. 15:20it is kind of a miracle of technology
  382. 15:24really nowadays
  383. 15:25it has become very cheap and it really
  384. 15:29is not slowing down with scaling
  385. 15:31although we can't make these individual
  386. 15:33pixels
  387. 15:34much smaller in area what this industry
  388. 15:37has
  389. 15:38have been doing is stacking them on top
  390. 15:40of each other so
  391. 15:42you kind of see these silos now
  392. 15:45there is an array of cells in each layer
  393. 15:47and then they stack layers on top of
  394. 15:48them i think now current production is
  395. 15:50128 layers
  396. 15:52but i think
  397. 15:55256 layers are coming in now so that
  398. 15:59basically um extends
  399. 16:03the technology scaling so
  400. 16:06flash memory is going to continue going
  401. 16:09in the third dimension
  402. 16:11for years to come and that's it we are
  403. 16:14going to get
  404. 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.