So, yes, I'm going to be talking about context switching in PowerPC Linux. Thanks very much for not going to Rusty's talk. So, what we're going to be talking about today, we're going to start off with a quick overview of what PowerPC is, and then a little bit of an overview of the architecture, mostly relating to context switching. Then talk about what we do with context switching currently in Linux on PowerPC, what we've done to change it, the new version, and then some of the results and some to-dos of what we could do in the future. So, PowerPC, what is it?  In the middle there is the, as IBM affectionately calls it, the 795, which is a very large 1024 thread machine with up to eight terabytes of memory. Very nice machine to play on. You can partition this up to lots of little machines, or you can have one great big Linux instance running on 1,024 threads. We also go down to very small machines. You can have a little fork or blade if you want, and these are all 64-bit PowerPC machines. Another PowerPC machine is the BlueJean range of supercomputers. These guys have dominated the top 500 supercomputer list for the last few years. They're not on top at the moment, but they have done very well in the last few years. These are based on 32-bit PowerPC machines or PowerPC cores. PowerPC is also used in embedded. The TVO uses a PowerPC. And obviously we completely own the game's market. So, the PlayStation has a cell processor, which is a 64-bit PowerPC processor, with two threads with eight vector processing units attached to it, closely coupled to the CPU. The Xbox 360 is a 64-bit PowerPC 3-core, and the Wii is also a 32-bit PowerPC box. Of course, the big pink elephant in the room is these guys. The big pink elephant is hiding apparently. Apologize, mate. There we go. There's the big pink elephant finally, mate. So Apple was running PowerPC, but obviously they're not now. So PowerPC architecture, just going to give you a quick overview of what it means in relation to context switching. PowerPC is very simple risk architecture. We have 32-64-bit general-purpose registers. These GPRs are used on almost every instruction by every task in the system. And they're always context-switched in and out.  So we have some floating-point registers. We have 32-64-bit registers. So that's about 256 bytes worth of data, a couple of cache lines in PowerPC. We also have some vector registers, ulti-vec registers. There's another 32, but these are 128-bits wide. These are similar to MMX or SSE on Intel processor. And on Power7 we added the vector scalar registers, the VSX registers, which is 64 128-bit registers. So we're talking here about another 1,024 bytes worth of extended state that would need to be context-switched for every task. It actually turns out the VSX overlaps with the floating-point and ulti-vec registers. So there's not additional state on top of FP and ulti-vec. It overlaps. We also have miscellaneous control and status registers to say if you divide two floating-point numbers, whether the result is a zero or not a number or infinity or whatever. And we also have, from an operating system's perspective, we can turn off these individual parts of the CPU. So you can say turn off floating-point. So if a user space program tries to run floating-point instructions, it will trap into the kernel, and the kernel can decide what it wants to do, whether it can restore, whether it can let that user space program run that or not. And we have that for FP, ulti-vec, and for VSX. And these are quite important, which I'll talk about soon. So, context-switching. What do we currently do? So just a quick little computer science operating system 101. What am I talking about? Slide. If you're running two tasks on a system, Linux will switch between them. If you've got task A and task B, we'll switch between them many times a second to make it look like they're both running it exactly at the same time. And that's context-switching. In reality, it looks a little bit more like this, where we have A running. It ends its time slice. Then the kernel preempts A at the end of its time slice and goes, I'll save away its state into memory. Then it calls into the scheduler. The scheduler says, I want to run task B. So it gets task B, state from memory, pulls that into the CPU, and then starts to take task B. Task B then runs for its time slice and kernel preempts it, and we wash, rinse, repeat over onto A and then B. So at the moment, we do lazy floating point restore. Now, I'm going to talk about floating point for the most of the rest of this talk. I will, at the end, talk about Altivec and VSX and how that differs, but for the majority of the talk, I'm going to be talking about floating point. So for floating point, we always save. At the end of a time slice, we always save. We always save the floating point state, but we restore on demand. So what does that mean? Well, the kernel decides it wants to run A, and A starts with the floating point unit off. And A, in this diagram, we have A as a floating point intensive task and B as a non-floating point intensive task. So A runs along with the floating point unit off. Then it wants to run a floating point instruction, but because the floating point unit is off, it traps into the kernel and the kernel goes, ah, okay, you want to run floating point. I'll restore your state from memory into the floating point unit and then turn the floating point unit on and continue on. And then A can continue on rerunning that instruction until it ends its time slice. Then at the end of the time slice, the kernel goes, I better save away that state. It knows that A used the floating point unit, so it saves away that state always. And then, again, calls into the scheduler, scheduler decides it wants to run B, and we restore B, but here we restore B with the floating point unit off. And this is great. This means that with this mechanism, if A and B are not floating point tasks, then we never have to actually save and restore the floating point state. And it's on a per-time slice basis. Just extending that a little bit longer, you can see that we have the original A and then B, and then A runs again. We have to then go and trap again. So every time the A starts its time slice, we have to trap into the kernel to restore our state. This just elaborates that a little bit more. We split this out into the CPU task at the top and the floating point unit task at the bottom. Sorry, it's dropped off the edge of the screen there. That's floating point unit task on the left-hand side there. It shows up OK here, so sorry about that. The CPU task at the top, floating point task at the bottom, you can see that the floating point task initially isn't really, the floating point isn't really associated with anything. And then when A runs that first floating point instruction, the floating point unit gets restored with A state. Then when B runs, before B runs, that floating point state gets flushed out to memory, so the floating point unit again has no state associated with it. You can see while B is running, there's no floating point state up until A traps again on a second time. So currently there's three possible places where our state could be. If our task is for a particular task, if a task is not running, we always save away its state at the end of its time slice, so it's always in memory. If it is running, the floating point state can be in the floating point unit if we have used floating point in this time slice where it could still be lazily out in memory. And I'm going to expand on this as we go to, as it gets more complicated, as it gets more complex. So what do we do this new? So we were restoring on demand and we've kept that, but what we're going to do is save on demand as well, rather than saving at the end of the time slice. And we're going to try and reuse the floating point state if possible. So what does this mean? So again we have A and B, A is floating point intensive and B is non-floating point intensive. You can see A is running at the start with the floating point unit off. The floating point unit owns the A task, or is associated with the A task. Then the kernel starts task B and it knows that, well, it's not going to use the floating point unit, so it comes with the floating point unit off, doesn't change the floating point unit task. You can see my FPU now, that's great. And it doesn't change the FPU task. So when A starts running again, it knows that the floating point state is already there and it can just start A with the floating point unit on and not have to bother restoring that state, restoring that 256 bytes. So this is great. If C comes along and C is a floating point intensive task, we still need to go and save and restore, obviously. So you can see here C comes in with the floating point unit off. The floating point unit is associated with task A, then when C traps into the kernel, the floating point unit changes over to C, as the kernel saves and restores A, restores C, and then C can run with the floating point unit off. So we still have to take this trap if we're running two floating point intensive tasks. Going back to the possible places where our state could be now, if a task is not running, we now have an extra state where the floating point state could possibly be still in a floating point unit somewhere. It may have been lazily saved away. It could also be in memory, and again, if it was running, it could be in the floating point unit or in memory, but that's the same as before. So this is all very simple. This is great. Hopefully we've saved some time. But we're missing a big piece here. The big piece is SMP, multiprocessor. What happens if we start migrating tasks from one CPU to another? What do we mean by this? So now we have CPU0 or PU0, apparently. PU0 at the top and CPU1 at the bottom, not floating point unit at the bottom. CPU0 starts off running task A and then switches to some other task. Doesn't matter what it is. Then CPU1 comes along running some another task, and it wants to switch over to A. But possibly we have our floating point state still on CPU0. So we've now put the floating point units back in again. We've got CPU0 and floating point unit zero at the top and CPU1 and floating point unit one at the bottom. So somehow CPU1 has to get its state from CPU1. Sorry, CPU1 has to get it from CPU0. Just going back to where our floating point state could be for a particular task. The top is the same if we're not running. It's either in an FPU or in memory. If we are running, we have an additional state. It could be on our current FPU if we've used floating point in this time slice. Or it could be on somebody else's floating point unit. It could be on a different CPU's floating point unit. So we've now got five possible places where our floating point state could be. So how do we do this CPU migration? So CPU1 at the bottom decides it wants to run A. It goes and IPIs over the CPU1 or inter-processor interrupt and says to CPU1, please go and dump that state that you have. So whatever task is running on CPU0 stops, gets preempted. And the kernel goes and takes the state that it has in the floating point unit and dumps it out to memory. It then communicates back to CPU1 to say, that's all done, you can start A up now. So that's great. The problem here is the kernel on CPU1 is just sitting around waiting for CPU0 to do this. And this could possibly take a long time and it's just kernel overhead. We really prefer not to do that. This is kind of a slow case CPU migration, but let's try and make it faster. So what we decided to do was start the IPI early, but then only wait for the results to come back when we need to. And essentially we're reusing our lazy restore here. So this is the same again. CPU1 goes and IPIs CPU0, but instead of waiting in the kernel, it now just starts task A straight away. But it starts it with the floating point unit off because it knows that it doesn't have the state there yet. CPU1 goes and dumps the state as we saw in the last or a couple of slides back, then returns back to CPU1 to tell it that the state is there. And fortunately in this case, it does it before A runs its first floating point task, a floating point instruction. Then A does run its first floating point instruction, it traps, the kernel goes, it's cool, my state's in memory ready to go, it's not on somebody else's CPU, I'll just restore A and away we go with the floating point unit on. So this is the fast case. This is good. But CPU0 could take a long time. So this is exactly the same diagram as the last one, except we've just changed the timing slightly. So here CPU1, IPI, CPU0, but CPU0 takes a long time for whatever reason. It could be running with interrupts off it doesn't receive the IPI for a while, it could have been sleeping, whatever. So it takes a long time to dump that state out. And task A runs a floating point instruction very early. So it actually runs it before the state is returned. So we now have to actually wait in the kernel. Now traditionally these floating point traps have been taken in a hand-coded assembler and they're taken with interrupts off. Now waiting, as we're waiting here with interrupts off is generally a very bad thing to do in the kernel. It's a nice recipe for deadlocks if you don't have any timeouts. So what do we do? We firstly check in the kernel to see if the state is there with interrupts off. If it's there, great, it came back in time, we can just restore A into the floating point unit. If it's not there, we have to turn interrupts on. So we turn interrupts on and we sit there and wait for the state to arrive. When it does arrive, when it eventually arrives, we turn interrupts back off again and we check to make sure that we didn't pick up somebody else's state. We may have imprimed it off to somewhere else and may have potentially picked up somebody else's floating point state. So we need to dump that before we restore A back. So how do we implement this? We've got two new pointers. The first pointer is a per CPU pointer. If you want to use the floating point unit associated with this CPU, you need to know, you need to be able to dump out the state in this current CPU. So this pointer will tell you whose state you currently own so that you can dump it. We've also created a per task pointer. If you want to context switch in a task, you need to know where to get it from, which CPU is it on. So this will tell you which CPU your state is on or if it's in memory. I promised I'd mention Ultebeck. Ultebeck is exactly the same. Wash, rinse, repeat. The control logic around it is identical. The actual save and restore instructions are different because they're different registers. But other than that, it's all pretty much the same. VSX, I said VSX actually overlaps with the floating point and Ultebeck state. In actual fact, there's no additional state that VSX provides over Ultebeck. We've got a question up here. Maybe you'll get to this, but can you actually prove that this is more efficient than just saving the state when you're doing SMP and extra things like the FPU and Ultebeck are in use? Well, I'm going to talk about some results later on, so maybe I'll answer that then. So we also have the additional case that if we know that FPU and Ultebeck can be reused, in that nice case where we have A is a VSX intensive task and B is not, we know that if FPU and Ultebeck can both be reused, then VSX can be reused as well, and we don't need to save and restore that. A few other issues. We have emerged 32 and 64 bit kernel. I mentioned that these floating point traps are all hand-coded assembler, so actually getting them to work with 32 and 64 bit with different MMUs and these run with the MMU on and off, making sure that all worked was somewhat not trivial, and thank you, Ben, for helping. Power save. There's a couple of issues here. One is if you're going to go into power save, you want to get rid of any possible state that you have so that you don't get working up later on to have to go and dump that. So that's one reason why. Before you go into power save, you want to flush your state that you have. The second reason is on bare metal systems, you may power down this package completely or power down the core, and the state may be corrupted, so you really need to dump it in that case. Hot plug CPU, very similar to power save. You need to make sure that if the CPU is going to leave the system that you've dumped the state already, otherwise it's not going to be accessible anymore. Different comping options. This was a fairly minor issue. There's about six or seven patches in this series, but making sure that they're all compiled with, especially in 32-bit LAN, where they actually care about having these different options of S&P, FPU, UltiBeck, VSX, making sure that the entire patch series was bisectable with all these different comping options, whereas again, non-trivial. Signals and P-trace. Because we've now got these additional places where our state can be, if someone's P-tracing you and wants to know your FPU state, you need to make sure that that's dumped out to memory. P-tracing signals will read it from memory. They won't directly go and read it from the floating point unit. So you need to make sure that they're dumped out before you actually go and read it. The same when you're generating a signal, a signal context for a process. You need to make sure it's dumped. So to hopefully answer your question a little bit, this is the patch series. This is the complete patches. So it's actually not that invasive. If you look at the, it's mostly in PowerPC, and you look at the bottom line here, 635 insertions and 315 dilation. So we're only adding about 320 lines of code. And I did a quick little poll here, or had a quick look at the patches the other day, and about 150 lines of that is documentation. I probably removed a little documentation too, but it's not a horribly invasive patch series. It does add some complexity, but we're pretty smart in PowerPC land. Well, at least we think we are. So testing, what did I do to test this? I actually coded up the UltiVec version first because UltiVec isn't used nearly as much as Floating Point, and this was easier to get a system booting and running so I could run tests. Once UltiVec was somewhat stable, I started looking at implementing the Floating Point version. Once I'd done that, just booting a distro kernel. Because Glib-C, especially in 64-bit, will use VSX in its mem copy, you'll notice pretty quickly if you start corrupting state. So just booting a distro up to user space with all its demons was a reasonable test at that point. Then I started looking at a custom Floating Point test. I don't care what the computation is at this point. I just care that I'm not corrupting the state in user space. It is, to kind of come back to what you were saying, it is reasonably complex, and if you screw up, the consequences are quite bad. You corrupt user space state, and that's a really, really bad thing to do. So with this test, I was trying to make sure that we're not corrupting state at all. So it was a very simple test here. The midi bit's in the middle. A equals B equals some constant value, and then we just check to make sure that it's always the same. We just sit there and spin on that, and if it ever pops out into that printf, then we know that we've corrupted our state. A couple of interesting things to note about this test. If you just have while A equals equals B without the B equals C and A and B are non-volatile, GCC just compiles that out to a branch to self. If you make A or B non-volatile, it won't compile it out, but when you do the printf, A and B will be reloaded from memory to values that was actually corrupted. So having the combination that we've got up there where C is a volatile and we reload, you still get to see the corrupted state, but you don't get GCC getting in your way. So some results. So I started off just writing a very simple benchmark. Again, I don't care about what the actual fp or floating point computation is. I just care that more time is allocated to user space than to the kernel. The kernel overhead is reduced. So all I did was write a simple test that started at zero and counted up to a maximum and see how long it takes. So if I do this, no performance improvement. But there was no regressions either, so that's good. But why is that? So we go back to our original diagram. It looked like this. And you see A, then a bit of kernel, then B, then a bit of kernel, then A. Unfortunately, it doesn't really look like this. It actually looks a lot more like this, which A, and then a tink-tink-tink-tink-tink-tink-tink little bit of kernel, and then B, and then a tink-tink-tink-tink-tink-tink-tink-tink bit of kernel. And actually, if you run just two processes on PowerPC without, we don't do any operating system calls, you end up only getting about 40 or 50 context switches per second. So the kernel really doesn't contribute much in this test. So I thought about how are we going to try and exaggerate this kernel, this kernel aspect. So I started talking to Anton. Anton Benchard has a little context-switching micro-benchmark. You can find there. It seems to be loosely based on BW pipe in LM bench. And this is the core of the test. Create two pipes. We fork. One side goes off to one while loop, which does a read-write. And the other side goes off to a write-read, which looks like that. Task A, Task B, A to the right, B reads it. Two closely coupled tasks. So hopefully, what was looking like that with these tiny little bits of kernel will look more like that. We have these gigantic bits of kernel. When I do run this test, oh, sorry, I forgot to mention that when we run this test, we bind it to the same CPU. So it's on the same CPU. So we do get they don't end up on different CPUs. If we do this, we get about 40,000 to 50,000 context switches per second. So a lot more kernel overhead. So if we do this, what happens? No forms of proofing. But no regressions again. But we've completely forgotten about floating point. So what happens if we stick a little bit of floating point inside A and B we leave without any floating point? So we get this nice, hopefully, get this nice state that we saw before where A just owns the floating point unit, and we never have to actually context switch those 256 bytes. If we do that, what happens? We get a 4% improvement in context switching rates with floating point. With Ulteavec, we can get another 4%. And with VSX, we can get 8%. And it doesn't seem like much, but user space will get this free. They don't have to do anything. And we're just reducing kernel overhead, which is always a good thing. Or generally a good thing, sorry. If we put floating point in both sides, sorry, did you want to? If we put floating point in both sides, what happens? So in this case, we're still going to take the trap, and we still have to save and restore. What happens? No performance improvements, but no regressions either. LM Bench, I decided I would actually run an industry standard benchmark. LM Bench does some operating system level, quite a few operating system level tests. No regressions with LM Bench. No significant performance improvements either, though. So I promised a bit of a to-do. Signals and Petrace, I'd like to do more testing in Signals and Petrace. I haven't done a lot of testing in that area yet. And it has generally been a very bug-rich environment in PowerPC. More benchmarking? I always do more benchmarking. Lazy allocation of space. This is actually some more coding we could do inside PowerPC. For VSX specifically, we have 1,024 bytes of data that's allocated for every task, even if it's not using VSX, it always gets statically allocated. So if you say have 1,000 tasks, 1,000 times 1,000 is 1 megabyte of kernel data or kernel memory. So that's somewhat significant. Unfortunately, because G-Lib C uses mem copy or uses VSX in mem copy, probably going to be allocated for almost every task anyway. So this may not actually help at all in reality. The other one that might be of more use, and I think this might be somewhat what you were alluding to, we could just auto restore. So if we think that this task is going to use floating point, instead of doing it lazily, we could just do it as we do the context switch. This would, we'd still have to actually do the copy of that 1,024 bytes or about four cache lines. But we would be able to avoid the trap. The trap shouldn't cost us too much on PowerPC, but it will cost us something. So this could potentially buy something, but it's on my to-do list. And that's it. So thanks very much. We got some time for questions. We do. Yeah, me again. So this kind of sounds like a solution looking for a problem. Like what was your use case that made you say, oh, we need this or I mean, and I work with embedded. So for me it would be like, well, we can get a smaller kernel footprint or something in memory, which probably isn't the case because I think you've added about 150 lines of complexity to your kernel port, which isn't always good. But what about power saving? So when you turn the FPU off or something, can you like power it down or something to save power? And in which case and maybe, you know, there is a case for just always saving the state out and always powering it down. And can you, another kind of question is, yeah, at what point does the use of FPU and extra state make it worthwhile interrupting the other processor to get it there when you've left it there in that case? I'd just curious if you're going to look at those things. I think we've got three questions. Yeah. My motivation was probably somewhat disappointing. I coded up the VSX side being part of the IBM team during power seven. I coded up the VSX side and started to get familiar with this code and thought this kind of seemed like a cool idea. So let's give it a go. Yeah, so Ben's just pointing out that we actually used, the thing I didn't mention here is the lazy save and restore, we used, we did actually do when we didn't have SMP enabled. And in actual fact, I think that made the code more complicated because there was a lot of if depths in there. This actually cleaned up a lot of that part because the embedded guys actually care about this. They actually care about compiling with NUP. So my main motivation at the start was this is kind of cool. One of the things I probably should have done is run that benchmark with the A and B, the closest couple, and see where it was in perf. And it turns out to be about the fifth or sixth item at about 4%. So probably should have done that first, but maybe I'm not as smart as us power PC guys think we are. Power saving, if we turn the FPU off. I guess there's potential there. I'd have to talk to some of our hardware designers whether that is in reality, if you're talking in a multi-threaded core, you've got other threads, like at least on power seven, we have four threads per core. You're just turning it off on one thread. So you'd have to somewhat coordinate with the other threads. Or you'd hope that the other threads would turn off their floating point units as well from an architectural perspective because they're behind the scenes. They're actually sharing the same FPU. So I guess there is a potential that they could do some power saving there, but. Go a little bit careful as well, is on those processors, the architectural state of the FPU is preserved when it's turned off. So we have something in the architecture for embedded. I don't know if we kept it or kicked it out. I don't remember, Paul might. We had some wording in there that said that some embedded processor were allowed to trash the FPU state when the FPU was turned off. I don't think that was ever implemented actually in power. But yes, if that was coming back, especially for the embedded field, we would have to make that some, an optional thing at runtime. But we could potentially turn off the ALUs inside the FPU unit, but keep the register files. Because that's what we really care about. And your last question has escaped me. Sorry. Who came to you and said, oh, we're noticing a lot of context kind of. Well, we have, Switch over here then. We have had some customers who've been trying to optimize these loops a bit. So it has had some attention in the past. But so it was partly that as well. The G-Lib C guys, I think Peter Bergner was talking a little bit, was talking about, he's one of the G-Lib C guys inside IBM that does PowerPC. He was also wanting to see some performance improvements. And we had a bit of a discussion on the list about, on our external list about it. So there was some push other than just my, this seems like a cool thing to code up. Concept, I think Ben wants to. Ben is the PowerPC maintainer by the way, so. Keep in mind that we thought that we actually have to save and restore on every context. Switch one K of state, which can be quite significant latency considering the speed of CPU versus the memory on the caches nowadays. So also by the time you can take switch, your cache for that state has probably been pushed out. And so you're going to take cache misses. With 1024, you've got four cache lines plus. You've got the FP at miscellaneous state plus the VSX. So you've got probably six cache lines. So that means that essentially on SMP, you will always have that cost. Even if your task is not migrating or is not being switching with somewhat another task. So it does, the ability to, the main point is to be able to maintain the state over multiple contexts, which are the same task if no other task goes in between. And the corollary to that is to be able to do that in SMP, you then need to bring the whole shebang with the interrupt and everything. But we don't necessarily care about the migration case, because it's a rare case. We just want to enable the non-migration case. But we had to solve the SMP problem to be able to do that. This, there was a talk here last year by some guys in IBM LTC in India who talked about optimizing the scheduler for trying to place tasks based on what resources were shared. And they were looking at caches. So you tried to get, try and split apart cache intensive or memory intensive tasks. And I think you could possibly do a similar thing with this where you could try and split apart FPU intensive tasks or keep them on different CPUs so that you could try to get more of this good case that we have. Did you try benchmarking the ideal case where you've got a single task FPU intensive on a single CPU with affinity set? Like you're ideal, high, I want to run a floating point monster, but it's my machine, that's all I'm doing. Because of context which save. Well, that was what the first benchmark that I ran. Didn't you have four processors but you still have the context switch with another processing? So the diagram and what I actually did was a little bit misaligned there. The test that I ran was actually a single processor but I did run it with one and with two. But again, there was no performance improvement. But that's just because you don't get many context switches with one process. So I'm curious, you said that G-Lib C in the use of the VSX stuff or everything, so that means you don't get them. Not everything, a user for mem copy. Okay, so. 64-bit will use mem copy. But that means that every context switch will have to save state on VSX. Would there be a win like if you don't need testing to stop G-Lib C doing that or does it get more of a win by using that? So this is just a per time slice issue. So if you're not calling mem copy, then the G-Lib C's mem copy in this time slice then you won't use VSX. So yeah, so it won't have to be swapped in. Yep, kernel threads as well. Because when the context switch is out we don't know what else is gonna come in. We had to save the state regardless even if what's coming behind is a kernel thread. And for example, with heavy network benchmark you can have quite a lot of software QD coming in and stuff like that. And those don't actually have any HP state. And so that limits the impact that they have on the underlying floating point task as well. Yeah, we've hardly used the floating point inside the kernel. I think David, I have a question. Did you gather metrics? Did I gather metrics on how often I wanted, how often this worked? In my ideal case, almost every time. It was, it actually did work. That case back where I talked about the slow IPI where we had to actually go and wait, we had to actually wait for the data to come back from CPU zero. That was actually quite rare that we had to actually wait in CPU one for that data to come back. Even on a heavily loaded system and bouncing it around. So I did actually figure to mention with that architected state test I ran a number of those in my testing and I bounced them around the machines to make sure that it actually was doing what I hoped it wasn't corrupting as it was bouncing around. It wasn't that often that we hit these really slow cases. I think we actually, in the kernel, we send the IPI very early and it takes us a while to actually get back to A even with the floating point unit off. So there's actually quite a bit of time there for that IPI to go away. I guess it would depend also on what drivers you're running and when that guy accused off and stuff like that. So it would depend a little bit on what workload is and if I maybe didn't hit that one then that would be a problem. But the lazy case worked. If I had A and B, this tightly coupled, it hit it almost every time. I could see in perf context switching and my little stats that had was pretty much one for one for the number of context switches, for the number of lazy context switches. So if your kernel was off, how to say why didn't give you a performance improvement? Why? Why? Because you're talking about the 4%. The whole thing? Because I don't think in reality it's that much overhead compared to the rest of the kernel. I think the scheduler, looking at the perf, looking at the perf outputs, there's a lot of other things. And I had to actually disable some things that the distros have like auditing and there was a couple of other things to even get that 4%. So that's, do we just keep that between you and me? So yeah, it's just not, it isn't actually a huge part. It's kind of cool. Yeah. Any questions? We do have time for another question or two. Could you all put your hands together for our speaker? Thank you.


Hello friends, I am Nawal Emul working as an assistant professor in Mechanical Department, Vulture Institute of Technology, Swalapur. In this video, we are going to see classes and objects. Learning outcome. At the end of this session, students will be able to learn and develop the programs using classes and objects in C++. Content. Introduction. Second is specifying a class, objects, then defining member functions. And lastly, we are going to see a program based on class and objects. Introduction. Definition of a class. The class is a collection of objects of similar type. The entire set of data and code can be made user defined with the help of a class. Objects are the variables of type class. Once the class has been defined, we can create any number of its object. We will see the examples in the next slides. Specifying a class. So the class is defined by a class keyword. And the class contains data members, which is also called as attributes. The class has operations or member functions or methods. The body of class is enclosed within braces and terminated by a semicolon. The class contains declarations of variables and functions. The variables and functions are collectively called as members. The variable declared inside the class are known as data members and the functions are known as member functions. Yet the important point in classes are access specifiers or visibility levels are classified in two parts. Those are public and private. So the general form of class declaration is mentioned below here. So the class is a keyword and the student here student is a class name. So inside the braces, they have a class private and public. So the data members should always be in private and the member functions should always be in public. So we'll see in detail what is private and public that is access specifiers in the next slide. So here as a figure one shows in private you have data members as well as member functions. In public you have the data members and member functions. But in public can only be accessed from outside the class also but in private is accessed only within the class and there is no entry outside the class. So whatever you write in private that can be accessed only within the class and no one outside the class can access the private data but whatever we write in public we can access within the class also and outside the class also. So this is a representation of the classes. So next we're going to see objects. Objects are the basic runtime entities in object oriented systems. They may represent a place, a bank account, a table of data or any item that the program must handle. For example here class is a keyword and rectangle is a class name. Then as we have discussed private and public, private the data members like we have taken a data type integer, length, breadth and area. Public we can write public here member functions. Then your main program starts here that is void main then class name is called that is rectangle after rectangle R1 and R2 are the objects which are created in this example. The example of class and object. So we'll see the example of real life entities like fruit here in fruit we have many types like mango, apple and banana here the fruit is a class and mango, apple, banana you can create n number of objects these are called as objects. So you can see one more example of class and object like you can call a car as a class and inside the car you have n number of objects can be created like Mercedes then BMW then Audi these can be called as objects. So objects are created with the help of real life problems or real life entities and objects can be created n number of times. So here while defining a member functions it can be of two types that is defining or outside the class definition and second is inside the class definition. So we'll see the examples of outside the class definition and inside the class definition. So here first number that is outside the class definition shows here class rectangle we have taken private and public in private data members are mentioned in public member functions are mentioned. So the class is terminated by semicolon after the class we have called the class again that is void rectangle then we have used scope resolution operator and accept then we can write within the bracket like see out see in void rectangle we can calculate there and then by using void rectangle we can display the output. So the first shows the outside the class definition similarly if we see the inside the class definition here also we have taken a class rectangle private there are data members but here the difference between outside and inside is here in public data member functions are defined and after that after that they have data members after the member functions they have directly given the brackets and here see out and see is used and in void calculates the calculations are done and the display is given. So here you can see the difference in outside the class after terminating the class then again we call the class here but inside the class definition we use the member functions inside the class itself. So we will see a program using the class write a program to declare a class rectangle having data members length and breadth accept this data for one object and display area and perimeter of rectangle. So I will give you few seconds to think on the program using class as a rectangle and data members as length and breadth you can pause the video for 10 15 seconds then think okay. So here I have done a program in turbo C++ so here class rectangle is used I have taken a data members like integer length breadth and area then public so void I have done the program with the help of inside the class definition. So you can see inside the class the member functions are defined void accept then see out and see in enter the length and breadth and those are stored in L and B. The next member function is void calculate A is a variable again so A equal to L into breadth and next member function is void display see out display A. So now the class is terminated the main program starts here that is void main. I have called the class name as rectangle followed by an object I am creating an object R the next line R dot accept R dot calculate and R dot display get CH and the output for this program will be enter the length and breadth if you enter five as length and six at breadth the output will be 30. So these are the references I have used thank you.


My real people job involves maintaining for closed houses. This is one of the worst ones I did. I cost like a sailor throughout this video.   Like, oh, I'm taking a video.  This is like one of our... I walked back there to look at that shitty toilet. Literally. Oh, look at all this poop! This is like top fives.  Yeah, this is... This is pretty bad. Motherfucking, um...  What?  I didn't see it. I'm glad I did.


When treating a two-millimeter lesion, every pixel of what I'm treating matters. At the PMC loss and cancer center, our true beam linear accelerator allows even the smallest areas to be precisely targeted. Our purpose is saving lives. Winterfest opened for its fifth year last week in the Pikeville City Park with carriage rides, ice skating and more. We just want to give an opportunity for people to build some memories with their friends or families or their kids, you know, bring them out. A lot of them have never been ice skating before and so we're just very thankful that we're able to give that opportunity to people, you know. Winterfest offers many opportunities for everyone to create holiday memories, whether it be ice skating with loved ones, taking the kids to see Santa or going on a horse-drawn carriage ride with a special someone. It's a fun activity for all ages, not just for kids. We have a lot of college students come down and high school students as well, so we just hope to see you all out here. Ice skating is $10 per hour for adults and $6 per hour for children under six. For dates and times of operation, you can visit the Pikeville City Tourism Facebook page. For Mountaintop News, I'm Kelsey Dean.


Hello, my name is Elahe, I'm from Iran. I took an online course called 120-hour TESOL course by international TESOL training institution. After the completion of this course, the institution provided me with another free course called 50-hour teaching English to young learners. I received both of the certificates and recommendation letters after two weeks. You can see the recommendation letters and certificates. Now I want to express my opinion about these courses. All of the units and lessons in these two courses were amazing and understandable. And they were customized and personalized to meet each learner's and teacher's needs. This course helps me improve my knowledge as a teacher and strengthen my teaching skills. Now I can modify and correct my teaching behaviors and the sequences and the order of these courses were in a logical way and the videos that were related to these units were amazing. Thank you very much, ITTT. Thanks so much for watching. We are ITTT, the leading provider for TESOL and TEASOL training courses. If you like this video, please subscribe by clicking the button down here and click on any of the videos here on the left for more interesting teaching tips for getting certified to teach English abroad and online.


U.S. will not shoot down drones in Ukraine, as it did in Israel. The United States will not intervene in Russia's war in Ukraine and will not shoot down aerial targets, as it did in Israel. White House National Security Council Strategic Communications Coordinator John Kirby said this. Asked whether the U.S. is prepared to shoot down Iranian kamikaze drones, as it did in Israel during the Iranian attack, he said he knew the question would come up. Look, different conflicts, different airspace, different threat patterns. Kirby said. He also stressed that from the very beginning of the conflict, President Joe Biden made it clear that the U.S. had no plans to take part in hostilities in Ukraine. Kirby said that the U.S. provides Ukraine with the weapons it needs to protect its airspace. Unfortunately, we can't do that right now because we don't have the national security supplemental funding that Ukrainians so desperately need. He also said that the best solution would be to put the aid in the hands of the Israel Defense Forces and the Ukrainian military and pass the bill that the Senate has adopted. The United States has destroyed dozens of drones and at least six ballistic missiles aimed at Israel, from Iran and Yemen. Its military has said U.S. forces hit more than 80 one-way attack drones, including seven UAVs targeted on the ground prior to launch. U.S. Central Command said Iran's continued unprecedented malign and reckless behavior endangers regional stability and the safety of U.S. and coalition forces. Central Command said. Central Command remains postured to support Israel's defense against these dangerous actions by Iran. We will continue to work with all our regional partners to increase regional security. Central Command made the announcement after Iran late on Saturday launched its first-ever attack on Israeli territory in retaliation for a suspected Israeli attack on its embassy in Syria. The attack involving more than 300 drones and missiles caused only modest damage as most were shot down by Israel's Iron Dome missile defense system or the U.S. and its partners. A huge fire has broken out at Copenhagen's 17th-century former stock exchange, one of the Danish capital's most famous landmarks, engulfing the historic building's roof and toppling its distinctive spire. We are witnessing a terrible spectacle. The borses on fire, the Chamber of Commerce, which occupies the building next to Christians' Board Palace, the seat of the Danish parliament, wrote on X, Everyone is asked to stay away. Culture Minister Jacob Engelschmidt said 400 years of Danish cultural heritage had gone up in flames. The fire is very violent, and it is on every floor, Jacob Wetzel Anderson, the fire services director of emergency management, told Denmark's public broadcaster doctor you just can't take it in. It's really raging. The flames are like 20m high, he added. The Proviathus wing at Christiansborg, the nearby seat of Denmark's parliament, has been completely evacuated due to fears that it could be affected by flames and smoke. All meetings and hearings at the parliament have been cancelled with employees being told to stay at home.Copenhagen's fire services said that the building's copper roof was making fighting the fire especially challenging. The building, dating back to 1625, is a stone's throw from Denmark's parliament, the Foketing, and the Royal Palace, Christiansborg. Danish media said the nearby square was being evacuated, the old stock exchange was being renovated and had been shrouded in scaffolding and protective plastic covering. It currently houses the Danish Chamber of Commerce, which described the scenes on Tuesday morning as a terrible sight, local craftsman Henrik Grage told Danish TV that it was a tragic day. This is our Notre Dame, he said, comparing it with the fire that engulfed the roof and spire of the cathedral in the center of Paris in 2019. Passing residents joined emergency services.


Hi everyone Joe for jaskiescasebreaks.com. We did it. We knocked out the 2021 Bowman transcendent collection baseball break This is a random hit break Number one a lot of great stuff. You're guaranteed something here big. Thanks, too We did it all filler a break wise big. Thanks everybody who got into it Got into the risk on those fillers and congrats to the winners Michael Carl PJ twice Steve Birch Danny Joshua and Kevin So congrats to all of you. So here's what we're gonna do. We've got Nick right over here just off camera. He's gonna and I'm gonna put him on camera in just a second But here's what we're gonna do We're gonna show you everything first And then we're gonna type in the list of hits right these are they gonna be the list of hits right there But we'll type in like the specific names and everything right there Then we'll fill it in there'll be one dice roll for all four lists that we're gonna do We're gonna randomize the names. We're gonna match you up with the hits in one list Match you and then the people there's gonna be people who win autographs So they'll be set a and set B and they'll be winners there and then we'll multiply whoever wins a Spot right here will multiply that person's name 15 times Randomize this person's name 15 times and then we're gonna randomize your names Right, you can see 15 a's and 15 B's right there your names 30 autographs We'll do those randomizers all with the same dice roll and then match you up with some autographs So with that being said Let's see if we can flip this camera around and Nick Jaspy's gonna open up the case See if I could slide this right right you can kind of see our setup right here. Oh, there it is Have a vintage space-jam shirt right there. Oh, it's a new one a little awkward to pop open, but It's a thing I Think it's it's got to be inside right now, but they should remember that big metal box I think there's a big metal box in there It's a smaller metal box. Yeah, it used to be They're getting smaller metal boxes now Thanks, I'll show you that in a second. We'll keep that on the table right you can see it on the top of the camera There it is 2021 who gets the suitcase Me and we may use it for an in-store event or a in-store giveaway or something like that That's what we've done with the previous ones Whoa, is that red on top that's pretty cool definitely different Wow Yeah, that's awesome really cold Really cold cold metal keeps those hot hits from melting keeps the hot hits from melting Wow, that's a really short-looking case this year Sounds good Just like They should they usually cover the hits right they're not usually just naked Oh, I got it Okay, so here is The base set I believe we have six of 100 all right there you go six out of 100 There's the autograph set I believe here's the autos which I'll pop open and we'll type in The hits are hidden. Yeah, we can probably just Roll this card around so there's all the There's all the hits right there Which I think we can probably put on the table. You want me to show them first and then we do those Yeah, let's show these first. We save the cut auto for last though I'd say just do these and then the autographs and all right, and then we're in a mice. I'll do this one first Mm-hmm. Oh, that's Spencer Howard nice rookie one-of-one Gold frame Spencer Howard nice. That's the deck of gold Okay, who signs the future nice one-of-one wander Franco What a season he's had it's pretty cool And obviously it's boom and so it's prospect heavy here I think we have a vertical super fracter one-of-one nice Casey mice former number one overall pick Probably the future of that future ace of that rotation for hopefully years to come Yeah Him and Spencer Torkelson. All right and the cut autograph We've seen some pretty nice ones over the years. This one's gonna be a One-of-one John Wayne. Wow That's awesome John Wayne One-of-one cut autograph That's really cool. That's pretty nice. All right, let's slide these over this way Get the camera back on the table Pretty nice. So here's a closer look at once again at the set. So someone's gonna get that set It's actually let's go back to the list of hits here So the that's the set right there The Deca gold was the Spencer Howard The this year through the years ended up being wander Franco the super fracter was Casey mice The cut auto Really awesome John Wayne So there you go. So there's the set silver frames the Spencer Howard was the Deca gold That's the gold frame the through the years was wander Franco The super fracter was Casey mice the cut John Wayne That's awesome, and we got the invite and we're gonna show you the autographs right now So there's the invite plenty of time to RSVP We'll keep this all sealed. I don't know who the guests are but usually Usually it's probably some I don't know. They're usually really nice guests. All right gold frame are the autographs So let's pop this open and then we'll pause the video and I'll type in all the hits and then we'll do all the randomizing And then I'll show you the hits once more at the end of the video Probably be an alphabetical and we'll just go from Looks like that's the front. So we'll just go from front to back First one out of the gate is wander Franco Two out of ten wonder Franco nice, and I'll type these in in the order that they are pulled Next up is 20 out of 20 Andrew Vaughn Remember this is Bowman. So we're all looking at rookies and future stars Like Andrew Vaughn. I think Sean Jaspie all in on Andrew Andrew Vaughn the future. All right We got a nice ace of Lacey seven out of ten for the Royals Big part of that Royals rebuild next is Robert Hassel ten out of ten Tons of future value in this product leave them a lot of current value But ceilings are pretty high for all these prospects, and we have Nick Gonzalez Ten out of twenty for the buckos Yeah, the design is really sharp Steve. I agree really clean design. There's Luis Angel Acunha That's Ronald Acunha's brother five out of twenty. He's in the Luis Angel is in the Rangers organization Then we got Alec Baum rookie autograph four out of twenty Yeah, the design is really clean this year really sharp We got Ryan Mount Castle. He had a great season two out of five. I'll be a train whistle for someone Got Joey Bart 16 out of 20 my rivals the Giants Joey Bart Adley Rushman Keeper Ruiz. We've got a few young catchers coming up the ranks Cabrion Hayes seven out of 20 Nice You got Heston Kirkstab 20 out of 20 It's one of the Orioles is top draft picks in Last year or two. Remember that draft was It's like a top five pick or something like that. All right next up is Maximo Acosta nine out of ten Rangers have a lot of Interesting prospects coming up the ranks Got Luis Rodriguez nice four out of five for my Dodgers Dodgers have a lot of questions That need answering in the off-season a lot of free agent questions We got Carlos Colmenara's five out of 20 or that strong rays Farm system. We got Pedro Pineda Another train whistle out of five four out of five Nice itty cap 11 out of 20 cap capy capay Either way, he's supposed to be one of the another big prospect for the Marlins Got another Donner Willman Diaz one of one red foil one of one Shailen Palanco eight out of ten He was a popular chase in the The Bowman Sterling right or the Bowman Crone maybe Pedro Leon three out of ten You'll see the Astros in action tonight Next up is Christian Hernandez seven out of 20. There's Armando Cruz three out of five Like that that green foil really pops dig it Nolan Jones to 20 Indians prospect. I guess soon. We'll start seeing Cleveland Guardians on on on cards Eric Pena Royals Seven out of ten nice little color match blue foil with the blue of the Kansas City Royals We got Hedbert Perez for the brew crew 15 out of 20 the gold frames are always really sharp, too Got Nick York Three out of 20 Next up Garrett Mitchell Brewers nine out of 20 Julio Rodriguez one of one nice Big Mariners prospect owner when we're gonna start seeing him in action next year or two, maybe He's a pretty popular name in the hobby Jason Dominguez is to 17 out of 20 Couple more to go the last two nice Spencer Torkelson five out of 20 and last but not least It's gonna be Jared Kalanek six out of ten Nice rookie auto gold frame Excellent stuff. Thank you everyone What a break so we're gonna pause a video and While the video is paused I'm gonna type in all these hits in the order that they were pulled and then we'll run the randomizer and see who ends up with what Thanks for watching it be right back stick around. Don't go anywhere Alright, welcome back everybody the moment. We've been waiting for the randomizer. Here's the list of all the autos So you can see we got 30 autos typed in here. We got the numbers on the side Some nice one-of-ones train whistles. We're gonna figure all that out So we're gonna use one dice roll for four different randomizer. We're gonna randomize your names We're gonna randomize the hits then we'll then we're gonna multiply the people who win the autograph spot We're gonna do your randomizers in two different dice rolls as well your names and then the the list of autos So let's flip over here really quick. All right Here we go. Good luck ladies and gentlemen. Thanks for getting in. Let's roll it and randomize all four lists Three and oh one four times your names first One two three and Oh one fourth and final time So here's the rando results tab that we're gonna use here. There you go Three and oh one four times for the hits One two Three and Good luck everybody fourth and final time After four we got the VIP invite on top and the KC my super on the bottom All right, so PJ congrats to you. You've got the VIP event invitation Michael with 15 autographs. You'll be set a Joshua you got another 15 autographs. You'll be be Carl. Look at that with the John Wayne cut autograph PJ gets the oh the silver set Right there. We're gonna send that to you seal the 50 card set Danny with a Spencer Howard one of one Steve Burge with a wander Franco one of one and Kevin with the KC mice one of one Carl all aboard the big hit Express Danny all aboard Steve Burge all aboard the big hit Express And Kevin all aboard the big hit Express There you go ladies and gentlemen now we're gonna see who's gonna win those Let's see which autographs you're gonna get Michael and Josh. So Michael you've got set a so let's cruise over here So we'll get everybody's names here So Michael there you're 15 Let's flip back over here, and then the rando results tab Joshua. You got a 15 You got 15 autographs for yourself as well. All right now. Let's gather your names Put them into a blank list Let's gather the list of autographs And I'll show everyone that hits again in just a moment and put everything there Once again three and a one four times four names and autographs Because we'll use that use a new tab right there for the results. All right three and a one four times once again for names and autos one two three And a one and three and a one four times for the autos one two three And a one fourth and final time After four we got the Cabrion haze down to the Garrett Mitchell Nice, so Michael with the Cabrion haze the Shailen Palanco nice future teammates perhaps Joshua with the Luis Angel Acuna Michael with the Andrew Vaughn Josh With this block right there head bird Perez Pedro Pedro Pena to four out of five all aboard the big hit express You get the Nolan Jones the Alec bomb the Jared Kalanek and the Wilman DS one-of-one all aboard Whoo Spencer Torkelson and the Carlos Coleman are as Michael with the Robert Hassel and the Jason amingas Jason or check that Joshua With the Nick Gonzalez a lot of names here Michael with the Ryan Mountcastle two out of five all aboard the big hit express Then we got Joshua with the Maximo Costa the ace a Lacey Michael with the Heston Kirkstad and Joshua with the Luis Rodriguez four out of five All aboard the big hit express whoo-hoo and Michael with the Julio Rodriguez one-of-one all aboard Michael you also have the Eric Pena the Pedro Leone Joshua the Christian Hernandez. Is there a home run already? Wow, Atlanta on top and Michael with the Wander Franco the Joey Bart the Yiddie cap the Armando Cruz All aboard the big hit express whoo-hoo Michael with the Nick York Joshua with the Garrett Mitchell and that's that ladies and gentlemen. What a break Thanks everybody for watching. So once again just to recap PJ gets the invite Michael you got your we'll show you the autographs in a second Michael and Josh had the autos Carl with the John Wayne cut auto That is awesome. That's really cool PJ also gets the this set right here. These are the base card set We'll keep it sealed. That's pretty neat People really like these sealed sets too on a secondary market Danny you get the Spencer Howard one-of-one nice Gold frame encased rookie That's the Deca gold autograph Steve Burch you get the Wander Franco through the years are actually signs of the future one-of-one He's pretty good And The KC my super fracture goes to Kevin There you go, and there you have it ladies and gentlemen. I'm Joe for jazby's case breaks calm. Thanks for watching Thanks for breaking with us Congrats to all the winners, and I'll see you next time for the next break. Bye. Bye


The way I get excited about basketball games is the same way I get excited about my daughter and her dance recital. It's the same way I got excited when my son came home with first place in chess club at school. So whatever your niche is, whatever that may be, find out what makes you happy and what makes you tick. And that will make you stronger all around, especially mentally. Thank you for watching!