History log of /openbmc/phosphor-pid-control/pid/pidloop.hpp (Results 1 – 7 of 7)
Revision Date Author Comments
# 0e8fc398 04-Oct-2022 Bonnie Lo <Bonnie_Lo@wiwynn.com>

Support derivative term in PID algorithm and support to set cycle interval time from fan table

1. Support to calculate derivative term in PID algorithm.
2. Add two properties: cycleIntervalTimeMS an

Support derivative term in PID algorithm and support to set cycle interval time from fan table

1. Support to calculate derivative term in PID algorithm.
2. Add two properties: cycleIntervalTimeMS and updateThermalsTimeMS
in fan table that could be used to decide "time interval of PID control loop"
and "time interval to update thermals' cached value".

Tested:

- PID algorithm:
1. Check pid-control-service could calculate output PWM
according to the fan table.

[Test log]
root@greatlakes:~# systemctl status phosphor-pid-control -l
* phosphor-pid-control.service - Phosphor-Pid-Control Margin-based Fan Control Daemon
Loaded: loaded (/lib/systemd/system/phosphor-pid-control.service; enabled; preset: enabled)
Active: active (running) since Fri 2018-03-09 05:09:35 PST; 1min 47s ago
Main PID: 3105 (swampd)
CGroup: /system.slice/phosphor-pid-control.service
`-3105 /usr/bin/swampd -c /usr/share/entity-manager/configurations/fan-table.json
...
Mar 09 05:10:29 greatlakes phosphor-pid-control[3105]: PID Zone 1 max SetPoint 3.75 requested by
PID_NIC_SENSOR_TEMP BMC_SENSOR_FAN0_TACH BMC_SENSOR_FAN2_TACH BMC_SENSOR_FAN4_TACH BMC_SENSOR_FAN6_TACH

- Cycle interval time:
1. Set cycleIntervalTimeMS and updateThermalsTimeMS
to 1000 ms in fan table
2. Check service would update thermal every second from debug log.

[Test log]
root@greatlakes:~# journalctl -u phosphor-pid-control --since "Mar 09 04:52:16"
Mar 09 04:52:16 greatlakes systemd[1]: Started Phosphor-Pid-Control Margin-based Fan Control Daemon.
...
Mar 09 04:53:28 greatlakes phosphor-pid-control[2795]: processThermals
Mar 09 04:53:28 greatlakes phosphor-pid-control[2795]: processFans
Mar 09 04:53:29 greatlakes phosphor-pid-control[2795]: processThermals
Mar 09 04:53:29 greatlakes phosphor-pid-control[2795]: processFans
Mar 09 04:53:30 greatlakes phosphor-pid-control[2795]: processThermals
Mar 09 04:53:30 greatlakes phosphor-pid-control[2795]: processFans

Change-Id: I04e1b440603c3ad66a1e26c96451992785da6fe6
Signed-off-by: Bonnie Lo <Bonnie_Lo@wiwynn.com>

show more ...


# b6a0b89e 21-Feb-2021 Hao Jiang <jianghao@google.com>

Bug fix: pidControlLoop may loop infinitely.

boost::basic_waitable_timer::cancel is a non-blocking function and only
sends cancellation to the pending operations. For other operations:

Bug fix: pidControlLoop may loop infinitely.

boost::basic_waitable_timer::cancel is a non-blocking function and only
sends cancellation to the pending operations. For other operations:
```
If the timer has already expired when cancel() is called, then the
handlers for asynchronous wait operations will:
* have already been invoked; or
* have been queued for invocation in the near future.
These handlers can no longer be cancelled, and therefore are passed an
error code that indicates the successful completion of the wait
operation.
```

In our case, if pidControlLoop() has been invoked or in the invoke
queue while the timer cancellation, it will ignore the cancal ec and
infinitely call the pidControlLoop() chain.

Thus an extra cancel variable is introduced to break the chain.

Signed-off-by: Hao Jiang <jianghao@google.com>
Change-Id: Ie4e53454ee326bdf612abb511990610a6b528300

show more ...


# 5301aae3 28-Sep-2020 Johnathan Mantey <johnathanx.mantey@intel.com>

Eliminate swampd core dump after D-Bus updates sensors

The swamp daemon intializes a list of sensors and uses those to
periodically scan the state associated devices. Reading the sensors

Eliminate swampd core dump after D-Bus updates sensors

The swamp daemon intializes a list of sensors and uses those to
periodically scan the state associated devices. Reading the sensors is
done with an async timer, that runs code to re-arm an async timer.

There is also a D-Bus update cycle that is independent of the async
timer reading the sensors. When the D-Bus updates the number of
sensors in the system a new list must be created. In order to create
the new list the timers using the old list must be stopped. Only after
those timers have stopped may a new list be generated, and a new set of
timers started.

The two processes are unware of each other. To safely perform the
change the pointers to the list of zones and timers must be kept alive
until all timer actions complete. Only after all references to the
pointers have been release may the new state be built, and new timers
started.

Prior to this change swampd would throw a SYSSEGV fault due to an
attempt to use a pointer that was no longer active.

Tested:
Issued a "reset -w" (Warm Reset command) from the EFI shell.
Waited for the system to reboot, and enter EFI
Checked for a core file in /var/lib/systemd/coredump
Repeated step 1 if coredump file was not present.
Completed 2900+ passes successfully when ealier code failed at less
than 800 passes.

Change-Id: Iff4607510db579c36dc34d6f76e6eb2f0250a03a
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>

show more ...


# 7a98c19a 12-Aug-2020 Patrick Venture <venture@google.com>

use ZoneInterface pointers where Dbus aspect not important

The implementation of the ZoneInterface used is the DbusPidZone, however
using the ZoneInterface when the Dbus aspect is unimpo

use ZoneInterface pointers where Dbus aspect not important

The implementation of the ZoneInterface used is the DbusPidZone, however
using the ZoneInterface when the Dbus aspect is unimportant provides for
trivial support of other implementations.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I0ed87322904e7f87e5b5c8a50c01144f3d843a10

show more ...


# 597ebd67 11-Aug-2020 Patrick Venture <venture@google.com>

s/PIDZone/DbusPidZone/g

Renamed PIDZone to DbusPidZone because this object builds in via
inheritance a Dbus implementation of the Mode control interface.

Signed-off-by: Patrick

s/PIDZone/DbusPidZone/g

Renamed PIDZone to DbusPidZone because this object builds in via
inheritance a Dbus implementation of the Mode control interface.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ifc6c11db4952de5909f0e556c41ec25eee217408

show more ...


# a076487a 08-Aug-2020 Patrick Venture <venture@google.com>

sensors/zones: place in namespace and cleanup

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I527dbc8477a232945f696227a7b0b2adbee45175


# ce6a3f36 12-Mar-2019 James Feist <james.feist@linux.intel.com>

Remove threads

This converts phosphor-pid-control into an async
single threaded application. The reason for doing this
is on our systems phosphor-pid-control had the largest
VSZ

Remove threads

This converts phosphor-pid-control into an async
single threaded application. The reason for doing this
is on our systems phosphor-pid-control had the largest
VSZ when viewed under top. Before this patch the VSZ
was at 50720, after it is at 7760.

Tested-by: Could still interact with all interfaces
under rest-dbus and sensor override worked to ramp fans
when changing cpu temps.

Change-Id: Ie0a837bdf0d1b1df61dc7aff87e5d503b9e0e875
Signed-off-by: James Feist <james.feist@linux.intel.com>

show more ...