lkml.org 
[lkml]   [2013]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v00 1/1] PowerCap: Documentation
On Thu, Jul 18, 2013 at 12:34:15PM -0700, Srinivas Pandruvada wrote:
> Added power cap framework documentation. This explains the use of power capping framework,
> sys-fs and programming interface.

Minor nit, it's called "sysfs" no '-' anywhere in the name please.

> +Experimental implantation is using two options:
> +Option 1: Use simple device model. Since we can't have duplicate file names under
> +a class even if there parents are different (Unlike a Linux directory tree), each
> +child will be named using their hierarchy in the tree. For example, a RAPL power
> +zone such as a CPU package can be called intel-rapl-0, then its children will be
> +named as intel-rapl-0:0, intel-rapl-0:1 etc.
> +
> +Option 2: Each controller is a device and zones and constraints under it are
> +created using kobjects. Here exact names of power zones can be used in the sys-fs
> +file names.

Don't ever use "raw" kobjects in the device tree, that way is crazy,
userspace can never see the devices, and you end up having to duplicate
all of the logic that the driver core creates for you.

In short, don't do that, as I will not accept such code into the kernel,
sorry. Work with the driver model, don't get hung up on the names not
being able to be "the same", that restriction is there for a reason, as
you found out (it is exactly like a Linux directory tree, unlike your
statement above, as those names all end up in the same directory in
sysfs, which is why the restriction is there.)

hope this helps,

greg k-h


\
 
 \ /
  Last update: 2013-07-18 23:21    [W:1.009 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site