LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-14-2013, 04:29 PM   #1
harlequin144
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Rep: Reputation: Disabled
Isolating a core


Hello linuxquestions!

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!
 
Old 03-16-2013, 05:11 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 13,249

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
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".
 
1 members found this post helpful.
Old 03-18-2013, 10:11 AM   #3
harlequin144
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
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?
 
Old 03-18-2013, 07:46 PM   #4
rigor
Member
 
Registered: Sep 2011
Posts: 175

Rep: Reputation: Disabled
harlequin144,

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.

Hope this helps!
 
Old 03-19-2013, 03:56 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 13,249

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
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.
 
Old 03-21-2013, 06:19 PM   #6
harlequin144
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
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?
 
Old 03-22-2013, 03:55 PM   #7
rigor
Member
 
Registered: Sep 2011
Posts: 175

Rep: Reputation: Disabled
Quote:
Originally Posted by harlequin144 View Post
...
@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?
...
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.
Attached Thumbnails
Click image for larger version

Name:	vbox_cpu_config.png
Views:	8
Size:	27.3 KB
ID:	12113  
 
Old 03-22-2013, 10:56 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 13,249

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
I mentioned it only to stress our environments are not exactly the same. Might be relevant, might not.

That list of processes are indeed all kernel threads.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Isolating part of a network default5 Linux - Networking 2 04-08-2010 06:49 PM
Isolating private networks? MrUmunhum Linux - Networking 3 03-14-2010 09:56 PM
Isolating processes badradiation Linux - General 3 10-18-2006 02:39 PM
Tip: Isolating a Linux problem sundialsvcs Linux - Newbie 1 09-01-2005 10:17 AM
isolating net usage Meatwad Linux - Networking 3 09-03-2004 11:09 AM


All times are GMT -5. The time now is 11:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration