Hi Vaibhav,<br><br><div class="gmail_quote">On Thu, Aug 18, 2011 at 8:24 PM, Vaibhav Jain <span dir="ltr"><<a href="mailto:vjoss197@gmail.com">vjoss197@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br><br>I talked to a friend of mine and he suggested that <br>in a logical offline state the cpu is powered on and ready to execute instructions<br>just that the kernel is not aware of it. But in case of physical offline state the cpu <br>
is powered off and cannot run.<br>Are you saying something similar ?<div><div></div><div><br></div></div></blockquote>Yes, you are right, mostly. <br>When you try to logically offline a CPU, the kernel will do task migration (i.e., move out all the tasks running on that CPU to other CPUs in the system) and it ensures that it doesn't need that CPU anymore. This also means that, from now on, the context of that CPU need not be saved (because the kernel has moved that CPU's tasks elsewhere). At this point, it is as if the kernel is purposefully using only a subset of the available CPUs. This step is a necessary prerequisite to do physical CPU offline later on.<br>
<br>But I don't think CPU power ON or OFF is the differentiating factor between logical and physical offlining. In logical offline, you still have the CPUs in the system but you just tell the kernel not to use them. At this stage, you can power off your CPU, to save power for example.<br>
But in physical offline, from a software perspective, you do additional work at the firmware level (apart from logical offlining at the OS level), to ensure that physically plugging out the CPUs will not affect the running system in any way.<br>
<br>Please note that you can logically online and offline the same CPUs over and over again without rebooting the system. Here, while onlining a CPU which was offlined previously, the kernel follows almost the same sequence which it normally follows while booting the CPUs during full system booting.<br>
<br>Also one more thing to be noted is that, to be able to physically hot-plug CPUs, apart from OS and firmware support, you also need the hardware to support this feature. That is, the electrical wiring to the individual CPUs should be such that plugging them in and out does not interfere with the functioning of the rest of the system. As of today, there are only a few systems that support physical CPU-hotplug. But you can do logical CPU hotplug easily, by configuring the kernel appropriately during compilation, as you have noted in one of your previous mails.<br>
<br>Regards,<br>Srivatsa S. Bhat<br></div>