<div dir="ltr"><div><span class="gmail-im" style="font-size:12.8px"><span style="font-size:12.8px">Patrick,</span></span></div><span class="gmail-im" style="font-size:12.8px"><span style="font-size:12.8px"><div><span class="gmail-im" style="font-size:12.8px"><span style="font-size:12.8px"><br></span></span></div>></span>> I'm working on a thermal control loop that'll operate within the openbmc<br><span style="font-size:12.8px">></span>> framework(s) and wanted to provide a somewhat high level overview for<br><span style="font-size:12.8px">></span>> thoughts.<br><br></span><span style="font-size:12.8px">> We should connect you with Matt Spinler (mspinler) and Matt Barth</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">(msbarth) on IRC.  They have been working on implementing the "IBM fan</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">control algorithm" but I suspect there is a significant amount of</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">overlap.  Our intention was that you'd be able to reuse our</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">implementation and insert a different (low-level detailed) algorithm.</span><div><br></div><div>Definitely.  I know there's a Google algorithm we use for thermal control that's based on proportional–integral–<span class="gmail-im">derivative.  I'll ping them on IRC to get a peek at their design, roadmap and timeline.  It's also possible because of our specific data center requirements based on configurations, it may be more work to plug-in a different low-level algorithm.  But without seeing the design, it's impossible to say.</span></div><div><span class="gmail-im"><br><span style="font-size:12.8px">>> The general design is to have a daemon that reads fans and temperatures</span><br><span style="font-size:12.8px">>> from dbus (reaching out to phosphor-hwmon) as well as being able to receive</span><br><span style="font-size:12.8px">>> temperatures and other sensor information over an OEM IPMI command.</span><br><br></span><span style="font-size:12.8px">> </span><span style="font-size:12.8px">Sounds good.  This is how it is suppose to work.</span></div><div><br></div><div>Good.  Yeah.  I'll end up running some performance experiments to make sure things are handled quickly enough going through dbus for everything, but I'm sure it will be reasonably quick.<br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">For the IPMI commands, the expectation would be that either the IPMI</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">provider or an application fed by the IPMI provider for these OEM</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">commands would implement the same xyz.openbmc_project.Sensor.</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">Value</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">interface as the phosphor-hwmon.  This way the thermal algorithm really</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">doesn't need to know where the data comes from.</span><br style="font-size:12.8px"><span class="gmail-im" style="font-size:12.8px"><br>Right.  I just need to verify the exact design of that information required.  Discussions today indicated I'd be provided with the temperature margin for the fastest device and the slowest (in terms of thermal adjustment) per zone.  The YAML definition will need to allow for indicating whether a sensor is available to the BMC or is "outside."<br><br><span style="font-size:12.8px">></span>> The system will support zones defined (yes, probably in YAML).  A zone will<br><span style="font-size:12.8px">></span>> have at least one exclusion fan, and at least one thermal sensor.  The<br><span style="font-size:12.8px">></span>> thermal sensor can be shared.  There will be defaults provided in this<br><span style="font-size:12.8px">></span>> configuration to act as fallbacks.<br><br></span><span style="font-size:12.8px">> </span><span style="font-size:12.8px">There is some code available to define zones via YAML.  Matt Spinler can</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">point you at these.</span></div><div><br></div><div>Ok.<br style="font-size:12.8px"><span class="gmail-im" style="font-size:12.8px"><br><span style="font-size:12.8px">></span>> The thermal loop will be margin based and attempt to drive the fans to<br><span style="font-size:12.8px">></span>> maintain the temperature within operating temperature of the zones.  Each<br><span style="font-size:12.8px">></span>> zone will be independently managed.<br><br></span><span style="font-size:12.8px">> </span><span style="font-size:12.8px">These sounds very similar to what their intended design is as well.  For</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">a zone there is a lower-threshold and an upper-threshold.  When the</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">temperature is above the upper-threshold, the fan speed is increased and</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">the fans are decreased when the temperature is below the</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">lower-threshold.  Again, the Matts can give you details on what the "IBM</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">fan control algorithm" design is.</span></div><div><br></div><div>That's the basic idea.<br style="font-size:12.8px"><span class="gmail-im" style="font-size:12.8px"><br><span style="font-size:12.8px">></span>> Because not all thermal sensors can necessarily be ready by the BMC, we<br><span style="font-size:12.8px">></span>> need a method of getting that information from the host.  From a previous<br><span style="font-size:12.8px">></span>> project, we have the notion of sending thermal margins for slow and quick<br>>> (heat change) devices to a controller.<br><br></span><span style="font-size:12.8px">> </span><span style="font-size:12.8px">Is this the Host->BMC via IPMI you mentioned earlier or does the BMC</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">need to actively query the host in some cases?  Hopefully it is always</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">one direction.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">The plan is for Host->BMC only.  The host just feeds thermal information on a cycle to the BMC for those sensors out of reach.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I'm very interested in seeing the design doc, or any code that exists, and especially a timeline.<br></span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Regards,</span></div><div><span style="font-size:12.8px">Patrick</span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 17, 2017 at 7:31 PM, Patrick Williams <span dir="ltr"><<a href="mailto:patrick@stwcx.xyz" target="_blank">patrick@stwcx.xyz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Patrick,<br>
<span class=""><br>
On Mon, Apr 17, 2017 at 01:21:29PM -0700, Patrick Venture wrote:<br>
> I'm working on a thermal control loop that'll operate within the openbmc<br>
> framework(s) and wanted to provide a somewhat high level overview for<br>
> thoughts.<br>
<br>
</span>We should connect you with Matt Spinler (mspinler) and Matt Barth<br>
(msbarth) on IRC.  They have been working on implementing the "IBM fan<br>
control algorithm" but I suspect there is a significant amount of<br>
overlap.  Our intention was that you'd be able to reuse our<br>
implementation and insert a different (low-level detailed) algorithm.<br>
<span class=""><br>
> The general design is to have a daemon that reads fans and temperatures<br>
> from dbus (reaching out to phosphor-hwmon) as well as being able to receive<br>
> temperatures and other sensor information over an OEM IPMI command.<br>
<br>
</span>Sounds good.  This is how it is suppose to work.<br>
<br>
For the IPMI commands, the expectation would be that either the IPMI<br>
provider or an application fed by the IPMI provider for these OEM<br>
commands would implement the same xyz.openbmc_project.Sensor.<wbr>Value<br>
interface as the phosphor-hwmon.  This way the thermal algorithm really<br>
doesn't need to know where the data comes from.<br>
<span class=""><br>
> The system will support zones defined (yes, probably in YAML).  A zone will<br>
> have at least one exclusion fan, and at least one thermal sensor.  The<br>
> thermal sensor can be shared.  There will be defaults provided in this<br>
> configuration to act as fallbacks.<br>
<br>
</span>There is some code available to define zones via YAML.  Matt Spinler can<br>
point you at these.<br>
<span class=""><br>
> The thermal loop will be margin based and attempt to drive the fans to<br>
> maintain the temperature within operating temperature of the zones.  Each<br>
> zone will be independently managed.<br>
<br>
</span>These sounds very similar to what their intended design is as well.  For<br>
a zone there is a lower-threshold and an upper-threshold.  When the<br>
temperature is above the upper-threshold, the fan speed is increased and<br>
the fans are decreased when the temperature is below the<br>
lower-threshold.  Again, the Matts can give you details on what the "IBM<br>
fan control algorithm" design is.<br>
<span class=""><br>
> Because not all thermal sensors can necessarily be ready by the BMC, we<br>
> need a method of getting that information from the host.  From a previous<br>
> project, we have the notion of sending thermal margins for slow and quick<br>
> (heat change) devices to a controller.<br>
<br>
</span>Is this the Host->BMC via IPMI you mentioned earlier or does the BMC<br>
need to actively query the host in some cases?  Hopefully it is always<br>
one direction.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Patrick Williams<br>
</font></span></blockquote></div><br></div>