LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-29-2012, 02:56 AM   #1
tquang
Member
 
Registered: Jul 2010
Posts: 44

Rep: Reputation: 0
Change/Limit numbers core of CPU


Hi,

That is crazy title of thread. Really, my partner required me decrease numbers core CPU from 16 to 8. Because he say "incompatible if run 16 cores).
In Windows, i can do that with: run > msconfig > boot > advance > number cpu boot.
And in Linux, how can i do that?

Thanks alot
 
Old 06-29-2012, 03:15 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
You can pass a parm to the kernel via grub/lilo to limit CPUs - maxcpus=8 say in your case.
This is for the life of the boot for all users.

If you have CPU hotplug enabled you can configure CPUs offline dynamically. This might be problematic for some software. Have a read of this.
 
2 members found this post helpful.
Old 06-29-2012, 03:15 AM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
In Linux you can use the kernel parameter maxcpus.

For instance in lilo I would add a line in the relevant image section of /etc/lilo.conf:
Code:
append = "maxcpus=8"
I suppose you can do something similar with Grub.

To know more, see the file Documentation/kernel-parameters.txt.

Or you can recompile your kernel to change the value of NR_CPUS but I guess that you would prefer to change the value at runtime.

Last edited by Didier Spaier; 06-29-2012 at 11:13 AM.
 
1 members found this post helpful.
Old 06-29-2012, 09:27 AM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
The program is faulty I'd think. Even a single core application runs on 16x systems. Fix the program?

I forget the program but it limits cpu's after boot time to an application. I am pretty sure someone here posted that a year ago and I had to look it up to believe it. I can't find it now.
 
1 members found this post helpful.
Old 06-29-2012, 09:30 AM   #5
tquang
Member
 
Registered: Jul 2010
Posts: 44

Original Poster
Rep: Reputation: 0
Thanks syg00, Didier Spaier

I'm still use GRUB, and here

Example Original
Code:
title CentOS (2.6.18-308.4.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-308.4.1.el5 ro root=LABEL=/
        initrd /initrd-2.6.18-308.4.1.el5.img
Edit append maxcpus=8
Code:
title CentOS (2.6.18-308.4.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-308.4.1.el5 ro root=LABEL=/ maxcpus=8
        initrd /initrd-2.6.18-308.4.1.el5.img
Quote:
Originally Posted by jefro View Post
The program is faulty I'd think. Even a single core application runs on 16x systems. Fix the program?

I forget the program but it limits cpu's after boot time to an application. I am pretty sure someone here posted that a year ago and I had to look it up to believe it. I can't find it now.
Thank you. At first time, I only provide for my partner system installed with his request. I don't managemet

Last edited by tquang; 06-29-2012 at 09:33 AM.
 
  


Reply



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
TOP output Cpu(s) and %CPU don't fit on single core AchimRS Linux - General 2 11-03-2011 03:32 PM
why does SCHED_FIFO task on one CPU affects other CPU tasks on a multy core system? reg13 Linux - Kernel 2 07-31-2011 09:48 PM
cpu frequency scaling with Pentium(R) Dual-Core CPU E5200 @ 2.50GHz tramni1980 Slackware 5 08-16-2009 08:29 AM
vmstat large numbers under cpu id column ginda Linux - Server 1 07-21-2009 10:13 PM
what means cpu limit? joda Linux - General 0 01-15-2004 09:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:22 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
Open Source Consulting | Domain Registration