[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] DVFS and Thermal management subsystem proposal


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Thu, 7 Jul 2022 12:06:38 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+GTJ/PGTCIjb+M63Zhn/rEyohdqXK81GiesLJm41nJc=; b=J8yUIkp1uDnxsDF2vNuQ+Hc93ZnZOAXn+ns65OtOYnF0xxIWxfTJj2fq5GvKMQRAUu1ncPt4QjsfFko7vvfO7G2dPMCjoJgOwlkfiuyRaTEB6H/y3SM/AtfaoaPby81tN/DIPnr4JmgQpYaPjpt3H6eaa6Hyd64x/YKf3nvlHlB9gPwtAyZcoZ/WZHqhSdRItPStaYQjngEW1N83am8XY0fOcuh/h4cxek3Ok0SZVXdbyjxhmVHX3P1X2ndQN6NyIpqsR6Wajjt6+/SO6mx35mBQczsGPVHTv3cU3VG2NJgrqW+FnM8ur91PObotahf691o1tqidwT4KfQrM5zgTJQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HRWGbBSbIGuz1BF16vmi/wnRtSHjUlyixsh8p3if1M2g1YYKMFy5lKsfQQp6cZo9c0AFf1/tl97VYVV9VHxjnUwrH6Cc5BqFFLh9QLtWRAkqMf8wUcKJd2zKhJeC0mdQx67N4qu2sgNp7zvgJJ+oc3XL2u45XbUqSGOrZtAMZUwHyhDjsszM3+rFaEPB/aW1M6fSRajDy8eNlFZn3gZWTvZO48w7SFFEalTOR0ZfvcGRN7oWGDFW2glCW+r+GCNvGW9AstJ1ryFXH6v1Y770afq/Dvr5R4nJLT7wkV1rnDFYUH7EYinUUldD60laA1+vdUnI+Jpx8VIXs6/Niw4RNw==
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Nick Rosbrook <rosbrookn@xxxxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 07 Jul 2022 12:06:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYke02Cidd2c7KkEyfmAiMVFzcy61yzQ4AgAADHAA=
  • Thread-topic: [RFC] DVFS and Thermal management subsystem proposal

Hi Jan,

On Thu, Jul 07, 2022 at 01:55:30PM +0200, Jan Beulich wrote:
> On 07.07.2022 12:35, Oleksii Moisieiev wrote:
> > # Synopsis
> > This document is intended to describe the design of the thermal based cpu
> > throttling in virtualized environments. The goal is to provide generic 
> > thermal
> > management subsystem, which should work with existing cpufreq subsystem in 
> > XEN
> > and could be used on various architectures and hardware.
> 
> Looks quite plausible to me, just two questions:
> 
> > # Cpufreq subsystem in XEN
> > 
> > ## Brief overview
> > 
> >    Governors
> > +--------------------+
> > | +----------------+ |  struct cpufreq_governor {
> > | |  ondemand      | |      .name
> > | +----------------+ |      .governor
> > | +----------------+ |      .handle_option
> > | |  powersave     | |  }
> > | +----------------+ |
> > | +----------------+ |                              +----------------------+
> > | |  performance   | |->cpufreq_register_governor() | +-------------------+|
> > | +----------------+ |                              | |  cpufreq_dev_drv  ||
> > | +----------------+ |   cpufreq_register_driver()->| +-------------------+|
> > | |  userspace     | |                              | +-------------------+|
> > | +----------------+ |                              | |     ...           ||
> > | +----------------+ |                              | +-------------------+|
> > | |  ...           | |    struct cpufreq_driver {   +----------------------+
> > | +----------------+ |       .init                  +----------------------+
> > +--------------------+       .verify                |    Hardware          |
> >                              .setpolicy             +----------------------+
> >                              .update
> >                              .target
> >                              .get
> >                              .getavg
> >                              .exit
> >                           }
> > 
> > Cpufreq subsystem consists of 2 parts:
> > 1) Cpufreq governor, which should be registered using 
> > cpufreq_register_governor
> > call;
> > 2) Cpufreq driver, which provides access to the hardware should be 
> > registered
> > using cpufreq_register_driver call.
> > 
> > ## Hardware drivers
> > 
> > There are two Cpufreq hardware drivers implemented by us (see Appendix 1 and
> > Appendix 2) to provide support for Rcar-3 and i.MX8 boards. Those drivers 
> > are
> > designed to support thermal throttling subsystem. They are going to be the 
> > part
> > of the contribution package.
> 
> Are these drivers also intended to act as "ordinary" cpufreq drivers,
> i.e. controlled by cpufreq governors instead of thermal ones?
> 

The idea is that cpufreq drivers acts as ordinary cpufreq drivers,
controlled by cpufreq governors if temperature is fine. But cpufreq opp
level can be overriden by thermal subsystem if critical or passive
temperature was reached.

> > # XEN Dynamic Thermal management design
> > 
> > ## Synopsis
> > 
> > Introducing the design of the Dynamic Thermal Management for Xen hypervisor.
> > This feature is an enhancement of the Xen DVFS feature and will allow system
> > admin to configure different thermal governors which will perform CPU
> > throttling, based on the CPU cores temperature and thermal configuration.
> > 
> > ## Top level design.
> > 
> > +-----------------------------------------------+
> > |    XEN                                        |
> > |              +-------------------+            |
> > |              |      Thermal      |            |
> > |       +----->|     Governor      |            |
> > |       |      +---------|---------+            |
> > |       |                |                      |
> > |       |                +-------+              |
> > |       |                        |              |
> > |  +------------------+  +------------------+   |
> > |  |   Thermal        |  |    Cpufreq       |   |
> > |  |   Driver         |  |                  |   |
> > |  +------------------+  +------------------+   |
> > |                                               |
> > +-----------------------------------------------+
> >                     ^
> >                     |
> >                     |
> >            +--------v--------+
> >            |                 |
> >            |    Hardware     |
> >            |                 |
> >            +-----------------+
> > 
> > 
> > ## Thermal management subsystem design in XEN
> > 
> >  +------------------+
> >  | +--------------+ |
> >  | |  powersave   | |               struct thermal_governor {
> >  | +--------------+ |                   .name
> >  | +--------------+ |                   .governor
> >  | |   stepwise   | |<------------+     .handle_option
> >  | +--------------+ |             | }
> >  | +--------------+ |             |
> >  | |     ...      | |             |
> >  | +--------------+ |             |
> >  +------------------+             v
> >           +----------------->register_thermal_governor()
> >           |
> > +---------v--------+                         Polling temperature
> > |   dyn_thermal    |<--------+             +--------------------+
> > +------------------+         +------------>|  polling_handler() |
> >                                            +--------------------+
> 
> Polling (only)?
> 
Here I described "worst" scenario when HW do not support IRQ in case of
alert. Both Rcar-3 and i.MX8 patforms have alerts so drivers will use
irq handlers to do throttling.

Best regards,
Oleksii.


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.