lkml.org 
[lkml]   [2012]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [linux-pm] [PATCH v4] cpuidle: Add a sysfs entry to disable specific C state for debug purpose.
    On Wed, 14 Mar 2012 11:24:40 +0800
    ShuoX Liu <shuox.liu@intel.com> wrote:

    > From: ShuoX Liu <shuox.liu@intel.com>
    >
    > Some C states of new CPU might be not good. One reason is BIOS might configure
    > them incorrectly. To help developers root cause it quickly, the patch adds a
    > new sysfs entry, so developers could disable specific C state manually.
    >
    > In addition, C state might have much impact on performance tuning, as it takes
    > much time to enter/exit C states, which might delay interrupt processing. With
    > the new debug option, developers could check if a deep C state could impact
    > performance and how much impact it could cause.
    >
    > Also add this option in Documentation/cpuidle/sysfs.txt.
    >
    >
    > ...
    >
    > +#define define_one_state_rw(_name, show, store) \
    > +static struct cpuidle_state_attr attr_##_name = __ATTR(_name, 0644, show, store)
    >
    > ...
    >

    > +#define define_store_state_function(_name) \
    > +static ssize_t store_state_##_name(struct cpuidle_state *state, \
    > + const char *buf, size_t size) \
    > +{ \
    > + long value; \
    > + if (!capable(CAP_SYS_ADMIN)) \
    > + return -EPERM; \

    Is the capability check required? The 0644 permissions aren't sufficient?

    > + kstrtol(buf, 0, &value); \
    > + if (value) \
    > + state->disable = 1; \
    > + else \
    > + state->disable = 0; \
    > + return size; \
    > +}
    >
    > ...
    >


    \
     
     \ /
      Last update: 2012-03-16 22:37    [W:0.021 / U:0.532 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site