WEBVTT 1 00:00:02.070 --> 00:00:23.490 William Cheng: Welcome to lecture 15. So this is a short lecture, since we are sticking to the summer 2019 lecture schedule in summer 2019 electrocuting I guess before that it was the midterm exam and after the midterm is over. I had this short lecture. So that's what we will cover today. 2 00:00:24.720 --> 00:00:28.800 William Cheng: So let's first talk about the housekeeping stuff. Colonel to 3 00:00:29.970 --> 00:00:37.620 William Cheng: Colonel to is a one week away. If you have co from previous semester, don't look at them. Don't copy them best to get rid of it and 4 00:00:38.370 --> 00:00:45.210 William Cheng: You know, please also watch the week seven and the week a discussion section video I could give you the background for Colonel to 5 00:00:46.080 --> 00:01:04.170 William Cheng: Grading guidelines. The old gray section testing section. Be nice to run in the foreground. And that's the bfs test section. See, they are given as a key shall command. So therefore you should just run the shell commands. After the submission. Make sure you verify verify your Kronos submission 6 00:01:06.270 --> 00:01:14.130 William Cheng: So as soon as you're done with Colonel to, I guess, you know, since kind of three is bigger than Colonel wanting to combine 7 00:01:14.910 --> 00:01:19.530 William Cheng: You should start doing Colonel three as soon as as soon as you're done with Colonel to 8 00:01:20.400 --> 00:01:26.790 William Cheng: So by the end of next lecture, which is the Thursdays lecture, you will have everything you need to know to finish Colonel three 9 00:01:27.420 --> 00:01:34.020 William Cheng: Okay, so that's why I'm sort of going in such a hurry to make sure that you get all the material you know as soon as possible. 10 00:01:34.740 --> 00:01:41.640 William Cheng: To start your kernel through so I'll get. I know you probably not ready to start going through. Yeah, I just want to sort of briefly mentioned, if you want to start Colonel three 11 00:01:42.210 --> 00:01:46.260 William Cheng: The first thing to do is to make sure that your kernel to work with a system pop us and 12 00:01:46.800 --> 00:01:56.430 William Cheng: So the way you do this is that you said as far as equal to one. Okay, but but ke VI n equal to zero income freedom k. And then there are three function that you have to write 13 00:01:56.850 --> 00:02:05.910 William Cheng: All these functions up frame diocese of P for him is your page rain. There's one function copy for and get. And then there's paper and pen and paper and pen. 14 00:02:06.690 --> 00:02:15.450 William Cheng: So, so, so I guess you need to read comment blog and try to sort of figure out what to do and also in lecture I talked about page rate sort of keep us 15 00:02:15.930 --> 00:02:26.340 William Cheng: Keep us up in mind so so so once you implement those three function. Your goal is to get VM FS to to to to to run perfectly using the system, our system. 16 00:02:27.120 --> 00:02:38.430 William Cheng: There. So in that case, the bfs. There will not be using the RAM file system anymore. So unlike grandpa sister or they will be using this isn't above our system system Papa system is a real file system. It has a hard drive in it. 17 00:02:38.760 --> 00:02:45.030 William Cheng: Okay. So in this case, when your current or try to transfer data from a distant memory or in that case of courage to actually fall asleep. 18 00:02:45.660 --> 00:02:53.010 William Cheng: Okay, so your current with it will go to sleep in a dispute to work with data to get charged for and when the data has finished transferring 19 00:02:53.670 --> 00:03:02.790 William Cheng: You know, he's not you know observers routine you're currently like I've woken up so so so they will get added to the run queue. So you'll Colonel through an example. You saw Ronnie. He needs to check the of the 20 00:03:03.690 --> 00:03:12.870 William Cheng: The disc operation was successful. So, so, so, so, again, a lot of the stuff has been called a for you. You just have to trust that the system pop autism code is perfect. Now, 21 00:03:14.520 --> 00:03:22.890 William Cheng: So what's important to understand. Understand that this isn't offices and use a page right object to manage data from the desk and this will be the first time when you paste from object. 22 00:03:23.130 --> 00:03:28.500 William Cheng: Because before that you are using a fake palaces them. So in that case, the data is actually kept inside the actual process them. 23 00:03:28.890 --> 00:03:37.770 William Cheng: So we don't really need the patient object, starting with Colonel three when he said, F, F, F, F is equal to one on p frame other the different code needs to work. Okay, so that's why 24 00:03:38.250 --> 00:03:45.660 William Cheng: The first thing is very, very isolated. So you just need to get those three function to work and so that you can make sure that you you are your, your custom code. 25 00:03:46.650 --> 00:03:57.030 William Cheng: Actually works really well that. So here's a comment. Don't said VM equals two, one until you have a very reliable passes the Ryman clearly if you your file system is not reliable, we try to 26 00:03:57.360 --> 00:04:02.430 William Cheng: We try to run user space program or you can try to try to transfer data on a distant memory. What if we can do that. 27 00:04:02.910 --> 00:04:07.230 William Cheng: Okay, if you can't translate this one data to memory. It was then there's really no point running your users baseball one 28 00:04:07.680 --> 00:04:19.560 William Cheng: Okay, so it's very important that you should only say the n equals two, one win your system file, file system is fairly stable. I mean, it doesn't have to be 100% stable. I mean, if you, you know, try to shut down the system. And there's, you know, there's 29 00:04:20.970 --> 00:04:30.450 William Cheng: There's still vino left. Yeah, that's not as serious as long as your kernel doesn't crash that So anyways, as only 17 equal to one wise, you're convinced are reasonably assured. 30 00:04:30.960 --> 00:04:38.220 William Cheng: That your system is is in good shape. But then you're ready to move on that. So, me, me. Go to one minute you're running user space processes. 31 00:04:38.970 --> 00:04:44.400 William Cheng: So this is what I said before, if you're ready to do this I check out the week night discussion section sly 32 00:04:44.880 --> 00:04:56.580 William Cheng: The week that discussion section slide is the introduction to corner three good he would tell you to the Corinthians denial. So in two phases where you split your we're going in phase one, phase two and phase three, etc. Yeah. 33 00:04:57.690 --> 00:05:02.550 William Cheng: So yeah, if you got that far, feel free to send me an email. As soon as you have questions. Yeah. 34 00:05:03.990 --> 00:05:10.560 William Cheng: Alright, so let's continue with chapter seven. So last time we talked about the algorithm. So 35 00:05:11.160 --> 00:05:25.140 William Cheng: You know, so the question is, how do you actually implement it, we mentioned that, you know, one thing that you can do is look at the reference bit inside the page table entry, the restroom just bit over here tell you where the page has been recently reference. So, so there's a 36 00:05:26.190 --> 00:05:31.560 William Cheng: There's a couple of algorithms that sort of go with using that reference bit right because it's kind of weird that you know the reference good that 37 00:05:31.770 --> 00:05:43.860 William Cheng: Means that that particular entry over here has been recently a reference. Well, how can it not be right because as soon as you bring a patient visit the memory that every page will be referenced. Okay. So, therefore, it needs to be done in a sort of a 38 00:05:45.120 --> 00:05:51.420 William Cheng: clever way so that method that the way to use as reference reference there is no as the clock algorithm. 39 00:05:51.780 --> 00:05:57.060 William Cheng: So there are two different version one has got a two hander clock out with them. And the other one is called one Hancock out where that 40 00:05:57.690 --> 00:06:05.160 William Cheng: So the two I had a call with them. So, you know, wait, this is you know it that. Now, this one has to pay out demon that 41 00:06:05.820 --> 00:06:10.170 William Cheng: So what you would do is that you will arrange all your page rain around the clock face. 42 00:06:10.440 --> 00:06:18.300 William Cheng: Right, so, so, so in that case, I'm the bad guy over here is that you put it in a circular list right so basically the way. So think about is that is that you arrange them around the clock face. 43 00:06:18.570 --> 00:06:23.760 William Cheng: And then you have two page document. The first one is the one that will set all the reference back to zero. 44 00:06:24.330 --> 00:06:36.300 William Cheng: Okay, so what happened is that when when one start with the one where the first page document wakes up, he will stop on a 12 o'clock position and go sweep around the entire clock face and said, every page over here so that the that the reference vertical zero 45 00:06:37.320 --> 00:06:43.380 William Cheng: Okay, so every page table entry, you know, the bigger zero and then when it goes back to the 12 o'clock position, you will go to sleep. 46 00:06:43.770 --> 00:06:53.820 William Cheng: Okay, a little bit later, the second page I demo will wake up. When should a second page demon wake up. Right. So again, this is a sort of a design parameter and the audiences and designer can figure out what to do. 47 00:06:54.600 --> 00:06:59.580 William Cheng: So maybe we'll wake up you know you one second, five seconds 10 seconds. We don't really know. It depends on the opposite. 48 00:06:59.760 --> 00:07:10.320 William Cheng: So when the second page. I've even wakes up, what do we do that again. You will scan the same pad that the same page rank in the same manner. So what do you would do is that you will actually check your the reference page to see if it's equal to zero. 49 00:07:11.160 --> 00:07:22.080 William Cheng: But when it sees a reference good equal to zero for that particular patient. And what does that mean well that means that, so. So let's say that you wake up so that the second page on the mat wakes up 10 seconds after the things. First, we got it man. 50 00:07:22.290 --> 00:07:28.860 William Cheng: So if the reference but equal to zero, that means that this particular page has not been referenced in the past 10 seconds. 51 00:07:29.940 --> 00:07:36.390 William Cheng: Okay, so, so this page for it hasn't been wrapped in the past 10 seconds. So maybe in that case you will be eligible to be swapped out to the desk. 52 00:07:36.810 --> 00:07:44.850 William Cheng: Okay. What if the page reference over here is equal to one. What that means that this page has been referenced in the past tense. So, therefore, this page friend is recently us 53 00:07:45.750 --> 00:07:49.350 William Cheng: Okay, so you know what this is kind of an approximation of the hour that because 54 00:07:49.710 --> 00:07:55.170 William Cheng: Our them say you have to sort them but sorting things very, very expensive. So in this case, if we go back to our dvd 55 00:07:55.410 --> 00:08:03.630 William Cheng: DVD analogy over here we're going to divide our DVD. The DVD into two classes. One is the most recently used and the other ones at least recently use 56 00:08:03.900 --> 00:08:09.690 William Cheng: Everything that's most recent years they stay in the DVD right everything that at least recently us, they all go into the basement. 57 00:08:10.530 --> 00:08:14.730 William Cheng: Okay, so we're over here. We're going to do the same thing, you know, the most recently us will have our equals two, one 58 00:08:14.880 --> 00:08:25.590 William Cheng: And the least reason you are equal to zero. So everything that's are equal to zero, we're going to add them to this queue and have them right into the round to this and when they finish writing on to this that case, the patient will be 59 00:08:26.490 --> 00:08:29.610 William Cheng: The patient will be free and then you return the page to the buddy system. 60 00:08:30.630 --> 00:08:36.450 William Cheng: Okay, so if you do this very, very aggressively, then you know the buddy system will almost always guaranteed to have 61 00:08:36.960 --> 00:08:45.000 William Cheng: To have always, always, always a page ranks. Yeah, I mean, there's no guarantee right because it is possible. What of all your pace frames are reference all the time. 62 00:08:45.510 --> 00:08:52.950 William Cheng: Well, in that case is going to be in trouble right you have all your processes they use up the patient all the time. So in this case, it will be nothing to swap out and pretty soon your buddy system will be 63 00:08:53.490 --> 00:09:00.780 William Cheng: Will be out of patient. OK. So again, there's still a possibility that bad things can happen. Right. But again, we're trying to sort of do our best to try to write the page where 64 00:09:01.140 --> 00:09:04.980 William Cheng: You know, on to the desk. You know as aggressively as possible. All right. 65 00:09:05.670 --> 00:09:16.110 William Cheng: What about the other our them is called a 100 our them. So in this case, you only have one page out the man and that has to do all the work. So what you would do is that, again, when you wake up, you're up. You're looking at the page. 66 00:09:17.310 --> 00:09:21.780 William Cheng: 12 o'clock position. And what you will do that he will check the reference fantasy equal to zero or not. 67 00:09:21.990 --> 00:09:30.030 William Cheng: If it's equal to zero, that means that this page is now recently used in this case we're gonna, you know, again, remove this page from this list and then send it to the 68 00:09:30.810 --> 00:09:42.690 William Cheng: To this to be written out back to the desk. What are the reference would have equal to one. Okay. If the reference but equal to one, that means that this patient has been recently reference. So therefore, we're going to set the reference but equal to zero. 69 00:09:43.740 --> 00:09:48.090 William Cheng: Okay, so whenever we see a patient what we are already close to one. So what we do is, I want to get into a zero. 70 00:09:48.180 --> 00:10:00.240 William Cheng: So eventually, when we go back to the topic card position, we can go to sleep, and later on when we wake up next time we come to this page if it's still zero. That means that this patient is not recently reference is equal to one, that means that by the time you know 71 00:10:01.050 --> 00:10:06.390 William Cheng: Since last time you visit this page. This page hasn't has been referenced again was like this guy's got we said it back to zero. 72 00:10:06.780 --> 00:10:14.190 William Cheng: So therefore, using a Whitehead o'clock hour them will also will also work. OK. So again, you can also control, you know, how often do you want to wake up. 73 00:10:14.670 --> 00:10:24.750 William Cheng: Also, if you want to be really, really aggressive. You don't even have to go to sleep. Right. Once you go to the 12 o'clock position, it can start over and over and over again. So you can actually easily control how often you want to do, you know, 74 00:10:26.130 --> 00:10:35.160 William Cheng: How often do you want to do the sweep so that you can actually, you know, take all the PageRank that are now recently us and send us send them to send them to their back end store, then 75 00:10:36.900 --> 00:10:45.570 William Cheng: Alright, so, so in weenies. You know, I think I mentioned already, the page. I'll demon is only woken up when you are completely out of memory. 76 00:10:46.080 --> 00:10:53.610 William Cheng: So I think in configuring Cade actually configure your winnings to have your 256 megabytes of memory. So you put the money should never run out of memory. 77 00:10:54.330 --> 00:10:59.460 William Cheng: Okay, so, so, so, in a way, you don't really need page on demand. So, so I guess there's co written 78 00:10:59.910 --> 00:11:07.830 William Cheng: For the page on demand is interesting to read the code to see what the PGA even do. Okay. But the basic idea is that we need to deploy albinism. When you run out of 79 00:11:08.250 --> 00:11:16.020 William Cheng: You know when when the buddy system says, I have no more PageRank. At that time, will you should do is he wake up the page it man. What do you do that it will scan all the page. 80 00:11:16.470 --> 00:11:18.840 William Cheng: And then write something out of it this way for them all to 81 00:11:19.350 --> 00:11:29.610 William Cheng: To be done. And this way you can end up with a bunch of free patron. And then you ask the buddy system again to say Can I have a Patreon anybody's. Is this a sure I have so many patients. Now I can actually give a good I can actually get want to you. 82 00:11:30.420 --> 00:11:36.390 William Cheng: OK. So again, that's the intention of the Linux page demon, but I think our Colonel assignment should never wake up to the 83 00:11:37.320 --> 00:11:47.280 William Cheng: Page. Yeah, I mean the only wake up at the end when he kind of shut down the system. Okay. So I think that should be the I'm not 100% sure but I think that's the correct behavior. Okay. 84 00:11:49.440 --> 00:11:55.710 William Cheng: All right, well, you know, what if you actually use up all the patient, right, so the page. I've even come to scan all the patient all the patients. 85 00:11:56.250 --> 00:11:59.760 William Cheng: Are all recently use. So in this case, you're going to be 86 00:12:00.720 --> 00:12:08.910 William Cheng: You know, in this case, you know, you can actually get into trouble there. So there are different approaches to to to to to to allocate is Patreon. 87 00:12:09.360 --> 00:12:16.140 William Cheng: One is known as global allocation. So in this case, all the processes will compete for the patient from a single pool. 88 00:12:16.620 --> 00:12:20.340 William Cheng: Okay. So in this case, you know, the problem with this pretty good approaches that you're going to have one 89 00:12:20.970 --> 00:12:22.620 William Cheng: Is normally what I call them as a memory hog. 90 00:12:22.980 --> 00:12:31.650 William Cheng: Okay, so what it will do is that one process will try to get as much memory as they can get. What kind of process. Is that right, so maybe you can sort of thing about maybe a crypto process, maybe a simulation. 91 00:12:31.890 --> 00:12:43.170 William Cheng: Simulation can actually, you know, hit all the objects and then you eat up all the memory. So in that case, if you have a single pool one process will on all the pace read while all the other processes don't own any page right 92 00:12:44.220 --> 00:12:53.100 William Cheng: Okay, so in that case all the patient will react so so in this case the page on demand. When you try to schedule a pace. Right. Everything is most recently us so so so pretty soon you'll please God, man. 93 00:12:54.630 --> 00:12:56.970 William Cheng: Well, pretty soon, are you buddy system is going to run on a track. 94 00:12:57.930 --> 00:13:03.030 William Cheng: That. So over here, it says, you know, so, so a lot of it is obvious that there's a possibility of flashing 95 00:13:03.240 --> 00:13:12.240 William Cheng: What is actually so thrashing meaning that we are out of memory. As it turns out, the system of going to a very, very inefficient states. I'm going to sort of pretty soon we're going to take a look at an example to see what kind of 96 00:13:12.570 --> 00:13:18.270 William Cheng: Situation will cause fashion. Okay so thrashing. It's really, really bad guy, so. So again, we're gonna come back to the very soon. 97 00:13:18.750 --> 00:13:21.270 William Cheng: At the other projects. He has no as local allocation. 98 00:13:21.840 --> 00:13:34.590 William Cheng: Okay, so go by location. Everybody compete with the same pool one memory hawk and ruin the life of all the other processes. Okay. Local allocation. Again, this is the operating system designer, they can say that every process has his own private pool, a pace range. 99 00:13:35.820 --> 00:13:38.310 William Cheng: Okay, so every process Allocated Fixed pool. 100 00:13:38.700 --> 00:13:45.090 William Cheng: fixable before pace. Right. So if the process memory requirement is less than the alligator paceman well then in that case. 101 00:13:45.300 --> 00:13:53.580 William Cheng: Once this process. Get all the pastry and you will never get a pig that you will never get a patient, again, right, because those are the private pool for this process, so therefore you cannot take these 102 00:13:54.090 --> 00:13:58.950 William Cheng: Are you cannot. So, you know, read these patriots out to the back end stores so you can give it to somebody else. 103 00:14:00.150 --> 00:14:08.070 William Cheng: OK. So the idea of the page demon is that you want to take me away from some process and then give those memory to somebody else. But now, if you have a private pool. Well, then in that case. 104 00:14:08.430 --> 00:14:14.460 William Cheng: The others won't happen then. So in this case, all your process you will be very happy if they only use a small amount of memory. 105 00:14:14.850 --> 00:14:23.460 William Cheng: Some of the process. He actually would use a lot a lot of memory. So what it will do is it will use of its private pool and then they have to compete with the other policy for the SharePoint. 106 00:14:24.390 --> 00:14:30.930 William Cheng: Okay. So as it turns out, windows, this, this, you know. So again, the reason for them do this is to minimize the possibility of fashion. 107 00:14:31.350 --> 00:14:34.170 William Cheng: Okay, because thrashing was really bad and we're going to see what's the bashing. Yes. 108 00:14:34.920 --> 00:14:43.440 William Cheng: So we're going to sort of illustrate less flashy by a very, very simple example. Okay. So this example is not very real estate but it used to demonstrate thrashing 109 00:14:43.800 --> 00:14:51.510 William Cheng: So consider a system. Other hey exactly to fray page trends that are available for application programs. Okay. Of course, this is not realistic. We're going to 110 00:14:51.810 --> 00:14:58.590 William Cheng: So again, make this really silly. So the case over here there to PageRank patient one or two one into process. He has paste rain. 111 00:14:59.490 --> 00:15:05.010 William Cheng: Process page and paper and one and then process pleasing page them to so as here and B's here. 112 00:15:05.730 --> 00:15:16.470 William Cheng: Okay, so if that's all they need so so they will continue to run and then eventually they will all you know die right so when process a thought over here. It's going to free up memory. And now we can run another process. 113 00:15:16.800 --> 00:15:27.390 William Cheng: Okay, so in that case will be perfect, right, there's no more peaceful once process AMB. If that's all you need. And they all are happy with the memory. They have so therefore they will know that they are. They did. They will not, they will not give it a shot. 114 00:15:27.930 --> 00:15:34.140 William Cheng: Okay, so the problem comments that what a process, a over here is going to have two pages. One is the memory of the other ones on desk. 115 00:15:34.500 --> 00:15:42.150 William Cheng: Okay. So over here on disk over here. There's another page over here that's called a two and this one is a one, right. So processing over here is using a one and a two. 116 00:15:42.930 --> 00:15:53.280 William Cheng: Okay so process is running using patient number one over here. And then what do we do that, it will try to access a to over here. The city on this. In this case, you will get a pace fault. Okay, so he's not a patient or what should we do 117 00:15:53.880 --> 00:16:01.680 William Cheng: Okay, so that if we're using our algorithm. We need to replace the least recently used space frame over here. So, which may service least recently used one or two. 118 00:16:02.190 --> 00:16:08.070 William Cheng: What process. A we're just using number one over here. So therefore process be over here will be the least recently used up a page, right. 119 00:16:08.250 --> 00:16:18.870 William Cheng: So what we'll do is that we're going to swap out this page or as a process, you know, the second page over here is going to go on to the desk and now process. A over here needs to wait for as a process is a process LPS Go, go, go, go. 120 00:16:19.470 --> 00:16:31.020 William Cheng: Go to sleep. Waiting for this iOS, the aisle to be completed and then if the IO were able to complete what it would do that again it will it will copy the data from at the second page ran and then it will go to sleep again. 121 00:16:31.650 --> 00:16:38.100 William Cheng: Okay. But the question is, will this going to happen. Okay. As it turns out, this might not even happen because as soon as process. A over here. 122 00:16:39.450 --> 00:16:47.790 William Cheng: Go to sleep. And then you try to write our own process be processed be has no memory, right now, right, because this page over here it's transferring data to this, so therefore you cannot use the PageRank. 123 00:16:48.360 --> 00:16:57.300 William Cheng: Okay, I mentioned before this terminology is called at this page rank, because I think I mentioned that discussion section, this patient. And since it's transferring data out to this this page rank become dirty. 124 00:16:57.750 --> 00:17:08.370 William Cheng: Okay. On the dirty patient. You're not allowed to access it. So, therefore, what is process me supposed to do process be supposed to all be here will try to write proud of, you know, a patient number one over here on to the desk. 125 00:17:08.850 --> 00:17:10.860 William Cheng: Okay, so basically this case both patients. 126 00:17:11.760 --> 00:17:22.020 William Cheng: Are going to the to the desk so therefore process P is going to go to sleep. And then what it will do is it will give a CPU back to process a. So at this point, you know, neither of them will make any progress. 127 00:17:22.800 --> 00:17:28.980 William Cheng: You know that will I will make any progress is because from this point on, all we are getting. It's going to be painful. 128 00:17:29.940 --> 00:17:39.000 William Cheng: Okay, so these two processes over here. When they get to to run the first thing they start running is that they will get another patient all and then it will go to sleep. And when the other classes, ready to run, you'll get a patient off and then we'll go to sleep. 129 00:17:39.240 --> 00:17:44.370 William Cheng: So at this point, neither of them will make any progress that is this a deadlock. 130 00:17:45.480 --> 00:17:52.890 William Cheng: Okay. As it turns out, this is not a deadline is actually a live logs of both of them are doing something, except that they're all they're doing our page fall. Yeah. 131 00:17:53.760 --> 00:18:04.230 William Cheng: Right, so, so, so, so, you know, the reason this is happening right. Is that because we are requiring three different page rank to run these two different processes, but only two of them are available. 132 00:18:04.650 --> 00:18:13.710 William Cheng: That this picture sort of shows you that this happened actually in many, many of them computer system. So on the horizontal axis over here is below those 133 00:18:14.220 --> 00:18:22.020 William Cheng: So, so what is the lowest, the lowest amount of work that you want the system to do. Okay. The vertical axis over here is stupid, stupid is the amount of one actually gets done. 134 00:18:22.680 --> 00:18:32.340 William Cheng: Okay. So as it turns out, a lot of the computer system, the equivalent of like this in the beginning. During the linear region. Okay, if you ask the system to do twice as much work. The twice as much wars will get done. 135 00:18:32.670 --> 00:18:40.500 William Cheng: Okay, so actually the super will be actually twice as good because the system has has plenty of capacity. So the linear region over getting systems gonna perform really well. 136 00:18:40.920 --> 00:18:51.630 William Cheng: Okay, so we have plenty of memory, and we're going to be in the linear region. If you ask us in the wall work, it will get done and it will get done you know Ii Ii Ii there in the same amount of time. Well, actually, you know, the average 137 00:18:53.100 --> 00:19:03.630 William Cheng: The average able to do really well that at some point when you asked us to do more and more and more work. You can see that the curve is going to start leveling off and then at some point, the system will be saturated 138 00:19:04.050 --> 00:19:11.340 William Cheng: Okay, so what does it mean for the system to be saturated. That means that if you increase the low that you want to put on the system. The system stupid is going to be constant. 139 00:19:11.940 --> 00:19:15.540 William Cheng: Okay, so at some point, the system is going to say this is all all the ones that can produce 140 00:19:15.780 --> 00:19:25.530 William Cheng: I could not produce any more. And if you push this isn't even harder to as. This isn't even do even more work. What do you do that it will fall off the cliff. I'm over here, the overall system is going to go to nearly zero 141 00:19:26.490 --> 00:19:32.520 William Cheng: Okay, this happening operating system for case like this. So in the end, the system to put a zero, because they're not doing any any useful word 142 00:19:32.730 --> 00:19:42.510 William Cheng: This happen in databases me multimedia system, you know, this even having to the internet because I think in the 80s. I mean, the 90 over here, people try to run too much studying the internet and then the internet is going 143 00:19:42.990 --> 00:19:47.670 William Cheng: To collapse and once you're in the collapse date over here. There's no way for the system to recover. 144 00:19:48.390 --> 00:19:59.280 William Cheng: Okay, because you asked them to do too much work over here, there's nowhere for you to retire or so the only solution over here is to reboot the system. Right. You need to turn the machine rebooted and hopefully, you know, and next time you try to control it. 145 00:20:00.240 --> 00:20:09.780 William Cheng: Okay, so, so this even have on the Internet. Internet going to, you know, go go go go go up on the internet falls off the off the cliff. They actually have to reboot the internet, I think. Imagine that. Okay. 146 00:20:10.260 --> 00:20:17.220 William Cheng: So so so we so so thrashing is really, really bad. So, so when this happened, you know, obviously, some people say it's thrashing 147 00:20:17.550 --> 00:20:24.060 William Cheng: So what does this term come from and something really weird time so happens that you know when IBM. First, you know, you can see the 16th or something like that. 148 00:20:24.570 --> 00:20:30.330 William Cheng: They are they are experimenting with running a lot of stuff in parallel and they noticed that at some point. 149 00:20:30.930 --> 00:20:38.880 William Cheng: The, the, this, they have. That's probably the business up before I know be a hard drive, they will start shaking and start making a lot of noise. 150 00:20:39.510 --> 00:20:45.420 William Cheng: So, so, because what happened is that you know that this is really, really busy, but none of the processes or make any progress. Okay, so 151 00:20:45.630 --> 00:20:52.230 William Cheng: This makes so many noise. So they said that this is thrashing ever since then, we still common fashion. Okay, even though today. You can't really hear the disk anymore. 152 00:20:52.860 --> 00:21:00.780 William Cheng: So we sort of, you know, we're so so so what what this is that it's not making any progress. We call this, you know, this is, I mean, the system is 153 00:21:01.980 --> 00:21:12.240 William Cheng: Now, so how do we solve this problem, right. So those of you who are who was or, you know, engineering, they say, oh, it's really simple right over here, there's this curve over here, I can actually draw some kind of a low line. 154 00:21:12.420 --> 00:21:16.230 William Cheng: And then, you know, these two system, whether it be the the the Sumo line. 155 00:21:16.770 --> 00:21:24.750 William Cheng: What happens that the the the the systems that operate at the intersection of this curve. So I'm so I can actually design, you know, a control system. So they will operate right here. 156 00:21:25.140 --> 00:21:34.020 William Cheng: Okay, so this way, whenever they tried to check to try to saturate what happened is that the other this other mechanism actually push it towards, towards the middle 157 00:21:35.100 --> 00:21:41.910 William Cheng: Okay, so, so again, that the work with an engineering system. How do you do that, you know, using, you know, for, for, for, for, for operating system. Yeah. 158 00:21:42.660 --> 00:21:49.380 William Cheng: So, so yeah, this is a serious problem. So I think one of them very famous computer scientists. His name is Peter Denning 159 00:21:50.100 --> 00:21:59.280 William Cheng: He come up with the idea of something called the working set that. So the idea of working said is that you need to you know fulfill every program. There's this idea of a working session. 160 00:21:59.790 --> 00:22:17.730 William Cheng: So what is the notation to say working set for a process P during a time period teeth. So, W. S. A. P. COM. It is a set of pages that are used by the process over a period of tea that so so so what does that mean, right. So if you think about your warm up one, what does it work instead of your 161 00:22:19.830 --> 00:22:21.780 William Cheng: You know, for for your one on one look like 162 00:22:22.650 --> 00:22:27.660 William Cheng: That. So this is time over here. So here is the working set of your warm up one right 163 00:22:27.870 --> 00:22:38.340 William Cheng: Okay, so. So what we're gonna do. We're gonna, you know, I mean, it's a little go to pod the workings. So we're going to pop in the size of the working set the number of pages that you want my plan require vs vs time 164 00:22:38.880 --> 00:22:44.070 William Cheng: Okay, at the beginning of what is your part one online doing right so what I'm trying to do that, try to read the records one record at a time and 165 00:22:44.310 --> 00:22:54.240 William Cheng: create these data structure and going to add it to the language and their lingo is going to get longer and longer, longer so so the pictures don't look like this. Right. It's a kind of linear right beginning. Over here, over time. 166 00:22:54.750 --> 00:23:00.630 William Cheng: The working set is going to get increase and increase, increase, at some point you finished reading your entire file, then what do you do 167 00:23:00.870 --> 00:23:05.160 William Cheng: Well then you start sorting it when you sort it depend on the sorting algorithm that you use. 168 00:23:05.460 --> 00:23:10.140 William Cheng: You know, if you're using bubble sort, in that case, the memory doesn't increase or there's gonna be a fly region over here. 169 00:23:10.350 --> 00:23:16.200 William Cheng: And this is going to take a very long time either be the number of records like 1,000,001 billion. I said it will take a while. Over here. 170 00:23:16.530 --> 00:23:26.040 William Cheng: And then when you're done, then what happens that you are you going to iterate through the list and print them out when you print them out, you can actually start freeing up the data structure, right. So it was the end of its gonna look like this. 171 00:23:26.910 --> 00:23:30.420 William Cheng: That. So this is going to be the size of the working set over time. 172 00:23:31.620 --> 00:23:43.770 William Cheng: Okay, so the idea over here is that if we can actually know the size of the working set over time. What we can do is that we can take all the processes. Add up all their working says sizes. If you know if the sum of their working 173 00:23:44.640 --> 00:23:53.760 William Cheng: In the summer, they're working set size it is less than the physical memory that's allowed. So if it's less than the physical memory that's available. Well, in that case, you will never get into session. 174 00:23:54.360 --> 00:24:01.260 William Cheng: Right, because in that case if everybody have all the pages that you need. And it's smaller than the size of the physical memory. Well, in that case anyway happy. 175 00:24:01.560 --> 00:24:09.540 William Cheng: So you guys will never get Sasha. Okay, so what did you want to run a new program. And now the new program will actually require more memory so that when you add them all up. 176 00:24:10.260 --> 00:24:18.750 William Cheng: You know, if you add up all the size of the working set is going to be bigger than the physical memory, what, in that case, the new program, you don't allow it to run 177 00:24:20.640 --> 00:24:30.150 William Cheng: OK, so the new pro why if you, you know, if he has memory requirements so that the overall memory requirement is going to be bigger than physical memory, then, you know, in that case, you basically have admission. 178 00:24:30.600 --> 00:24:35.430 William Cheng: admission control system that you say the new program is not allowed to run if it turns out it's going to use too much memory. 179 00:24:36.510 --> 00:24:43.650 William Cheng: Okay, so this way, there will be no thrashing. Okay, so, so this is a sort of a sound idea over here. I, the idea is very simple, right, that, that, that 180 00:24:44.220 --> 00:24:47.280 William Cheng: If you add up all the memories less physical memory. They can have no problem. 181 00:24:47.700 --> 00:24:54.150 William Cheng: If you're going to violate that rule that you don't allow the new product or up. Okay. But in reality, turns out to be this is very, very difficult, difficult to implement. 182 00:24:54.540 --> 00:25:01.680 William Cheng: Because there's really very difficult for you to figure out what's the size of the working set. Okay. So even though you say, hey, I actually know what this says the working set. So what about this picture. 183 00:25:02.250 --> 00:25:13.860 William Cheng: Okay, this picture. Actually, it depends on how big the input file. This is the input file is is 10 times bigger problem is that the curves don't look like this right is going to go up for a long time. And then it's gonna level off for a longer time it's going to come down. 184 00:25:14.280 --> 00:25:18.060 William Cheng: If the amplifier is sure. Or maybe the, you know, the work is is going to be looking like this. 185 00:25:18.420 --> 00:25:28.200 William Cheng: Well, so therefore you know the application program, they have different workings that depends on the input. It depends on what the user is typing, so therefore it's gonna be very difficult for you to predict how the working status. 186 00:25:29.040 --> 00:25:41.430 William Cheng: That. So, therefore, you know, as I mentioned before, you know, Windows. Basically what they do is that, you know, they, they, said I, you know, I'm going to say the working set for every process to be a fixed number. So this way. Everybody will get the same number of pace frames. 187 00:25:41.850 --> 00:25:49.260 William Cheng: So as long as your usage is below that level, then you can finish pretty quickly. Otherwise you're going to compete, anything above it, you're gonna compete with global 188 00:25:49.830 --> 00:25:53.550 William Cheng: You got a complete, you can compete with all the other processes inside the system. 189 00:25:54.060 --> 00:26:01.560 William Cheng: Okay, so you know my windows trying to do is that they try to have an approximation of the working set. So this way, it will try to minimize the probability of flashing 190 00:26:02.460 --> 00:26:07.530 William Cheng: Right again, they don't try to guarantee there's no thrashing if you use the working set, you know, in this case, you know, 191 00:26:07.830 --> 00:26:12.900 William Cheng: Most spoken a little work well because what happened is that if you have a memory hog. It's going to take up all the memory. 192 00:26:13.140 --> 00:26:21.210 William Cheng: All that process can do is to take up all the share memory while all the other smaller processes, they will actually be able to continue to run and they will do they 193 00:26:21.540 --> 00:26:28.050 William Cheng: Don't get paid for anymore, eventually they will finish, they will die and they will release memory back to the, you know, back, back, back to the system. 194 00:26:29.100 --> 00:26:34.470 William Cheng: Okay. So in this case, you know, some of the smaller program, they will continue to be able to finish and self terminate. Yeah. 195 00:26:35.820 --> 00:26:36.210 William Cheng: All right. 196 00:26:38.010 --> 00:26:45.930 William Cheng: Okay, so we're going to get into the next section over here talking about represented system. So what are sort of briefly take a look at Linux and then maybe take a even a briefer look at 197 00:26:46.620 --> 00:26:53.070 William Cheng: Windows because we don't you know because we don't have Source software for Windows. So we're going to basically look at the the Linux system first 198 00:26:53.850 --> 00:27:03.210 William Cheng: There for Linux the x86 virtual memory lane. So again, x86 means that it's a 32 bit address space again, there's four gigabytes over here. 199 00:27:03.630 --> 00:27:17.070 William Cheng: For Linux system over here, the user space program take up the first three gigabytes and the Colonel take up the last one gigabyte. OK. So again, the virtual address space for the user process go from zero all the way to zero, x be F. F. 200 00:27:18.540 --> 00:27:26.160 William Cheng: F and the Colonel starts at 00000000 all the way to zero, x F, F, F, F. 201 00:27:27.360 --> 00:27:35.400 William Cheng: Okay, so if you have bidding. So if you'd be having debugging your kernel source code, you will see that all the colonel data structure. Start with 00 XE something 202 00:27:35.790 --> 00:27:41.880 William Cheng: Good. And if you have, you know, GDP is it. Number one, you will see that all the user space program has value between zero 203 00:27:42.120 --> 00:27:53.880 William Cheng: And zero XP or something. And then if you look at variable that live inside the stock rain all their other like a local variable and function argument. And if you print the addresses, you will see that they all start with zero x BF or zero XP years 204 00:27:55.260 --> 00:28:02.160 William Cheng: Okay, so for Linux system that for UNIX system. I guess this is the sort of the typical memory layout. 205 00:28:06.240 --> 00:28:07.740 William Cheng: That. So Robin is that 206 00:28:08.130 --> 00:28:20.100 William Cheng: You know, again, on the left hand side over here, this is the virtual address space right on the right hand side over here is going to be physical memory. So the way we use physical memory is go through a memory map to map part of our address space to your 207 00:28:20.460 --> 00:28:25.320 William Cheng: physical memory and part of our space to the desk. Right. So again, we're going to use the peaceful mechanism. 208 00:28:25.530 --> 00:28:34.620 William Cheng: To get data from the days and then moving into memory and then we can fix the virtual memory map over here. And so, so, so this way. They use us appointment continues run 209 00:28:34.890 --> 00:28:45.480 William Cheng: Guys, remember the user program in order for it to run it can only use part of the virtual address space that are mapped to physical memory if they're not map the physical memory. Why, in that case, you're going to get a page fall and the Colonel shoes, you're 210 00:28:46.080 --> 00:28:53.640 William Cheng: The kind of will have to fix things. Okay. All right. So, so again, Linux, you know, you have to use a virtual memory in order for you to use them. 211 00:28:54.510 --> 00:29:02.760 William Cheng: So most of the most of the time our program, they all do virtual allocation right clearly in the user space. There's no way for your user space program to the physical location. 212 00:29:03.000 --> 00:29:07.620 William Cheng: That doesn't even your users a problem because even know how much physical memory there is right, but the colonel knows 213 00:29:08.070 --> 00:29:15.180 William Cheng: Most of the time he's had a colonel, you also do a virtual allocation that we use a slap alligator we access process control blah, we asked us to 214 00:29:15.660 --> 00:29:20.880 William Cheng: Enjoy each other. Okay threat control, blah. In that case, you're doing, you know, virtual location. 215 00:29:21.450 --> 00:29:29.160 William Cheng: When does the colonel actually do real allocation. Okay, so, so when you trying to allocate four kilobytes of the time. So pretty much anytime we use the buddy system. 216 00:29:29.610 --> 00:29:38.790 William Cheng: OK, you are doing physical allocation. Well, yeah, so that's why I sort of used afraid to say that the, the job of the colonel is to manage the physical address space. Okay, you know, for the for the 217 00:29:39.810 --> 00:29:40.650 William Cheng: For the entire system. 218 00:29:41.310 --> 00:29:48.180 William Cheng: OK. So the real allocation over all you got over here four kilobytes at a time. And this is done and paste fault right and also at other time. 219 00:29:48.360 --> 00:29:58.380 William Cheng: Will you ask the buddy system for page, right. So for example we slap alligator run out the entire slap you need to you need to create a new slab. Again, you talked about, but he says anybody says about Al Qaeda physical memory. 220 00:29:58.680 --> 00:30:02.730 William Cheng: So much memory for you and for this point are you going to do virtual allocation right 221 00:30:04.980 --> 00:30:09.570 William Cheng: Okay, so let's take a look at a special case for for for for Linux. 222 00:30:10.320 --> 00:30:18.600 William Cheng: Linux over you the example here is that what if I have one gigabytes of memory. And there's a huge is physical memory, right, my physical memory has one gigabyte. I mean, today we all have more than one gigabyte. 223 00:30:18.870 --> 00:30:28.650 William Cheng: Okay, but you know in my office. There's a netbook that has one gigabytes of memory. Okay, so we're here I my physical memory has exactly one gigabytes of memory. So in this case, how would I set up the memory map. 224 00:30:29.850 --> 00:30:33.900 William Cheng: Okay, so if you think about those are the users that has three gigabytes over here. The Colonel has one gigabyte. 225 00:30:34.200 --> 00:30:41.640 William Cheng: Why don't I map one for one every Colonel every, you know, every memory location, instead of Colonel to every physical memory location. 226 00:30:42.480 --> 00:30:50.370 William Cheng: Right, because I wanted to myself, you know, Colonel address space and one gigabytes of physical memory over here. One of the most convenient thing to do is to have a one to one mapping 227 00:30:50.580 --> 00:31:02.610 William Cheng: Right. So one thing that you can sort of think about is I can take zero XE 000000 I can take every corner virtual address I just subtract zero XE 0000000 from that and then that will get a physical address space. 228 00:31:03.090 --> 00:31:09.510 William Cheng: That will get a physical address. Okay. So that will be the most simple and straightforward address translation. If I only have 229 00:31:09.930 --> 00:31:12.180 William Cheng: You know, you don't have one gigabyte physical physical memory. 230 00:31:12.720 --> 00:31:19.830 William Cheng: Okay, so why do I want to do that. So this way. The Colonel can easily manipulate and physical memory by just simply take the colonel virtual address 231 00:31:20.040 --> 00:31:24.990 William Cheng: Subtract zero at Caesars or maybe you subtract three gigabytes where I'm at. And I'm going to get a physical address 232 00:31:25.680 --> 00:31:36.090 William Cheng: That. So conceptually, there should be one to one correspondence between any Colonel virtual address and a physical address okay if you only have if you have exactly one gigabytes a physical memory. 233 00:31:38.400 --> 00:31:50.670 William Cheng: Alright, so. So conceptually. Oh, here's this conceptually, we can set up the page table so that physical address is equal to the colonel virtual address VAD yard is virtual address minus, you know, the first memory location over here. So, 234 00:31:51.510 --> 00:31:55.200 William Cheng: I want to make a note over here said this is not done in this way in a real system. 235 00:31:55.950 --> 00:32:04.830 William Cheng: Okay, so, so in the real system. For example, Linux, they have a different setup. Right. But conceptually, this should be a one to one mapping from the colonel to the user. 236 00:32:05.760 --> 00:32:13.020 William Cheng: Okay, so this case the colonel can read any physical memory location easily by by doing this address manipulation, right. So, yeah. 237 00:32:13.230 --> 00:32:26.550 William Cheng: You know, so this guy's if you are using zero XE 1234568456 and over here, right, what physical memory location. Are you accessing right you just get rid of. See, and I'll give you the physical memory located so you know exactly what you're accessing 238 00:32:27.180 --> 00:32:34.890 William Cheng: Okay, so this will be really convenient, even though in real system. They don't do that. So when you when you do your winnings Colonel don't expect things to be on the exact this exactly this way. 239 00:32:35.340 --> 00:32:43.770 William Cheng: But again, you know, you shouldn't really read the page Franco because the Fisher and close so you shouldn't really read the buddy system copious by the system color is almost impossible to understand 240 00:32:44.460 --> 00:32:49.170 William Cheng: That. All right, so you just have to say, well, conceptually, we're doing the one to one mapping that 241 00:32:49.860 --> 00:32:56.580 William Cheng: All right, so, so if the audience can read any physical memory location easily and also they can write it to any of the physical memory location over here. 242 00:32:56.850 --> 00:33:02.970 William Cheng: What about the user space program rather use this one over here. I'm trying to use memory over here. Where does the user state memory is going to have to 243 00:33:04.650 --> 00:33:11.250 William Cheng: Okay. I mean, obviously it has to map to the same physical memory, right, because in order for you to use user space memory. You have to use physical memory. 244 00:33:11.610 --> 00:33:17.520 William Cheng: Okay, so therefore the user space or, you know, address over here need to map to the same physical memory. So the pictures don't look like this. 245 00:33:17.970 --> 00:33:24.600 William Cheng: Guy's over here. There's one as let's say here is one virtual address over here, a user virtual address right here that 246 00:33:25.140 --> 00:33:36.120 William Cheng: So this is a zero x 1234 my favorite address 5678 right right here. Okay. So going through. So, so if this one map to physical memory over here, it will map to somewhere over here. I don't, I don't know where it is. 247 00:33:36.750 --> 00:33:45.930 William Cheng: OK, because every time when I tried to allocate a page. I'm going to ask the buddy system for page. So this doesn't really have to be physical memory zero x 12345678. It could be any page over here. 248 00:33:46.350 --> 00:33:48.720 William Cheng: So, get this, this case right the the 249 00:33:49.050 --> 00:33:54.540 William Cheng: virtual page number is going to be zero, x 12345 right and the offset within the page is going to be 678 250 00:33:54.720 --> 00:34:02.370 William Cheng: So the virtual base numbers over here is going to map to a four kilobytes page over here with offset 678 into that page that will be the corresponding physical address 251 00:34:03.270 --> 00:34:12.900 William Cheng: Okay, so this memory address over here has a virtual address zero x 12345678 but this memory location over here also has a kernel virtual address 252 00:34:13.530 --> 00:34:20.910 William Cheng: Right, because we're doing one to one mapping over here from current user. So, so this memory or just also has a kernel virtual address here. 253 00:34:21.660 --> 00:34:32.760 William Cheng: Okay, so, you know, wait, every physical memory location over here as long as they belong to a user process. Okay, that physical memory actually has to virtual address one in the user space and why inside, Colonel. 254 00:34:34.950 --> 00:34:40.200 William Cheng: Guys over here, these pages are math on both the user spends across a space. Oh, yeah. So there's one page over here. 255 00:34:40.500 --> 00:34:46.050 William Cheng: To this page inside the Colonel. There's also four kilobyte page or map the exactly the same page. Over here I sounds really weird. 256 00:34:46.950 --> 00:34:58.170 William Cheng: Okay. But if you think about, you know, if I want to map every kernel memory location of your physical memory. Well then, this has to be true, right, the memory location over here that's used by the Colonel. The Colonel can reference, as it turns out also used by the user space program. 257 00:34:59.910 --> 00:35:07.230 William Cheng: Okay, so. So again, you know, the Colonel's will have full control over here to try to decide what to read from this memory of what of what the right to that memory. 258 00:35:08.010 --> 00:35:17.820 William Cheng: Now, so in this case the always can read any users memory location directly assuming that it's Matt right so so if over here. If the user profile trying to do something. 259 00:35:18.000 --> 00:35:22.710 William Cheng: For example, you make the racism call right or we make the racism called he called the racism call over here. 260 00:35:22.980 --> 00:35:31.740 William Cheng: There's a buffer. Where's that buffer right the buffer point to the memory location over here in physical memory. So when you trapped inside a colonel because the rights, a system called going to try this out of Colonel 261 00:35:31.980 --> 00:35:38.040 William Cheng: What the colonel will do is that it will Colonel will use the kernel version of the of the address to access this data. 262 00:35:39.060 --> 00:35:48.840 William Cheng: Okay, why can't the colonel user user space virtual address well because the user space virtual address when you perform either transition, what a veto to zero over here inside the inside the page table entry. 263 00:35:50.100 --> 00:35:59.400 William Cheng: What if you do that, is that currently going to end up with the colonel page fall. And as you're doing Colonel why you, you can see that Colonel page ball is a really, really bad news. So therefore you are not supposed to go to 264 00:35:59.910 --> 00:36:09.570 William Cheng: Baseball so so once you try things out the Colonel. If you want the asset data to this buffer inside of Colonel. Well, in this case the kernel has his own virtual address and if you use the colonel virtual address is going to be safe. 265 00:36:11.610 --> 00:36:21.450 William Cheng: Alright, so, so, so we're going to sort out, you know, so again this is a little weird, you know, for now, but once you start working your current or three at some point you're going to get used to this and to to understand how this actually works. 266 00:36:22.200 --> 00:36:27.990 William Cheng: There. So, therefore, you know. So again, the way she's thinking about is that when the user threat become a colonel threat. 267 00:36:28.170 --> 00:36:36.630 William Cheng: It's still in the same process. So, therefore, if it's the same process every process has a page table. So therefore, will you will use your throughout become a colonel threat and then I mentioned before. 268 00:36:36.990 --> 00:36:46.650 William Cheng: You know, as far as this causes concern when you make a system called you're still the same Australia. So the same process. Okay, some others operating system that might not be true. Okay. But again, as far as this is concerned, this is true. 269 00:36:47.010 --> 00:36:50.160 William Cheng: So in this guy's if it's the same process, then you have to use the same page table. 270 00:36:51.300 --> 00:36:57.360 William Cheng: Okay, so before we sort of draw the picture like this right when you have multiple processes that page table with this one page table for the blue process. 271 00:36:57.600 --> 00:37:09.960 William Cheng: There's one page table for the pink process. And there's one page table for the for the for the Colonel. Well, as it turns out, if you know you know if the user process and the Colonel processes they belong to the same process, the real case that we should look like this. 272 00:37:11.040 --> 00:37:21.870 William Cheng: So be sure to set the first, you know, so for for for the for the blue process. The first three quarters of the page table. Okay, belong to the user space program. And the last part over here. I should be on to the Colonel. 273 00:37:22.770 --> 00:37:26.880 William Cheng: Okay. Similarly, when you go to the pink process over here. The first three quarter of the page that was okay. 274 00:37:27.090 --> 00:37:35.700 William Cheng: The patient was 1 million entry right so this means that three quarters of a million entries over here is gonna is going to be used by the user process. And the last part of yours going before the current all 275 00:37:36.030 --> 00:37:42.750 William Cheng: That and also they are processing their own inside of Colonel, they never go into the user space. So, in that case what would their tape a stable. OK. 276 00:37:43.380 --> 00:37:52.590 William Cheng: OK, so the first three quarters of where they all have V equals zero. And the last part over here. We're going to map the entire one gigabytes of the colonel virtual address map the physical memory. 277 00:37:53.400 --> 00:38:03.840 William Cheng: OK. So again, the bottom part over here, they all belong to the colonel right and they correspond to the bottom gigabytes of the address space. So in this case, all these memory over here, they will map directly to physical memory. 278 00:38:04.500 --> 00:38:09.420 William Cheng: Okay. And once you're inside the Colonel, the kernel is like a giant process. So even though in the user space. 279 00:38:09.630 --> 00:38:15.930 William Cheng: There are separate processes. Once you get inside of Colonel the bottom part of all these address space over here. There are map exactly the same way. 280 00:38:16.140 --> 00:38:25.110 William Cheng: And that's why your current one. You never have to deal with the colonel page table because once you're inside a kernel that all all the colonel page table at the bottom over here. They all look exactly the same. 281 00:38:27.150 --> 00:38:37.620 William Cheng: All right. Okay, so I'm gonna stop right here. So now we're a sink again with the summer 2009 lectures. So next time we're going to continue. And next I'm going to finish chapter seven. Okay.