Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to isolate a core on my dual core machine. Essentially, I just want to get the isolcpus boot parameter to work for me. I currently have it in place but it doesn't appear to isolate the desired core. Assuming that the parameter is actually working correctly, I can only guess that there is something that is actively moving processes to the isolated core in some indirect way.
I am attempting to get this to work on a qemu virtual machine with two core on a distro called crunchbang 10 (2.6 kernel that is derived from debian). If anyone has had any success on isolating a core or has any insight on my situation, I would love to hear about it!
Prove to yourself it works as expected in a non-virtual environment (on the host say).
Given the way CPUs are virtualised (in the guests), this could be *real* hard to get working consistently in the guest.
Might be easier to setup cgroups in the guest to separate the "cores".
I have made some progress on the project. In the virtual machine that I mentioned in my former post, I managed to set up cpusets and they seem to be working but not completely. I have two sets, one for each cpu of the machine. To isolate on core, I will simply move all of the processes to the other. The only problem is that some of the process will not migrate when I try to move them to one of the sets. When I send all processes to cpu 0, there are about 20 processes that will not make the move (when I try to write the process numbers to the tasks pseudo-file, I get an error.) and there are also about 20 other processes that will not make the move in the other direction (i.e. when I try to move them all to cpu 1).
Any body out there that has some good experience using cpusets?
Since you mention a "qemu virtual machine", I'm not entirely sure what your ultimate goal is. Is it to assign a specific number of CPU's to a VM?
I have a machine with hardware support for virtualization. But, a number of forms of virtualization just don't function on the machine, and seemingly no one can determine why. Yet, VirtualBox works like a champ on the machine. I can configure it to use as many CPU's as I want. However VirtualBox handles the CPU's, there doesn't appear to be a problem with dedicating a given number of CPU's to the VirtualBox VM. If you are ultimately trying to associate a specific number of CPU's with a VM, you might want to give VirtualBox a try.
Which processes won't move ?. There are kernel threads that are specific to each "core" - I wouldn't like your chances of trying to move them. Userland works fine in cgroups - and also worked fine when it was called cpusets. I've used it for years to isolate benchmark workloads from the process/user doing the monitoring.
Later: forgot to mention - I only run "native", never virtualised.
Thanks for the replied guys! I apologize for the tardiness of my own reply.
@rigor
I have already achieved that goal. Qemu provides me with a sufficiently multi-core VM. What I want to do now is isolate one of those virtual cores - meaning I want nothing to be running on it unless I tell it to.
I have already tried using virtualbox but I left it under the impression that it only supported single core VMs. Am I wrong on that?
@syg00
Here are the commands listed in top for the processes that will not move:
migration/1
ksoftirqd/1
watchdog/1
events/1
kintegrity/1
kblockd/1
kondemand/1
aio/1
crypto/1
ata/1
ext4-dioo-unwrit --I assume that these two are cut off from view
ext4-dioo-unwrit
kconservative/1
In addition there are several more processes running on the other core that are listed in the master cpuset that will not move from that set. I'm guessing they are the other kernel threads that cannot be moved.
Quote:
Later: forgot to mention - I only run "native", never virtualised.
Why do you say this? Are you telling me that I should not use cpusets in a virtual machine? If so then why?
I have already achieved that goal. Qemu provides me with a sufficiently multi-core VM. What I want to do now is isolate one of those virtual cores - meaning I want nothing to be running on it unless I tell it to.
I have already tried using virtualbox but I left it under the impression that it only supported single core VMs. Am I wrong on that?
...
I've attached an image file of the processor configuration panel from the VirtualBox that I'm running, version 4.0.12. It allows me to specify the number of CPU's for the VM. It does mention that hardware virtualization support is needed to use more than one "virtual" CPU. In my case my hardware has that support.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.