[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4EDCFE9F.9050605@linux.vnet.ibm.com>
Date: Mon, 05 Dec 2011 22:55:51 +0530
From: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To: Tejun Heo <tj@...nel.org>
CC: rjw@...k.pl, pavel@....cz, len.brown@...el.com,
ebiederm@...ssion.com, rdunlap@...otime.net,
linux-doc@...r.kernel.org, kexec@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH 1/3] PM / Sleep: Make [un]lock_system_sleep() generic
On 12/05/2011 10:44 PM, Tejun Heo wrote:
> Hello,
>
> On Mon, Dec 05, 2011 at 01:32:38AM +0530, Srivatsa S. Bhat wrote:
>> +static inline void lock_system_sleep(void)
>> +{
>> + /* simplified freezer_do_not_count() */
>> + current->flags |= PF_FREEZER_SKIP;
>> + mutex_lock(&pm_mutex);
>> +}
>> +
>> +static inline void unlock_system_sleep(void)
>> +{
>> + mutex_unlock(&pm_mutex);
>> + /* simplified freezer_count() */
>> + current->flags &= ~PF_FREEZER_SKIP;
>> +}
>
> BTW, don't we want try_to_freeze() there? What's the reason for not
> using freezer_count()?
>
I wanted these APIs to be generic, not restricted to work only for userspace
processes. Both freezer_do_not_count() and freezer_count() are effective only
when current->mm is non-NULL (ie., only for userspace ones).
I think I have documented this in the patch which added these things to the
2 APIs. See commit 6a76b7a in linux-pm/linux-next.
As for try_to_freeze(), we can surely add that. I think I missed it while
open-coding the relevant part of freezer_count(). I'll send it as a separate
patch. Thank you very much.
Regards,
Srivatsa S. Bhat
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists