View Single Post
Old 03-14-2019, 09:05 AM   #11
s wave
Human being with feelings
 
Join Date: Sep 2018
Location: Colorado
Posts: 429
Default

With Cinnamon (r u running 18.04 kernel?) I get rid of Hibernate and Sleep as its set up. What is that swapper doing?...32 49%

'The reason is historical and programatic. The idle task is the task running, if no other task is runnable, like like it was said. It has the lowest possible priority, so that's why it's running of no other task is runnable

Programatic reason: This simplifies process scheduling a lot, because you don't have to care about the special case: "What happens if no task is runnable?", because there always is at least one task runnable, the idle task. Also you can count the amount of cpu time used per task. Without the idle task, which task gets the cpu-time accounted no one needs?

Historical reason: Before we had cpus which are able to step-down or go into power saving modes, it HAD to run on full speed at any time. It ran a series of NOP-instructions, if no tasks were runnable. Today the scheduling of the idle task usually steps down the cpu by using HLT-instructions (halt), so power is saved. So there is a functionality somehow in the idle task in our days'

'The swapper process is part of the kernel. It should have PID 0 and is in charge of scheduling processes'

COMMAND:$ ps -eaf [more in depth to track the pid: ps -ef | grep <PID>]
or something similar...

Maybe that sheds some light. I would also dial in your swap memory - don't over allocate or under allocate - there appears to be a sweet spot.
Here is the swap command to quick check 'SWAP' usage:

~ $ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 0 5329948 185436 1082220 0 0 79 28 387 622 4 2 92 2

(sudo apt get) '# glances' program will give more detailed info on swap too.

You probably know all this but its good to brainstorm sometimes. Also I have heard of a rare problem in the 1st swapper sched can split the secondary scheduling wrong (not OS or program specific) gl
s wave is offline   Reply With Quote