WEBVTT 1 00:02:00.480 --> 00:02:07.980 123 2 00:02:09.720 --> 00:02:25.980 William Cheng: Welcome to lecture 21 3 00:02:38.640 --> 00:02:39.000 Lalit Gupta: I 4 00:02:42.720 --> 00:02:44.160 Lalit Gupta: Have a small question. 5 00:02:46.920 --> 00:02:55.080 Lalit Gupta: Do I was do know how to like print the list in GDP ours, because we needed the same kernel list and the listening. 6 00:02:55.890 --> 00:02:56.280 Yeah. 7 00:02:58.380 --> 00:03:01.080 William Cheng: One. One thing that you can write your own function to do it. 8 00:03:04.200 --> 00:03:07.980 William Cheng: I guess there's some the command called Colonel list or something like that. 9 00:03:08.010 --> 00:03:17.130 Lalit Gupta: Yeah. Oh, yes. I live with the Venus dissing the cardinal list. And when you do, Colonel list and the list name it's safe some error. 10 00:03:17.850 --> 00:03:19.140 Lalit Gupta: And is 11 00:03:20.220 --> 00:03:24.390 William Cheng: Yeah, because I I don't know exactly what to do with that command. 12 00:03:25.500 --> 00:03:31.710 William Cheng: I never tried it, so I don't, I don't, I'm not sure how to get it. The word, maybe there's something that you can do. 13 00:03:33.240 --> 00:03:37.860 Lalit Gupta: Yes, say, some Python code and kind of where it says Python except last paper. 14 00:03:39.510 --> 00:03:47.190 William Cheng: Right, so just like the colonel info. Right. You have to give it a function. Right. So you have to write a function first and then and then you move to the command. 15 00:03:48.210 --> 00:03:49.560 Lalit Gupta: Okay. Oh. 16 00:03:52.740 --> 00:03:59.970 William Cheng: That's my guess. I never tried it and nobody ever told me that they they they got something to work using that command. 17 00:04:01.320 --> 00:04:01.590 William Cheng: Yeah. 18 00:04:02.640 --> 00:04:08.940 Lalit Gupta: I don't have to look at the list something, say something here and and other singers. 19 00:04:11.430 --> 00:04:12.540 Lalit Gupta: Did in the 20 00:04:14.490 --> 00:04:18.630 Lalit Gupta: In the mm object underscore te um 21 00:04:19.290 --> 00:04:21.660 William Cheng: Let me, let me switch over there. 22 00:04:28.440 --> 00:04:30.600 William Cheng: Okay, so 23 00:04:31.980 --> 00:04:33.330 Lalit Gupta: Include. Include 24 00:04:33.660 --> 00:04:37.440 William Cheng: Mm hmm. And then I'll be good at eight. 25 00:04:40.050 --> 00:04:40.440 William Cheng: Okay. 26 00:04:42.210 --> 00:04:48.570 Lalit Gupta: And yeah, there is a member called mo underscore VI VI m s, then 27 00:04:49.800 --> 00:04:50.790 Lalit Gupta: Yes, in the Union. 28 00:04:51.120 --> 00:04:52.950 Lalit Gupta: Right, I'm not able to 29 00:04:54.960 --> 00:05:00.270 Lalit Gupta: Figure out, like, what's, what's the use of this thing, like where it will become useful. 30 00:05:00.840 --> 00:05:10.770 William Cheng: Right, so. So here's one of the memory management object. Right. It's a limitless right so you can go to the bottom by using by using this pointer. 31 00:05:11.250 --> 00:05:15.720 William Cheng: Yes, but but but but this point the only makes sense if it's a shadow object. 32 00:05:16.710 --> 00:05:31.680 William Cheng: Yes. Okay. So if it's not a shadow object, then it's the airy, then it's going to be a bottom object. Right. So if it's a bottom object. This, this one is a list of all the the VM is that 33 00:05:34.350 --> 00:05:37.290 William Cheng: I think that that's all the address spaces that 34 00:05:37.320 --> 00:05:38.490 Lalit Gupta: Are using this. Yes. 35 00:05:38.670 --> 00:05:41.310 William Cheng: That's sharing this and I'm memory management. Yes. 36 00:05:41.790 --> 00:05:50.460 Lalit Gupta: Yes, this is also yeah that's that's part I figured, but the thing is where you were. What's the use of this 37 00:05:51.510 --> 00:05:52.110 William Cheng: Yeah, so this 38 00:05:52.620 --> 00:05:56.340 William Cheng: Is things that the function per know and he 39 00:05:56.460 --> 00:05:58.200 William Cheng: He framed. I see. 40 00:06:02.250 --> 00:06:04.470 William Cheng: Mmm, O BM as right 41 00:06:05.850 --> 00:06:13.500 William Cheng: It's not here. Oh, okay. So let's look for it. And then, oh, the end as Colonel 42 00:06:18.060 --> 00:06:19.740 William Cheng: Did I spell it correctly. 43 00:06:21.480 --> 00:06:22.770 Lalit Gupta: Yes. 44 00:06:29.970 --> 00:06:32.640 Lalit Gupta: Oh, I know you want, you will find it either take 45 00:06:34.350 --> 00:06:41.700 Lalit Gupta: A macro yeah yes there is a macro to sing. Mm hmm or video underscore bottom underscore BMS 46 00:06:42.840 --> 00:06:43.920 William Cheng: All right. 47 00:06:48.540 --> 00:06:51.990 Lalit Gupta: Bill has defined macro in the same chemical be taught at 48 00:06:53.520 --> 00:06:54.180 Lalit Gupta: The very end. 49 00:06:55.980 --> 00:06:57.630 Lalit Gupta: Yeah, this is a macro last 50 00:07:01.380 --> 00:07:04.680 William Cheng: Okay, so let's do this. Oops. 51 00:07:14.250 --> 00:07:16.800 William Cheng: Okay, so it was NP Franca see 52 00:07:18.120 --> 00:07:21.060 William Cheng: We, as I remember in lecture I said I, you should read this function. 53 00:07:21.120 --> 00:07:28.770 William Cheng: Right, yeah. It tried to remove a keyframe remove a page rain from all the address spaces that are using this P for a 54 00:07:30.780 --> 00:07:36.030 Lalit Gupta: Do we need. Do we need to use the. Okay, I think, Okay, this part, I understand that there is a use here. 55 00:07:36.630 --> 00:07:39.690 Lalit Gupta: Do we need to worry about this VM as the 56 00:07:41.190 --> 00:07:42.120 Lalit Gupta: Anywhere else 57 00:07:43.470 --> 00:07:48.570 William Cheng: What so which means that when you build your address space, you know, for the bottom up there, you better added to this list. 58 00:07:48.750 --> 00:07:50.400 Lalit Gupta: Because otherwise. Yeah, yeah. 59 00:07:50.820 --> 00:08:04.440 Lalit Gupta: Yeah, we will. Like, oh yeah, that that's that's part of like okay to be like whenever we do it. We will do that has to be maintained. Like, do we have to worry about accept maintaining the list like any, any other thing about that. 60 00:08:05.190 --> 00:08:09.420 William Cheng: Well, so when you remove a page frame. This function will get called man. 61 00:08:11.010 --> 00:08:12.060 William Cheng: So I don't know. 62 00:08:12.630 --> 00:08:13.680 Lalit Gupta: What I thought, I thought 63 00:08:13.980 --> 00:08:18.330 Lalit Gupta: I thought this, this function is all only called at the by the page or demon 64 00:08:19.920 --> 00:08:24.150 William Cheng: Okay, no, look at this one. This is this is done in paper and clean. Right. 65 00:08:25.590 --> 00:08:25.950 Lalit Gupta: Yeah. 66 00:08:26.370 --> 00:08:31.620 William Cheng: If you try to hide it. Get rid of a page frame you know so so page ID man is the one that copy for him clean 67 00:08:32.640 --> 00:08:43.230 William Cheng: I don't know if other places that are calling people and clean anytime you want to get rid of the page frame you call this function and then when you get rid of a PageRank. You need a map it from all the all the program. They're using 68 00:08:47.430 --> 00:08:48.720 Lalit Gupta: Coke, I think. 69 00:08:50.040 --> 00:08:55.170 Lalit Gupta: We I thought we only use the same si P frame. 70 00:08:57.330 --> 00:08:58.290 William Cheng: I think before you copy 71 00:08:59.640 --> 00:09:00.600 William Cheng: Copy for and clean. 72 00:09:03.930 --> 00:09:05.970 Lalit Gupta: Oh, but the I 73 00:09:06.000 --> 00:09:06.240 Thought 74 00:09:07.410 --> 00:09:08.190 William Cheng: The idea here is that 75 00:09:08.520 --> 00:09:11.700 William Cheng: If it's, you know, you can't really free it until you clean it. 76 00:09:14.940 --> 00:09:19.350 Lalit Gupta: Oh, actually, yes. Now make sense. Okay. Okay. 77 00:09:29.880 --> 00:09:37.650 William Cheng: Yeah, over here, right in page a demon is if the patient is dirty. They are clean it and if it's, if it's not dirty, then you can free 78 00:09:41.310 --> 00:09:44.700 William Cheng: Right, if you look at this co write this code stay in the loop right you know 79 00:09:45.840 --> 00:09:53.520 William Cheng: So, so if a patient is dirty, they will clean it and next time you you loop around the cycle if it turns out it's you know it's clean and now you can free it 80 00:10:00.360 --> 00:10:01.020 Lalit Gupta: Yeah, but 81 00:10:05.850 --> 00:10:11.610 William Cheng: This code is a strange loop, right, it goes to this list, and they only look at the first element of the list. 82 00:10:12.300 --> 00:10:24.420 William Cheng: It's busy, you go to sleep at the dirty. Will you clean it. If it's not busy. If it's not, it's not dirty, it's dirty. Then you free, and then you go, they go on to the next, you know, page from on the list. 83 00:10:34.350 --> 00:10:44.520 Lalit Gupta: But in the in the from the comments of the lake anecdotes in there are some components in the antidote. See, and in n dot zero dot c in the workflow engine. 84 00:10:45.540 --> 00:10:47.790 Lalit Gupta: And it was saying, just to free the object. 85 00:10:50.250 --> 00:10:53.040 William Cheng: Hey, just a free all the industry. 86 00:10:53.940 --> 00:10:54.330 So, 87 00:10:55.410 --> 00:10:58.710 William Cheng: Yeah, but you gotta be careful. Right. I mean, you can't just free it 88 00:11:10.350 --> 00:11:15.240 William Cheng: I mean, sometimes they you know the the comment doesn't tell you everything that you have to do, right. 89 00:11:17.400 --> 00:11:22.560 Lalit Gupta: Yeah, I think you should underpin the page and can catch all the object and feed object itself. 90 00:11:22.980 --> 00:11:27.810 William Cheng: Yeah. So when you look. What does it mean to I'm cashing. I mean, did you clean it or something, I don't know. 91 00:11:29.460 --> 00:11:30.270 Lalit Gupta: Okay. 92 00:11:31.530 --> 00:11:39.750 William Cheng: Right because cash. That means that it's a copy from the desk or copy from the back end store. So if there are different law, then you should, you know, write it out to the desk. 93 00:11:41.400 --> 00:11:47.730 Lalit Gupta: Okay, so does that does the job of the page lies at the at the page or demon or should 94 00:11:49.320 --> 00:11:51.270 Lalit Gupta: We should our function should to fi 95 00:11:51.810 --> 00:11:52.230 Lalit Gupta: Clean up 96 00:11:52.590 --> 00:11:59.280 William Cheng: Your job to make sure the colonel is perfect, right. So, you know, you shouldn't be inconsistent. Right. 97 00:12:01.110 --> 00:12:03.330 Lalit Gupta: Yeah. So what is 98 00:12:06.060 --> 00:12:08.760 Lalit Gupta: You know, what's the job of the PR demon 99 00:12:10.410 --> 00:12:16.920 William Cheng: The page. So this is the cover page or the man. Right. Okay. Here's the page out the target is is not mad. 100 00:12:18.450 --> 00:12:23.400 William Cheng: Okay, it's not measure. So I think they want to maintain a certain number of page frame that's are available. 101 00:12:24.450 --> 00:12:35.010 William Cheng: Right. So, so what is this function right page out the mat. So the free pays frame count is greater than or equal to the number of free patient target. 102 00:12:36.660 --> 00:12:37.950 William Cheng: whatever that number is 103 00:12:40.020 --> 00:12:41.040 William Cheng: What is the target here. 104 00:12:43.710 --> 00:12:48.000 William Cheng: Is equal to zero, to start with. Okay, so at some point over here. 105 00:12:49.110 --> 00:12:58.500 William Cheng: It takes the number of free page rain and then you divide by two. So that will be the target. So they want to make sure that 50% of the patients are free. 106 00:13:00.060 --> 00:13:08.220 William Cheng: Right, if it's, you know, less than 50% of our free, then the target is not mad right and then what we'll do is we'll go through this list. 107 00:13:12.240 --> 00:13:15.600 William Cheng: Key right because this let's try this list is sorta 108 00:13:16.170 --> 00:13:17.280 William Cheng: You using are you 109 00:13:18.780 --> 00:13:24.810 William Cheng: Ready. So therefore, all the, you know, all the patron at the beginning of the list, they are you know now recently used 110 00:13:25.830 --> 00:13:29.850 William Cheng: So therefore, they will, you know, they'll go go go one after another. Try to freedom. 111 00:13:35.700 --> 00:13:36.360 Lalit Gupta: OK. 112 00:13:37.710 --> 00:13:43.740 William Cheng: So again, this is the toy happens is you know this is a toy operating system so they can implement in and really, you know, silly way. 113 00:13:47.580 --> 00:13:51.570 Lalit Gupta: Okay, so basically, to ensure that we have the page frame available. 114 00:13:55.290 --> 00:13:56.010 Lalit Gupta: Not three other 115 00:13:56.100 --> 00:13:58.650 William Cheng: They're always 50% of the page from our free 116 00:14:01.350 --> 00:14:03.990 Lalit Gupta: Okay, so this means we have to see the pages. 117 00:14:05.970 --> 00:14:13.680 William Cheng: Right so yeah so what it will do is that every time when you wake up the page on demand, it will try to stay in the loop to try to free 50% of the page rain. 118 00:14:15.600 --> 00:14:16.680 William Cheng: And then it will go to sleep again. 119 00:14:19.860 --> 00:14:24.480 Lalit Gupta: But it, it never it does it ever run like it. 120 00:14:25.440 --> 00:14:28.020 William Cheng: Or not when when when when it was created right 121 00:14:28.110 --> 00:14:31.320 William Cheng: When it was created a fallacy right here, right. This is where it falls. 122 00:14:32.490 --> 00:14:40.200 William Cheng: Yes. So the first time when it comes me all the patient and are free. So, therefore, you know, it's not going to go into the zip and blue and then it goes through 123 00:14:41.400 --> 00:14:46.830 William Cheng: Our page or the men only what we if you write code to wake it up, otherwise never we never wakes up. 124 00:14:47.970 --> 00:14:48.690 Lalit Gupta: It seems like 125 00:14:50.250 --> 00:14:52.200 Lalit Gupta: I think I did program somehow makes it up. 126 00:14:54.090 --> 00:14:56.370 William Cheng: Well that's at the end where you've had to turn off the machine, right. 127 00:14:56.850 --> 00:14:57.450 Lalit Gupta: Yes, yes. 128 00:14:57.720 --> 00:14:59.190 William Cheng: So if you're looking for and get 129 00:15:04.590 --> 00:15:10.110 William Cheng: By people and get the first comment blog to say that if you run out of paper and then you need to wake up the page out demons. Right. 130 00:15:12.990 --> 00:15:28.530 William Cheng: Yes, but people can get, you know, you try to try to see if the page is resident if it's not resume, you need to create a new one. When you try to create a new one. And if the buddy system says, I'm all out. Well, again, this is a toy operating system. So at that point, you wake up the page. 131 00:15:30.300 --> 00:15:34.320 William Cheng: I mean, the real ordinances and the page document is running in parallel with, you know, everything you're doing 132 00:15:35.820 --> 00:15:36.210 Okay. 133 00:15:39.480 --> 00:15:48.420 William Cheng: But, you know, since weenies. I don't think we ever run out of memory, unless you run, you know, Ford bomb for a very long time and you don't do the P for a migration. 134 00:15:49.200 --> 00:15:59.820 William Cheng: So in that case, I think eventually you know you'll be able to, you will run out of memory. And then it's up to you to, you know, in paper and gets you to, you know, wake up the page. 135 00:16:01.380 --> 00:16:01.650 William Cheng: So, 136 00:16:01.770 --> 00:16:02.040 Like 137 00:16:03.120 --> 00:16:07.200 Lalit Gupta: If we do we not pass it as if you're not happy you're given. 138 00:16:08.190 --> 00:16:16.020 William Cheng: Well, so. So again, I don't know. And then all these comments are written by Brian diversity. People are requirement is that, you know, if you 139 00:16:16.260 --> 00:16:20.520 William Cheng: If you write a line of code. You've got to demonstrate to the greater that this line of code is useful. 140 00:16:20.730 --> 00:16:30.450 William Cheng: So if you never run out of memory. And if you check if the, you know, if you run out of memory. And if you run out of memory that you wake up a page on demand. But if that case. Never happens while they are you going to lose points. 141 00:16:33.150 --> 00:16:33.900 Lalit Gupta: Okay, but 142 00:16:34.680 --> 00:16:40.020 William Cheng: You said you want to run out of memory when he can never our memory then then 143 00:16:40.050 --> 00:16:41.040 William Cheng: It's worth it. 144 00:16:41.250 --> 00:16:46.140 Lalit Gupta: Or do you only are saying that it will you will you will, we will run out of memory when you will do for bomb. 145 00:16:48.270 --> 00:16:54.720 William Cheng: I mean, you know, again, you need to be the grading guidelines. The winning guys, as you know, running for one minute. I mean, if you can't 146 00:16:55.830 --> 00:16:57.180 William Cheng: If you can't run on memory and what 147 00:17:01.260 --> 00:17:03.750 William Cheng: We need to test their code at this out what they have to do 148 00:17:05.250 --> 00:17:05.940 Lalit Gupta: Nice. 149 00:17:16.170 --> 00:17:22.650 Lalit Gupta: So if, if, if we if if this if this, everything is once 150 00:17:24.390 --> 00:17:25.380 Lalit Gupta: Once the process. 151 00:17:26.520 --> 00:17:39.060 Lalit Gupta: Is on the, on the, on the verge of exiting and it cleans all the pages and if if every process does that this means know every page will be free. At the time when we go back to this. 152 00:17:39.750 --> 00:17:48.000 Lalit Gupta: Idol. And then the event, the Paleo demon will wake up, it won't find anyone, any one single pitch fleet even any single page busy so it won't do anything right. 153 00:17:49.140 --> 00:17:54.720 William Cheng: Um, I don't know if there's anything that's cached inside the file system. 154 00:17:56.940 --> 00:17:59.940 William Cheng: There are things that are cash into the file system, then you know 155 00:18:00.000 --> 00:18:04.380 Lalit Gupta: Yeah, I remember there's a mount thing that has to be a painter probably 156 00:18:04.590 --> 00:18:07.830 William Cheng: Yeah. So, for example, I'm your, your BFS route. Right. 157 00:18:08.340 --> 00:18:10.830 William Cheng: PROBABLY PAID yeah I think 158 00:18:10.860 --> 00:18:13.770 Lalit Gupta: That's five X amount probably does kind of 159 00:18:13.800 --> 00:18:15.150 Lalit Gupta: Proposal in some page. 160 00:18:15.570 --> 00:18:21.360 William Cheng: Right, so I don't really know. You know, maybe they're still going to be paid for him that around. 161 00:18:25.050 --> 00:18:34.350 William Cheng: So, I mean, if you really want to find out right i mean you know you well first, first of all, you have to have a perfect implementation, you know, if you just perfect. And then when you get the idle. 162 00:18:35.400 --> 00:18:43.620 William Cheng: Idle proc Ron, what is how to shut down the machine, it will try to free all the page frame and then you look at all the patient that is trying to free and say, well, why is this page for I'm still hanging around. 163 00:18:44.250 --> 00:18:47.850 William Cheng: Is it, you know, if somebody is using it or something like that. And then, then you investigate 164 00:18:48.960 --> 00:18:49.920 William Cheng: But that's a lot of work. 165 00:18:50.550 --> 00:18:54.780 Lalit Gupta: Yeah, that's actually what I needed to discard a listing and I was like this. 166 00:18:55.650 --> 00:19:06.720 William Cheng: Yeah, but you know, since I didn't write the code for we news. I don't really know what their designs are all you know exactly how did you know what the design all these different parts. So I don't I don't know the answer. 167 00:19:09.510 --> 00:19:15.480 Lalit Gupta: But it makes sense right to 23232 pages. After cleaning, clean, clean the pages. 168 00:19:15.840 --> 00:19:16.650 Lalit Gupta: For the processor 169 00:19:16.830 --> 00:19:21.810 William Cheng: Except that except that there's always some caching going on that because you don't want to write to the desk all the time. 170 00:19:23.250 --> 00:19:29.910 William Cheng: Well guys, if there's some caching going on. That means that somebody, somebody holding a page frame and you know increment the reference count. So on some object. 171 00:19:30.780 --> 00:19:41.280 William Cheng: So there'll be some memory management object that has a reference town that's bigger than zero. So, in that case, you know, it's still holding on. I because the page frame doesn't have a reference calm my 172 00:19:41.310 --> 00:19:42.330 Lalit Gupta: Only the anonymity of 173 00:19:42.750 --> 00:19:48.690 William Cheng: Reference. So as long as you have memory management object hanging around was then it's possible. They still have page names. 174 00:19:50.940 --> 00:20:00.660 William Cheng: Because remember, our colonel colonel colonel three we have to deal with three kinds of memory management object. But there are other memory. Memory management Jagan said the is that we need something system. 175 00:20:01.320 --> 00:20:08.610 William Cheng: I think the one inside the there's some device driver. There's also a memory management object. We didn't write those but you know they're there. 176 00:20:13.440 --> 00:20:13.800 Lalit Gupta: Yeah. 177 00:20:22.290 --> 00:20:25.860 William Cheng: Yeah, I think the block device has a memory management object or something like that. 178 00:20:35.010 --> 00:20:36.930 Lalit Gupta: So if 179 00:20:38.340 --> 00:20:42.720 Lalit Gupta: So if you have a memory object and it manages some epic manager some pages, right. 180 00:20:43.320 --> 00:20:43.950 William Cheng: And so 181 00:20:44.310 --> 00:20:47.130 William Cheng: The memory. Memory management is managed page. Yeah, and 182 00:20:47.160 --> 00:20:52.650 Lalit Gupta: Every, every time it managers one page. We have to increase the reference reference count of the king. 183 00:20:52.920 --> 00:20:54.150 William Cheng: Of the objectives know 184 00:20:55.710 --> 00:20:57.450 William Cheng: What you 185 00:20:57.660 --> 00:20:59.760 Lalit Gupta: Because the patient will increase the reference count. 186 00:21:03.450 --> 00:21:11.580 William Cheng: Well, every time when you increase the Patreon, you increase the yeah i think the increment the reference calm and also you increment the number of Resident pages, right. 187 00:21:14.040 --> 00:21:16.770 Lalit Gupta: I talked to should be taken care of by the invitation. 188 00:21:19.980 --> 00:21:20.970 William Cheng: About what function. 189 00:21:21.930 --> 00:21:23.670 Lalit Gupta: The function which is already given to us. 190 00:21:26.550 --> 00:21:29.430 William Cheng: Yeah, so they're all these things at this is the reference count. 191 00:21:30.570 --> 00:21:31.080 Lalit Gupta: Yes. 192 00:21:31.170 --> 00:21:39.060 William Cheng: And then here's a number of resonant pages. And then there's number of Resident pages. And here's a list of all the resident page. Right. Yeah. 193 00:21:42.360 --> 00:21:45.990 Lalit Gupta: Yes. So, yes, yes. It keeps a list of all the pages, right. 194 00:21:50.160 --> 00:21:58.140 William Cheng: So, so for a. Yeah. So I guess the picture that I joined lecture right inside the shadow object I referenced a bunch of pace frames. Right. 195 00:22:00.000 --> 00:22:11.550 William Cheng: So yeah, so in that case you have to implement the reference count. And if you, you know, bringing a page frame, then you need to also increment the number of Resident pages. 196 00:22:13.530 --> 00:22:16.440 William Cheng: And we can also look for this, this thing to see who's using it right 197 00:22:20.460 --> 00:22:24.960 William Cheng: Okay, and it could go down one level down over here. There's nothing there. 198 00:22:26.220 --> 00:22:28.590 William Cheng: So the shadow demon. Look at this. 199 00:22:29.970 --> 00:22:36.600 William Cheng: Okay, so in P frame Darcy, there's this plus plus and minus minus right so we can actually look at that. 200 00:22:38.460 --> 00:22:45.330 William Cheng: So when you allocate a page frame you increment, you know, the reality, the page rank and here's the 201 00:22:46.710 --> 00:22:51.270 William Cheng: The memo VJ that owns this page rate. Right, so therefore you will increment the reference count. 202 00:22:52.320 --> 00:23:00.960 William Cheng: When you migrate it you also you'd recommend the reference count. And then when you. What is this, will you free at your document around Scott. Yeah. 203 00:23:12.180 --> 00:23:16.620 Lalit Gupta: Like I'm trying to think, when is when is it okay to free the page. 204 00:23:18.750 --> 00:23:20.760 William Cheng: One page, but nobody using 205 00:23:23.640 --> 00:23:31.770 Lalit Gupta: There's yeah then then we have do guy when you're nodding do for that is pretty easy to figure out, like where interfere page. 206 00:23:33.750 --> 00:23:36.930 William Cheng: Yeah, I think, you know, since the reference count. 207 00:23:39.330 --> 00:23:45.060 William Cheng: Why would you want to free a page frame. I mean, we go without the demo BJ. That's when you want to create a page name right. 208 00:23:46.440 --> 00:23:50.400 William Cheng: Otherwise, you gotta be very careful. You can't just free as if somebody says still using it and 209 00:23:53.070 --> 00:23:57.540 William Cheng: Right, because you know we're here, right here, here's the here's the list of page range right 210 00:23:59.430 --> 00:24:04.230 William Cheng: Okay, so if you for your page, rather than this list will become you know a memory corruption. 211 00:24:05.250 --> 00:24:18.780 Lalit Gupta: Oh, I think. Yes. I think there is a comment which which pitches that when the mmm mmm count equal to mm decision number of different pages, then, is ok to free the pages, does it 212 00:24:18.990 --> 00:24:20.550 William Cheng: Mean right yeah yeah 213 00:24:22.140 --> 00:24:26.430 Lalit Gupta: Yeah, I was like, thinking like Ben vendor equal, then we can actually see the pages. 214 00:24:27.480 --> 00:24:32.280 William Cheng: Right there are comments to say that, you know, I guess the the code that we just saw over here right over here says, you know, 215 00:24:32.910 --> 00:24:44.910 William Cheng: It needs to be equation like this. Right. Yes. Okay. Otherwise, you know, then, then, then you need to free your you need for it up. And when the whole region is freed up all the page frame that our resident. They also need to be freed up 216 00:24:48.360 --> 00:24:49.530 Lalit Gupta: Yeah, at the time. 217 00:24:51.600 --> 00:24:56.040 William Cheng: Yeah, so I don't really know if it's a good idea to directly copy frame free yourself. 218 00:24:57.960 --> 00:25:08.430 Lalit Gupta: But in the end, and put it seems like we have to in an input and shadow put because when when we are putting that we're actually integrating the reference 219 00:25:17.550 --> 00:25:18.240 Lalit Gupta: Yeah, this one. 220 00:25:23.340 --> 00:25:38.070 William Cheng: Yes, he over here. Is that right, he says you should on pen and on cash all of the objects pages, right. So that means that you are getting rid of the the you're getting rid of the LBJ when you grow mo BJ then you try to, you know, free of all the patient. 221 00:25:39.210 --> 00:25:39.900 Lalit Gupta: Yeah, this is the 222 00:25:41.460 --> 00:25:47.610 Lalit Gupta: Same thing then counter logical, we can actually free all the in the in the in the industry engine itself. 223 00:25:47.670 --> 00:25:57.180 William Cheng: Right, if the ref count is going to be once you've documented is going to be equal to the number of residents ages. That means nobody else is using all these page rain so therefore you should free up all the space race. 224 00:25:58.740 --> 00:25:59.580 Yes. 225 00:26:02.160 --> 00:26:07.170 William Cheng: Right. But, but, again, you got to make sure that all those patients that are not busy very hot kind of stuff. 226 00:26:07.350 --> 00:26:13.380 Lalit Gupta: Yeah, to do the one thing that the lake Lake Lake Lake fishing, my mind is like at the paint thing like 227 00:26:14.430 --> 00:26:18.090 Lalit Gupta: Like I'm printing the pages and at the end like this. 228 00:26:19.650 --> 00:26:25.350 Lalit Gupta: Function, I think, a piece of them shut down and it found some pages. 229 00:26:25.650 --> 00:26:30.090 Lalit Gupta: Then I'm trying to figure out, like where are these pages. 230 00:26:31.260 --> 00:26:33.360 Lalit Gupta: What are those pages that are not like print 231 00:26:33.600 --> 00:26:41.220 William Cheng: Right, but all the pastry and they're all owned by an emo VJ so. So the question is, why is the MO VJ still alive. 232 00:26:49.020 --> 00:26:50.760 Lalit Gupta: Yeah, something 233 00:26:52.020 --> 00:26:53.190 William Cheng: Liberalism liberalism. 234 00:26:54.510 --> 00:26:58.140 Lalit Gupta: Yeah, that's the thing. Yeah, yeah, the shadow shadow is actually 235 00:26:59.970 --> 00:27:09.870 Lalit Gupta: pointing to something. And there's a linked list and and I wish I'd object I can have some pages and you have to be like in the sequence all the pages. 236 00:27:10.590 --> 00:27:11.220 William Cheng: Right, yeah. 237 00:27:12.390 --> 00:27:16.170 William Cheng: Yeah, feel free in the wrong way and no memory corruption. So you got to be very careful. 238 00:27:16.920 --> 00:27:17.460 Yes. 239 00:27:18.720 --> 00:27:23.250 Lalit Gupta: But now actually thinking like, since you said like maybe there will be no 240 00:27:24.960 --> 00:27:29.430 Lalit Gupta: Memory problem, we can actually not in the page and 241 00:27:31.410 --> 00:27:39.090 William Cheng: What if you're not in the page. Then, then you know the page, it might get confused. So, you know, you gotta be careful. There's no backing store. 242 00:27:40.200 --> 00:27:40.770 Lalit Gupta: Yeah. 243 00:27:42.090 --> 00:27:48.630 Lalit Gupta: Actually, I tried that they're not turning the pages and it actually worked. But I feel like someone 244 00:27:48.870 --> 00:27:49.230 Lalit Gupta: With them. 245 00:27:49.290 --> 00:27:53.430 William Cheng: I think because what happened is that, you know, so what they would do they would call it clean page over here. 246 00:27:54.210 --> 00:27:59.790 William Cheng: Okay, you just need to make sure that you know you do the right things, then nothing bad's gonna happen. 247 00:28:01.050 --> 00:28:05.910 William Cheng: Yes. I mean, they're supposed to go to the swap, but we need to have any swap so so 248 00:28:07.950 --> 00:28:19.770 Lalit Gupta: Yes, if it doesn't have stopped it, then it means like seems like it's okay to like it's technically wrong, but it seems like nothing can go like 249 00:28:21.270 --> 00:28:22.890 Lalit Gupta: Nothing will break what 250 00:28:22.950 --> 00:28:34.440 William Cheng: Nothing will break because he never bring it back. Right. You try to clean a page, you try to write it to the death. And then you free up this page right later on when you need it. What do you get a background has no way to get it back. 251 00:28:35.670 --> 00:28:35.910 William Cheng: But 252 00:28:36.150 --> 00:28:38.430 Lalit Gupta: We never stop slapping this Phoenix. 253 00:28:39.360 --> 00:28:43.260 William Cheng: Right, yeah. That's why words because we never tried to get it back. 254 00:28:43.710 --> 00:28:49.050 Lalit Gupta: Yeah, that's what I'm saying it's it works, but it's not actually right. 255 00:28:50.430 --> 00:28:53.130 William Cheng: Yeah, because we know certain things, not going to happen. So therefore worse. 256 00:28:53.490 --> 00:28:53.910 Yeah. 257 00:28:55.620 --> 00:28:57.090 Lalit Gupta: Yeah, but I feel like it's 258 00:28:58.440 --> 00:28:58.890 Lalit Gupta: Good. 259 00:29:00.690 --> 00:29:01.200 William Cheng: Wasn't it 260 00:29:02.400 --> 00:29:09.030 William Cheng: you pin it, they won't give accidentally swap out. So therefore, we try to bring it back. You know it's there already. So 261 00:29:10.590 --> 00:29:12.000 William Cheng: You know, so everything still works. 262 00:29:14.850 --> 00:29:15.090 You 263 00:29:18.330 --> 00:29:21.930 William Cheng: Know, so they're getting away with it because it's a toy toy operating system. 264 00:29:28.440 --> 00:29:28.980 Lalit Gupta: And 265 00:29:30.780 --> 00:29:32.880 Lalit Gupta: I think it is a very small 266 00:29:34.110 --> 00:29:49.290 Lalit Gupta: minor thing. It's not even. So why we so in the in the in the do for comment there is saying it is saying, we'd have to do PT and map range. And then we have to flush all by visiting flush all when we're only on mapping the range of area. 267 00:29:51.210 --> 00:29:54.870 William Cheng: What will you a map something. What is it inside the transition to the side buffer. 268 00:29:57.000 --> 00:30:03.570 William Cheng: I mean those page table entries. Is that a transitional does that buffer, then, you know, then the interview is going to do the wrong thing. 269 00:30:04.770 --> 00:30:05.370 Lalit Gupta: Can you just 270 00:30:06.450 --> 00:30:08.910 Lalit Gupta: Flush the only dot required part 271 00:30:09.810 --> 00:30:11.610 William Cheng: Well, there are too many entries you're modifying 272 00:30:12.510 --> 00:30:12.990 Lalit Gupta: Okay. 273 00:30:13.170 --> 00:30:14.910 William Cheng: It's much easier just yeah just 274 00:30:16.290 --> 00:30:16.500 Yeah. 275 00:30:21.090 --> 00:30:31.680 William Cheng: I mean, our program is very small. So, only a few entries are modified, but in the real program, then, you know, then, then you don't want to go on map every entry on cash you know so so invalidate every 276 00:30:32.280 --> 00:30:37.410 William Cheng: Every entry inside the translation look us up afterwards. It's easier just to flush the entire table. 277 00:30:41.970 --> 00:30:42.210 Lalit Gupta: Oh, 278 00:30:49.410 --> 00:30:49.920 OK. 279 00:30:55.770 --> 00:30:56.040 Lalit Gupta: OK. Okay. 280 00:30:57.450 --> 00:30:59.580 Lalit Gupta: I'll try to work on it and I think 281 00:31:00.480 --> 00:31:06.540 William Cheng: Okay, thank you. That's it. Yes. All right. Since nobody else is here, I'm just going to shut it down. Okay. 282 00:31:07.710 --> 00:31:09.960 William Cheng: All right. Bye bye.