# High CPU load after resume from suspend



## bojanvuk (Apr 25, 2016)

Hi,
I'm using Nas4Free and I'm experimenting with suspend/resume.
I use `acpiconf -s 3` to suspend the machine and the power button to resume it.
After resuming all seems to work (except the video card, but I don't really need it in this setup), however the CPU goes full speed and it's at 100% usage.
The top processes are DEVD (60%) and SYSLOGD (15%).
When I run `devd -d` (in foreground) I can see the following messages scrolling non stop:

```
Popping table
Processing event '!system=ACPI subsystem=Thermal type=\_TZ_.THRM notify=0x80'
Pushing table
setting system=ACPI
setting subsystem=Thermal
setting type=\_TZ_.THRM
setting notify=0x80
Processing notify event
Testing system=ACPI against ^DEVFS$, invert=0
Testing system=ACPI against ^DEVFS$, invert=0
Testing system=ACPI against ^DEVFS$, invert=0
Testing system=ACPI against ^DEVFS$, invert=0
^CTesting system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0
Testing system=ACPI against ^USB$, invert=0

[...]
```

When I kill DEVD there are no over active processes, but the top command shows 30% idle and 70% system (CPU is still going full speed).

Do you have any idea how to debug it?

My system/os specs:

```
Version        10.2.0.2 - Prester (revision 2545)
Compiled    Fri Apr 15 14:56:30 UTC 2016
Platform OS    FreeBSD Revision: 199506
        FreeBSD 10.2-RELEASE-p14 #0 r297897M: Wed Apr 13 02:57:40 CEST 2016
Platform    x64-embedded on Intel(R) Celeron(R) CPU G1610 @ 2.60GHz
System        Foxconn H67MP-S/-V/H67MP
System bios    American Megatrends Inc. version: BC5F1P04 03/06/2013
```

I asked the questions in nas4free forums, but haven't received any answers and I think that this problem could be FreeBSD specific.

Best wishes,
B.


----------



## Juha Nurmela (Apr 26, 2016)

Does it make a difference if you remove or add coretemp(4) module ?

Juha


----------



## bojanvuk (Apr 26, 2016)

Hi,
Thanks for your reply.
I've loaded coretemp module via loader.conf and confirmed that it's loaded by kldstat.
It did not change anything. Still system is doing something at 70%.

B.


----------



## wblock@ (Apr 30, 2016)

The problem is that NAS4Free is different from FreeBSD.  What version of FreeBSD does it use?  What customizations have they made?


----------



## bojanvuk (May 3, 2016)

Hi,
As I mentioned earlier this version is based on :

```
Version        10.2.0.2 - Prester (revision 2545)
Platform OS    FreeBSD Revision: 199506
        FreeBSD 10.2-RELEASE-p14 #0 r297897M: Wed Apr 13 02:57:40 CEST 2016
```

As I understand the situation after the resume kernel keeps rising temperature_change event (ACPI 0x80):

```
Processing event '!system=ACPI subsystem=Thermal type=\_TZ_.THRM notify=0x80'
```
and `devd` tries to dispatch it.


----------



## ronaldlees (May 3, 2016)

Have never noticed such a thing myself.  Sounds like one for the mailing list ...


----------



## bojanvuk (May 5, 2016)

Ok. I decided to try "vanilla" FreeBSD on my machine. It's 10.3-RELEASE on usb stick in live USB mode.
Results (after suspend/resume cycle):


```
last pid:   689;  load averages:  1.88,  0.70,  0.30  up 0+00:05:08    23:39:27
34 processes:  4 running, 29 sleeping, 1 waiting
CPU 0: 16.9% user,  0.0% nice, 82.7% system,  0.0% interrupt,  0.4% idle
CPU 1: 26.4% user,  0.0% nice, 72.4% system,  0.0% interrupt,  1.2% idle
Mem: 11M Active, 11M Inact, 70M Wired, 7200K Buf, 3563M Free
Swap:

  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
   16 root          1 -16    -     0K    16K CPU1    1   0:29  82.67% acpi_thermal
  339 root          1  90    0 13628K  4892K RUN     0   0:21  59.28% devd
    0 root         10  -8    -     0K   160K -       1   0:13  35.99% kernel
  411 root          1  29    0 14520K  2100K select  1   0:06  15.67% syslogd
(...)
```

So it seems that it isn't a problem within Free4Nas, but it's a problem with FreeBSD.

B.


----------

