Questions tagged [cpu]
The CPU (Central Processing Unit), is the chip in the computer that actually performs the operations and calculations that are done as a program runs. It is essentially what executes a program.
96
questions
18
votes
4
answers
22k
views
32-bit, 64-bit CPU op-mode on Linux
I'm confused. Running Fedora Linux, lscpu yields:
Architecture: i686
CPU op-mode(s): 32-bit, 64-bit
...
But when I try to install a 64-bit program (Chrome) I get error like:
...
271
votes
6
answers
198k
views
What do the flags in /proc/cpuinfo mean?
How can I tell whether my processor has a particular feature? (64-bit instruction set, hardware-assisted virtualization, cryptographic accelerators, etc.) I know that the file /proc/cpuinfo contains ...
50
votes
4
answers
33k
views
How can I set the processor affinity of a process on Linux?
How can I set the processor affinity of a process on Linux?
34
votes
4
answers
141k
views
Number of processors in /proc/cpuinfo
While I was learning about cpu load, I came to know that it depends on the number of cores. If I have 2 cores then load 2 will give 100% cpu utilization.
So I tried to find out cores.( I already know ...
4
votes
2
answers
2k
views
Is there a log of past threads that are now closed?
Sometimes, I have a rogue Java process which takes up 100% of my CPU and makes it jump about 30C in temperature (usually resulting in a crash if not killed).
Problem is, I can never really identify ...
97
votes
2
answers
122k
views
How to limit a process to one CPU core in Linux? [duplicate]
How to limit process to one cpu core ?
Something similar to ulimit or cpulimit would be nice. (Just to ensure: I do NOT want to limit percentage usage or time of execution. I want to force app (with ...
261
votes
3
answers
419k
views
Linux "top" command: What are us, sy, ni, id, wa, hi, si and st (for CPU usage)?
When I issue top in Linux, I get a result similar to this:
One of the lines has CPU usage information represented like this:
Cpu(s): 87.3%us, 1.2%sy, 0.0%ni, 27.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0....
79
votes
15
answers
216k
views
Checking if HyperThreading is enabled or not?
How can I check if hyperthreading is enabled on a Linux machine, using a perl script to check for it?
I'm trying the following way:
dmidecode -t processor | grep HTT
Let me know if I'm on right ...
67
votes
2
answers
90k
views
Top and ps not showing the same cpu result
This is linked to this question.
When I run top I get the following result:
pid 3038 is using 18% cpu, however when running
the result is 5.5%. And this number does not appear to be changing with ...
353
votes
12
answers
693k
views
How to know number of cores of a system in Linux?
I wanted to find out how many cores my system has, so I searched the same question in Google. I got some commands such as the lscpu command.
When I tried this command, it gave me the following result:
...
82
votes
6
answers
101k
views
How to determine the maximum number to pass to make -j option?
I want to compile as fast as possible. Go figure. And would like to automate the choice of the number following the -j option. How can I programmatically choose that value, e.g. in a shell script?
...
33
votes
8
answers
25k
views
cron Vs. sleep - which is the better one in terms of efficient cpu/memory utilization?
The Case:
I need to run some commands/script at certain intervals of time and for this I have two options:
set up a cron-job
implement a loop with sleep in the script itself.
Question:
Which is the ...
80
votes
5
answers
177k
views
So what are logical cpu cores (as opposed to physical cpu cores)?
I was googling about how I could find the number of CPUs in a machine and I found some posts but I am confused as some mentioned that you get the logical cores vs physical cores etc.
So what is the ...
35
votes
2
answers
38k
views
Understanding output of lscpu
You can see the output from lscpu command -
jack@042:~$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 56
On-...
13
votes
4
answers
21k
views
Setting running process affinity with taskset fails
I'm attempting to limit a process to a given number of CPU cores. According to the taskset man page and this documentation, the following should work:
[fedora@dfarrell-opendaylight-cbench-devel ~]$ ...
8
votes
1
answer
6k
views
Understanding core IDs
Just to understand core IDs:
I have 4 CPUs:
$ cat /proc/cpu* | grep proc*
processor: 0
processor: 1
processor: 2
processor: 3
and the result of nproc is also 4.
But if I use cat /proc/cpu* | grep '...
6
votes
2
answers
3k
views
How does load average work with modern CPU's?
My understanding of load average lead me to be quite shocked with my current system. The CPU in my workstation is an i7 with hyperthreading enabled, and cat /proc/cpuinfo produces 4 'cpu's.
That all ...
82
votes
6
answers
303k
views
What is the correct way to view your CPU speed on Linux?
I found two commands to output information about my CPU: cat /proc/cpuinfo and lscpu. /proc/cpuinfo shows that my CPU speed is 2.1 Ghz, whereas lspcu says it is 3167 Mhz. Which one is correct?
This ...
57
votes
9
answers
61k
views
how to find out the cpu "code name" (architecture family)?
I get access to some xeon machines for checking performance. I want to find out what architecture they are using such as Haswell, Sandybridge , Ivybridge. Is there a command to find this out?
50
votes
8
answers
91k
views
Limiting processes to not exceed more than 10% of CPU usage
I operate a Linux system which has a lot of users but sometimes an abuse occurs; where a user might run a single process that uses up more than 80% of the CPU/Memory.
So is there a way to prevent ...
22
votes
2
answers
62k
views
disabling cpu cores on quad core processor on linux
I want to disable 3 CPU cores and run my processor on a single core. I have used command:maxcpus=1. But after this I executed this command ls /sys/devices/system/cpu. It still shows cpu0,cpu1,cpu2,...
22
votes
4
answers
35k
views
Why is kworker consuming so many resources on Linux 3.0.0-12-server?
Last Friday I upgraded my Ubuntu server to 11.10, which now runs with a 3.0.0-12-server kernel. Since then the overall performance has dropped dramatically. Before the upgrade the system load was ...
15
votes
5
answers
10k
views
Understanding top and load average
I'm observing a high load average on a certain machine (about 9) in all three load fields. I understand load as the number of processes in state "run" / currently desiring CPU time. Am I correct at ...
14
votes
4
answers
15k
views
Determining the particular processor on which a process is running
I have access to an 8-core node of a Linux cluster. When logged in to the node, I can see a list of processors using this command:
more /proc/cpuinfo
In my 8-core node, the processors are numbered ...
4
votes
1
answer
2k
views
How does the kernel assign cpu ids to physical cores?
One may find a lot of info about how to inspect physical cores layout in a running linux system, but I'm wondering how the physical cores are assigned a cpu id in the first place.
After experiencing ...
111
votes
2
answers
427k
views
Understanding %CPU while running top command [duplicate]
I am trying to understand what %CPU means when I run top.
I am seeing %CPU for my application at "400" or "500" most of the time.
Does anyone know what this means?
19080 david 20 ...
34
votes
2
answers
20k
views
What does the "bugs" section of /proc/cpuinfo actually show?
On a Debian Stretch and testing/Buster system with a current kernel and installed microcode I still see meltdown and spectre listed as bugs in /proc/cpuinfo.
However, running the spectre-meltdown-...
29
votes
4
answers
6k
views
Why are some Intel family 6 CPU models (Core 2, Pentium M) not supported by intel_idle?
I've been tuning my Linux kernel for Intel Core 2 Quad (Yorkfield) processors, and I noticed the following messages from dmesg:
[ 0.019526] cpuidle: using governor menu
[ 0.531691] clocksource: ...
26
votes
5
answers
59k
views
How do I know which processors are physical cores?
I've got an Intel i7 2700k here, and I'd like to know how I can tell which processors are physical and which are virtual (ie: hyperthreading). I'm currently running a Conky script to display my CPU ...
19
votes
1
answer
12k
views
What are Kernel PMU event-s in perf_events list?
Searching for what one can monitor with perf_events on Linux, I cannot find what Kernel PMU event are?
Namely, with perf version 3.13.11-ckt39 the perf list shows events like:
branch-instructions OR ...
18
votes
1
answer
4k
views
How does a CPU know there is IO pending?
I have been looking into the iowait property shown in top utility output as shown below.
top - 07:30:58 up 3:37, 1 user, load average: 0.00, 0.01, 0.05
Tasks: 86 total, 1 running, 85 ...
15
votes
7
answers
48k
views
Getting cpu usage same every time.
When I execute following command to get cpu usage , I get nice + user cpu usage.
top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}'
Output:
14.5
Here I am getting problem is that the output ...
11
votes
2
answers
12k
views
Why does top report the incorrect CPU usage?
I have a machine with Intel(R) Xeon(R) CPU E5520 visible as 16 logical cores (8 with HT). If I run something to eat CPU time (single threaded) top correctly reports 100% CPU usage for the process but ...
11
votes
2
answers
123k
views
Debian jessie boot hangs at "Started Update UTMP about System Runlevel Changes."
I just upgraded my MOBO and CPU on my PC, and now whenever I try and boot my debian install it hangs at [ OK ] Started Update UTMP about System Runlevel Changes. Is there an way I can boot into my ...
11
votes
1
answer
18k
views
What does "cpu MHz" field mean in the /proc/cpuinfo of a hyper-threading cpu?
The CPU is a [email protected]. It has 4 cores and each core has 2 threads. Here is the dmidecode output:
# dmidecode -t 4
# dmidecode 2.9
SMBIOS 2.7 present.
Handle 0x0042, DMI type 4, 42 bytes
...
11
votes
2
answers
12k
views
what is the difference between cpu and core?
The output of lscpu of my pc looks like --
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
...
9
votes
2
answers
13k
views
How to disable one CPU
I'm trying to disable some CPUs of my server.
I've found this link: https://www.cyberciti.biz/faq/debian-rhel-centos-redhat-suse-hotplug-cpu/linux-turn-on-off-cpu-core-commands/, which offers me a ...
7
votes
3
answers
2k
views
Debian not showing all cores?
I recently purchased a i5-9600K. Which is supposed to run 6 cores and 6 threads (hyperthreading), when I take a look into /proc/cpuinfo the ht flag is on, and checking a tool like htoponly shows 6 ...
7
votes
3
answers
3k
views
Externaly limiting number of CPU cores used
I need to externally limit a process/session to a certain number of cores.
Are there any other possibilities than CPU affinity (I don't like the need to specify the actual cores) and cgroups (hard to ...
3
votes
2
answers
2k
views
Pipe Viewer - Progress monitor performance consequence
I am writing a batch script to sort through gigs and gigs of data. All of the data is text but the script will take a long long time to execute. I would like to give some visual indication that the ...
3
votes
1
answer
2k
views
How does the Linux kernel schedule CPU, between user space processes/threads and kernel tasks/jobs
I was trying to understand the Linux process management and scheduling. I know that the scheduler schedules different processes based on priority/time slicing. But there are kernel tasks (I am not ...
3
votes
2
answers
3k
views
Why is cpu_idle called as the last function of the start_kernel routine?
I'm reading the start_kernel function in /init/main.c.
The last function called in start_kernel is rest_init, and at the end of rest_init, cpu_idle is called.
Why is it called as the last function ...
2
votes
1
answer
297
views
How can I prevent installation of a specific package on Linux Mint?
TL;DR
Question: How can I disallow installing of the package intel-microcode in the future? With my bad memory, I may try installing it someday, again.
Long story
Yesterday, I installed the intel-...
0
votes
1
answer
10k
views
How to get the number of processes waiting for CPU on Linux?
If CPU is running 100% usage, other processes should be put inside a run queue. Which command can I use to get the size of the run-queue? vmstat seems to return a related value of the CPU like below:
...
0
votes
2
answers
6k
views
How to restrict awk math output to 2 decimal places
My Command is below and its print Free CPU and Used CPU below format.
I want to restrict awk output to 2 decimal place.
grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} {free=($5)*100/($...
86
votes
3
answers
31k
views
What does an idle CPU process do?
Looking at the source of strace I found the use of the clone flag CLONE_IDLETASK which is described there as:
#define CLONE_IDLETASK 0x00001000 /* kernel-only flag */
After looking deeper into it I ...
50
votes
5
answers
238k
views
How to find which Process is causing High CPU usage
Is there any way to find out from terminal which process is causing high CPU Usage ?
It would also be useful to order processes in descending order of cpu Usage
47
votes
1
answer
94k
views
What are software and hardware interrupts, and how are they processed?
I am not sure if I understand the concept of hardware and software interrupts.
If I understand correctly, the purpose of a hardware interrupt is to get some attention of the CPU, part of implementing ...
26
votes
1
answer
4k
views
High CPU usage with CFS?
I asked a previous question to try and isolate the source of an increase in CPU usage when moving an application from RHEL 5 to RHEL 6. The analysis that I did for that seems to indicate that it is ...
23
votes
4
answers
31k
views
Run Linux process at very very low priority?
I have a regular process that's not so important but will consume very much CPU power. I have another process which is really important, but it spends most of the time idle, but when it gets a job it ...