16 Nov, 2010

1 commit


25 Oct, 2010

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Update broken web addresses in arch directory.
    Update broken web addresses in the kernel.
    Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget
    Revert "Fix typo: configuation => configuration" partially
    ida: document IDA_BITMAP_LONGS calculation
    ext2: fix a typo on comment in ext2/inode.c
    drivers/scsi: Remove unnecessary casts of private_data
    drivers/s390: Remove unnecessary casts of private_data
    net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
    drivers/infiniband: Remove unnecessary casts of private_data
    drivers/gpu/drm: Remove unnecessary casts of private_data
    kernel/pm_qos_params.c: Remove unnecessary casts of private_data
    fs/ecryptfs: Remove unnecessary casts of private_data
    fs/seq_file.c: Remove unnecessary casts of private_data
    arm: uengine.c: remove C99 comments
    arm: scoop.c: remove C99 comments
    Fix typo configue => configure in comments
    Fix typo: configuation => configuration
    Fix typo interrest[ing|ed] => interest[ing|ed]
    Fix various typos of valid in comments
    ...

    Fix up trivial conflicts in:
    drivers/char/ipmi/ipmi_si_intf.c
    drivers/usb/gadget/rndis.c
    net/irda/irnet/irnet_ppp.c

    Linus Torvalds
     

15 Oct, 2010

1 commit

  • All file_operations should get a .llseek operation so we can make
    nonseekable_open the default for future file operations without a
    .llseek pointer.

    The three cases that we can automatically detect are no_llseek, seq_lseek
    and default_llseek. For cases where we can we can automatically prove that
    the file offset is always ignored, we use noop_llseek, which maintains
    the current behavior of not returning an error from a seek.

    New drivers should normally not use noop_llseek but instead use no_llseek
    and call nonseekable_open at open time. Existing drivers can be converted
    to do the same when the maintainer knows for certain that no user code
    relies on calling seek on the device file.

    The generated code is often incorrectly indented and right now contains
    comments that clarify for each added line why a specific variant was
    chosen. In the version that gets submitted upstream, the comments will
    be gone and I will manually fix the indentation, because there does not
    seem to be a way to do that using coccinelle.

    Some amount of new code is currently sitting in linux-next that should get
    the same modifications, which I will do at the end of the merge window.

    Many thanks to Julia Lawall for helping me learn to write a semantic
    patch that does all this.

    ===== begin semantic patch =====
    // This adds an llseek= method to all file operations,
    // as a preparation for making no_llseek the default.
    //
    // The rules are
    // - use no_llseek explicitly if we do nonseekable_open
    // - use seq_lseek for sequential files
    // - use default_llseek if we know we access f_pos
    // - use noop_llseek if we know we don't access f_pos,
    // but we still want to allow users to call lseek
    //
    @ open1 exists @
    identifier nested_open;
    @@
    nested_open(...)
    {

    }

    @ open exists@
    identifier open_f;
    identifier i, f;
    identifier open1.nested_open;
    @@
    int open_f(struct inode *i, struct file *f)
    {

    }

    @ read disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {

    }

    @ read_no_fpos disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ write @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {

    }

    @ write_no_fpos @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ fops0 @
    identifier fops;
    @@
    struct file_operations fops = {
    ...
    };

    @ has_llseek depends on fops0 @
    identifier fops0.fops;
    identifier llseek_f;
    @@
    struct file_operations fops = {
    ...
    .llseek = llseek_f,
    ...
    };

    @ has_read depends on fops0 @
    identifier fops0.fops;
    identifier read_f;
    @@
    struct file_operations fops = {
    ...
    .read = read_f,
    ...
    };

    @ has_write depends on fops0 @
    identifier fops0.fops;
    identifier write_f;
    @@
    struct file_operations fops = {
    ...
    .write = write_f,
    ...
    };

    @ has_open depends on fops0 @
    identifier fops0.fops;
    identifier open_f;
    @@
    struct file_operations fops = {
    ...
    .open = open_f,
    ...
    };

    // use no_llseek if we call nonseekable_open
    ////////////////////////////////////////////
    @ nonseekable1 depends on !has_llseek && has_open @
    identifier fops0.fops;
    identifier nso ~= "nonseekable_open";
    @@
    struct file_operations fops = {
    ... .open = nso, ...
    +.llseek = no_llseek, /* nonseekable */
    };

    @ nonseekable2 depends on !has_llseek @
    identifier fops0.fops;
    identifier open.open_f;
    @@
    struct file_operations fops = {
    ... .open = open_f, ...
    +.llseek = no_llseek, /* open uses nonseekable */
    };

    // use seq_lseek for sequential files
    /////////////////////////////////////
    @ seq depends on !has_llseek @
    identifier fops0.fops;
    identifier sr ~= "seq_read";
    @@
    struct file_operations fops = {
    ... .read = sr, ...
    +.llseek = seq_lseek, /* we have seq_read */
    };

    // use default_llseek if there is a readdir
    ///////////////////////////////////////////
    @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier readdir_e;
    @@
    // any other fop is used that changes pos
    struct file_operations fops = {
    ... .readdir = readdir_e, ...
    +.llseek = default_llseek, /* readdir is present */
    };

    // use default_llseek if at least one of read/write touches f_pos
    /////////////////////////////////////////////////////////////////
    @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read.read_f;
    @@
    // read fops use offset
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = default_llseek, /* read accesses f_pos */
    };

    @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ... .write = write_f, ...
    + .llseek = default_llseek, /* write accesses f_pos */
    };

    // Use noop_llseek if neither read nor write accesses f_pos
    ///////////////////////////////////////////////////////////

    @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    identifier write_no_fpos.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ...
    .write = write_f,
    .read = read_f,
    ...
    +.llseek = noop_llseek, /* read and write both use no f_pos */
    };

    @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write_no_fpos.write_f;
    @@
    struct file_operations fops = {
    ... .write = write_f, ...
    +.llseek = noop_llseek, /* write uses no f_pos */
    };

    @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    @@
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = noop_llseek, /* read uses no f_pos */
    };

    @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    @@
    struct file_operations fops = {
    ...
    +.llseek = noop_llseek, /* no read or write fn */
    };
    ===== End semantic patch =====

    Signed-off-by: Arnd Bergmann
    Cc: Julia Lawall
    Cc: Christoph Hellwig

    Arnd Bergmann
     

23 Sep, 2010

1 commit


11 Sep, 2010

1 commit


27 Aug, 2010

1 commit


25 Aug, 2010

1 commit


19 Jul, 2010

2 commits

  • All current users of pm_qos_add_request() have the ability to supply
    the memory required by the pm_qos routines, so make them do this and
    eliminate the kmalloc() with pm_qos_add_request(). This has the
    double benefit of making the call never fail and allowing it to be
    called from atomic context.

    Signed-off-by: James Bottomley
    Signed-off-by: mark gross
    Signed-off-by: Rafael J. Wysocki

    James Bottomley
     
  • A lot of the pm_qos extremal value handling is really duplicating what a
    priority ordered list does, just in a less efficient fashion. Simply
    redoing the implementation in terms of a plist gets rid of a lot of this
    junk (although there are several other strange things that could do with
    tidying up, like pm_qos_request_list has to carry the pm_qos_class with
    every node, simply because it doesn't get passed in to
    pm_qos_update_request even though every caller knows full well what
    parameter it's updating).

    I think this redo is a win independent of android, so we should do
    something like this now.

    Signed-off-by: James Bottomley
    Signed-off-by: mark gross
    Signed-off-by: Rafael J. Wysocki

    James Bottomley
     

17 May, 2010

1 commit

  • This update handles a use case where pm_qos update requests need to
    silently fail if the update is being sent to a handle that is NULL.

    The problem was that the original pm_qos silently fails when a request
    update is passed to a parameter that has not been added to the list yet.
    This update restores that behavior.

    Signed-off-by: markgross
    Signed-off-by: Rafael J. Wysocki

    Mark Gross
     

11 May, 2010

1 commit

  • This patch changes the string based list management to a handle base
    implementation to help with the hot path use of pm-qos, it also renames
    much of the API to use "request" as opposed to "requirement" that was
    used in the initial implementation. I did this because request more
    accurately represents what it actually does.

    Also, I added a string based ABI for users wanting to use a string
    interface. So if the user writes 0xDDDDDDDD formatted hex it will be
    accepted by the interface. (someone asked me for it and I don't think
    it hurts anything.)

    This patch updates some documentation input I got from Randy.

    Signed-off-by: markgross
    Signed-off-by: Rafael J. Wysocki

    Mark Gross
     

14 Oct, 2009

2 commits

  • "name" is a poor name for a file-global variable. It was used in three
    different functions, with no mutual exclusion. But it's just a tiny,
    temporary string; let's just move it onto the stack in the functions that
    need it. Also use snprintf() just in case.

    Signed-off-by: Jonathan Corbet
    LKML-Reference:
    Acked-by: Mark Gross
    Reviewed-by: Frederic Weisbecker
    Signed-off-by: Thomas Gleixner

    Jonathan Corbet
     
  • pm_qos_power_open got its lock_kernel() calls from the open() pushdown. A
    look at the code shows that the only global resources accessed are
    pm_qos_array and "name". pm_qos_array doesn't change (things pointed to
    therein do change, but they are atomics and/or are protected by
    pm_qos_lock). Accesses to "name" are totally unprotected with or without
    the BKL; that will be fixed shortly. The BKL is not helpful here; take it
    out.

    Signed-off-by: Jonathan Corbet
    LKML-Reference:
    Acked-by: Mark Gross
    Reviewed-by: Frederic Weisbecker
    Signed-off-by: Thomas Gleixner

    Jonathan Corbet
     

03 Sep, 2008

1 commit

  • Make PM_QOS and CPU_IDLE play nicer when run with the RT-Preempt kernel.

    The purpose of the patch is to remove the spin_lock around the read in the
    function pm_qos_requirement - since spinlocks can sleep in -rt and this
    function is called from idle.

    CPU_IDLE polls the target_value's of some of the pm_qos parameters from
    the idle loop causing sleeping locking warnings. Changing the
    target_value to an atomic avoids this issue.

    Remove the spinlock in pm_qos_requirement by making target_value an atomic
    type.

    Signed-off-by: mark gross
    Signed-off-by: John Kacur
    Cc: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    John Kacur
     

06 Aug, 2008

1 commit

  • A documentation cleanup patch. With a minor tweak to clarify units for
    kbs.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: mark gross
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Hughes
     

03 Jul, 2008

1 commit


06 Feb, 2008

1 commit

  • The following patch is a generalization of the latency.c implementation done
    by Arjan last year. It provides infrastructure for more than one parameter,
    and exposes a user mode interface for processes to register pm_qos
    expectations of processes.

    This interface provides a kernel and user mode interface for registering
    performance expectations by drivers, subsystems and user space applications on
    one of the parameters.

    Currently we have {cpu_dma_latency, network_latency, network_throughput} as
    the initial set of pm_qos parameters.

    The infrastructure exposes multiple misc device nodes one per implemented
    parameter. The set of parameters implement is defined by pm_qos_power_init()
    and pm_qos_params.h. This is done because having the available parameters
    being runtime configurable or changeable from a driver was seen as too easy to
    abuse.

    For each parameter a list of performance requirements is maintained along with
    an aggregated target value. The aggregated target value is updated with
    changes to the requirement list or elements of the list. Typically the
    aggregated target value is simply the max or min of the requirement values
    held in the parameter list elements.

    >From kernel mode the use of this interface is simple:

    pm_qos_add_requirement(param_id, name, target_value):

    Will insert a named element in the list for that identified PM_QOS
    parameter with the target value. Upon change to this list the new target is
    recomputed and any registered notifiers are called only if the target value
    is now different.

    pm_qos_update_requirement(param_id, name, new_target_value):

    Will search the list identified by the param_id for the named list element
    and then update its target value, calling the notification tree if the
    aggregated target is changed. with that name is already registered.

    pm_qos_remove_requirement(param_id, name):

    Will search the identified list for the named element and remove it, after
    removal it will update the aggregate target and call the notification tree
    if the target was changed as a result of removing the named requirement.

    >From user mode:

    Only processes can register a pm_qos requirement. To provide for
    automatic cleanup for process the interface requires the process to register
    its parameter requirements in the following way:

    To register the default pm_qos target for the specific parameter, the
    process must open one of /dev/[cpu_dma_latency, network_latency,
    network_throughput]

    As long as the device node is held open that process has a registered
    requirement on the parameter. The name of the requirement is
    "process_" derived from the current->pid from within the open system
    call.

    To change the requested target value the process needs to write a s32
    value to the open device node. This translates to a
    pm_qos_update_requirement call.

    To remove the user mode request for a target value simply close the device
    node.

    [akpm@linux-foundation.org: fix warnings]
    [akpm@linux-foundation.org: fix build]
    [akpm@linux-foundation.org: fix build again]
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: mark gross
    Cc: "John W. Linville"
    Cc: Len Brown
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: Arjan van de Ven
    Cc: Venki Pallipadi
    Cc: Adam Belay
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Gross