cpuidle - fix lock contention in the idle path

Bug #1098343 reported by Daniel Lezcano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro PMWG Kernel
Fix Committed
High
Daniel Lezcano

Bug Description

    Commit bf4d1b5 (cpuidle: support multiple drivers) introduced
    locking in cpuidle_get_cpu_driver(), which is used in the
    idle_call() function.

    This leads to a contention problem with a large number of CPUs,
    because they all try to run the idle routine at the same time.

    The lock can be safely removed because of how is used the cpuidle
    API. Namely, cpuidle_register_driver() is called first, but the
    cpuidle idle function is not entered before cpuidle_register_device()
    is called, because the cpuidle device is not enabled then. Moreover,
    cpuidle_unregister_driver(), which would reset the driver value to
    NULL, is not called before cpuidle_unregister_device().

    All of the cpuidle drivers use the API in the same way.

    In general, a cleanup around the lock is necessary and a proper
    refcounting mechanism should be used to ensure the consistency in the
    API (for example, cpuidle_unregister_driver() should fail if the
    driver's refcount is not 0). However, these modifications will require
    some code reorganization and rewrite which will be too intrusive for
    a fix.

Revision history for this message
Daniel Lezcano (daniel-lezcano) wrote :

Fixed with commit ac34d7c8c87c247db0270285950753da045acaad

Changed in linaro-power-kernel:
importance: Undecided → High
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.