All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [RFC RESEND 0/3] Add watermark support to devfreq
@ 2014-12-08  7:44 ` MyungJoo Ham
  0 siblings, 0 replies; 10+ messages in thread
From: MyungJoo Ham @ 2014-12-08  7:44 UTC (permalink / raw)
  To: Arto Merilainen, 박경민, tomeu.vizoso, gnurou
  Cc: javier.martinez, linux-pm, linux-kernel, linux-tegra, swarren,
	thierry.reding, grant.likely, srasal

> (Sorry for the spam. I am resending the series because I noted that
> some of the email addresses were mistyped)
> 
> Currently main mechanism to implement scaling using devfreq is
> polling and the device profile is free to set polling interval.
> However, in many cases this approach is not optimal; We may
> unnecessarily use CPU time to determine load on engine that
> is idle most of time - or we may simply read load when we
> already know that the device is busy.
> 
> In some cases a device itself has counters to track its activity
> and possibility to raise interrupts when load goes above or below
> certain threshold.
> 
> This series adds support for watermark events to devfreq and
> introduces two example governors. The first patch adds two
> callbacks to the device profile (for setting watermark) and
> adds a new function call to devfreq that informs of crossed
> watermark.
> 
> The added governors demonstrate usage of the new API. The first
> governor (watermark simple) sets device to trigger low watermark
> event when load goes below 10% and high watermark interrupt when
> the load goes above 60%. Watermark active tries to keep load at
> certain level and it actively sets thresholds based on the
> frequency table in order get interrupts only when the load value
> would affect to the current frequency in re-estimation.

Hi Arto,


Please let me start with somewhat naive high-level question:
  What do you mean by watermark in this context?
Is it a product name of yours (interrupt-based PMU, I presume)?
Or does watermark have another semantics that I am not aware of?
Or do you really mean something like
  http://en.wikipedia.org/wiki/Digital_watermarking

Other itching points include:
- devfreq_watermark_event() was declared but has never been used.
    Who is supposed to call this function?
- Is enum watermark_type supposed to be used out of /drivers/devfreq/* ?
    Otherwise, please move it inside /drivers/devfreq/governor.h
    (I guess it is to be used inside corresponding governors only)
- Could you please watermark-specific interfaces (set_high/low_wmark) into
    its own public header file? (e.g., /include/linux/devfreq/governor_wmark.h)
  I think we can create another (governor_simpleondemand.h) in there as well
    in order to have threshold values configured by device drivers.
  Adding governor-specific configurations into devfreq.h seems not
    appropriate especially when we expect that we may need many different
    governors.

  OR..

  This seems that you can keep set_h/l_wmark functions exposed to
    drivers/devfreq/* only. Therefore, having /drivers/devfreq/governor_wmark.h
    should be sufficient as well, which should be more neat than the above.
  The callbacks are to be defined by the devfreq drivers, aren't they?

- The event name, "DEVFREQ_GOV_WMARK", defined in governor.h, seems to be
    more appropriate if it is named "DEVFREQ_GOV_INTERNAL" as we won't need
    to define event names for each govornor's internal needs.

  OR.. for more generality,
    we may define a macro like:

#define DEVFREQ_GOV_INTERNAL(value)	((0x1 << 31) | (value))
#define GET_DEVFREQ_GOV_INTERNAL(event)	((event) & ~(0x1 << 31))

- In general, I would love to see governors with minimal intervention on
    the framework core/main code, especially when it is not beneficial to
    other governors. Unlike cpufreq, we may contain many different types of
    devices in devfreq, which has the potential to accompany many different
    governors.


Cheers,
MyungJoo.

> 
> Arto Merilainen (1):
>   PM / devfreq: Add watermark active governor
> 
> Shridhar Rasal (2):
>   PM / devfreq: Add watermark events
>   PM / devfreq: Add watermark simple governor
> 
>  drivers/devfreq/Kconfig                 |  18 +++
>  drivers/devfreq/Makefile                |   2 +
>  drivers/devfreq/devfreq.c               |  19 +++
>  drivers/devfreq/governor.h              |   1 +
>  drivers/devfreq/governor_wmark_active.c | 276 ++++++++++++++++++++++++++++++++
>  drivers/devfreq/governor_wmark_simple.c | 245 ++++++++++++++++++++++++++++
>  include/linux/devfreq.h                 |  26 +++
>  7 files changed, 587 insertions(+)
>  create mode 100644 drivers/devfreq/governor_wmark_active.c
>  create mode 100644 drivers/devfreq/governor_wmark_simple.c
> 
> -- 
> 1.8.1.5
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [RFC RESEND 0/3] Add watermark support to devfreq
@ 2014-12-05 13:41 ` Arto Merilainen
  0 siblings, 0 replies; 10+ messages in thread
From: Arto Merilainen @ 2014-12-05 13:41 UTC (permalink / raw)
  To: myungjoo.ham, kyungmin.park, tomeu.vizoso, gnurou
  Cc: javier.martinez, linux-pm, linux-kernel, linux-tegra, swarren,
	thierry.reding, grant.likely, srasal, amerilainen

(Sorry for the spam. I am resending the series because I noted that
some of the email addresses were mistyped)

Currently main mechanism to implement scaling using devfreq is
polling and the device profile is free to set polling interval.
However, in many cases this approach is not optimal; We may
unnecessarily use CPU time to determine load on engine that
is idle most of time - or we may simply read load when we
already know that the device is busy.

In some cases a device itself has counters to track its activity
and possibility to raise interrupts when load goes above or below
certain threshold.

This series adds support for watermark events to devfreq and
introduces two example governors. The first patch adds two
callbacks to the device profile (for setting watermark) and
adds a new function call to devfreq that informs of crossed
watermark.

The added governors demonstrate usage of the new API. The first
governor (watermark simple) sets device to trigger low watermark
event when load goes below 10% and high watermark interrupt when
the load goes above 60%. Watermark active tries to keep load at
certain level and it actively sets thresholds based on the
frequency table in order get interrupts only when the load value
would affect to the current frequency in re-estimation.

Arto Merilainen (1):
  PM / devfreq: Add watermark active governor

Shridhar Rasal (2):
  PM / devfreq: Add watermark events
  PM / devfreq: Add watermark simple governor

 drivers/devfreq/Kconfig                 |  18 +++
 drivers/devfreq/Makefile                |   2 +
 drivers/devfreq/devfreq.c               |  19 +++
 drivers/devfreq/governor.h              |   1 +
 drivers/devfreq/governor_wmark_active.c | 276 ++++++++++++++++++++++++++++++++
 drivers/devfreq/governor_wmark_simple.c | 245 ++++++++++++++++++++++++++++
 include/linux/devfreq.h                 |  26 +++
 7 files changed, 587 insertions(+)
 create mode 100644 drivers/devfreq/governor_wmark_active.c
 create mode 100644 drivers/devfreq/governor_wmark_simple.c

-- 
1.8.1.5


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-12-09 13:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08  7:44 [RFC RESEND 0/3] Add watermark support to devfreq MyungJoo Ham
2014-12-08  7:44 ` MyungJoo Ham
2014-12-08  8:57 ` Tomeu Vizoso
2014-12-08 17:07 ` Arto Merilainen
     [not found]   ` <5485DADF.7020109-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-12-09 13:11     ` Alexandre Courbot
2014-12-09 13:11       ` Alexandre Courbot
  -- strict thread matches above, loose matches on Subject: below --
2014-12-05 13:41 Arto Merilainen
2014-12-05 13:41 ` Arto Merilainen
     [not found] ` <1417786892-477-1-git-send-email-amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-12-09 13:25   ` Tomeu Vizoso
2014-12-09 13:25     ` Tomeu Vizoso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.