lkml.org 
[lkml]   [2011]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v3] PM/Memory-hotplug: Avoid task freezing failures
    Hello, Srivatsa.

    On Mon, Nov 21, 2011 at 10:06:39AM +0530, Srivatsa S. Bhat wrote:
    > void lock_system_sleep(void)
    > {
    > /* simplified freezer_do_not_count() */
    > current->flags |= PF_FREEZER_SKIP;
    >
    > mutex_lock(&pm_mutex);
    >
    > }
    >
    > void unlock_system_sleep(void)
    > {
    > mutex_unlock(&pm_mutex);
    >
    > /* simplified freezer_count() */
    > current->flags &= ~PF_FREEZER_SKIP;
    >
    > }
    >
    > We probably don't want the restriction that freezer_do_not_count() and
    > freezer_count() work only for userspace tasks. So I have open coded
    > the relevant parts of those functions here.
    >
    > I haven't tested this solution yet. Let me know if this solution looks
    > good and I'll send it out as a patch after testing and analyzing some
    > corner cases, if any.

    Ooh ooh, I definitely like this one much better. Oleg did something
    similar w/ wait_event_freezekillable() too. On related notes,

    * I think it would be better to remove direct access to pm_mutex and
    use [un]lock_system_sleep() universally. I don't think hinging it
    on CONFIG_HIBERNATE_CALLBACKS buys us anything.

    * In the longer term, we should be able to toggle PF_NOFREEZE instead
    as SKIP doesn't mean anything different. We'll probably need a
    better API tho. But for now SKIP should work fine.

    Thank you.

    --
    tejun


    \
     
     \ /
      Last update: 2011-11-21 17:43    [W:7.317 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site