From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758340Ab2ECT32 (ORCPT ); Thu, 3 May 2012 15:29:28 -0400 Received: from ogre.sisk.pl ([193.178.161.156]:51972 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755395Ab2ECT30 convert rfc822-to-8bit (ORCPT ); Thu, 3 May 2012 15:29:26 -0400 From: "Rafael J. Wysocki" To: Arve =?iso-8859-1?q?Hj=F8nnev=E5g?= Subject: [PATCH 0/2]: Kconfig options for wakelocks limit and gc (was: Re: [RFC][PATCH 8/8] PM / Sleep: Add user space ...) Date: Thu, 3 May 2012 21:29:41 +0200 User-Agent: KMail/1.13.6 (Linux/3.4.0-rc5+; KDE/4.6.0; x86_64; ; ) Cc: NeilBrown , John Stultz , Linux PM list , LKML , Magnus Damm , markgross@thegnar.org, Matthew Garrett , Greg KH , John Stultz , Brian Swetland , Alan Stern , Dmitry Torokhov , "Srivatsa S. Bhat" References: <201202070200.55505.rjw@sisk.pl> <201204272334.04387.rjw@sisk.pl> In-Reply-To: <201204272334.04387.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-Id: <201205032129.41611.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, April 27, 2012, Rafael J. Wysocki wrote: > On Friday, April 27, 2012, Arve Hjønnevåg wrote: > > 2012/4/27 Rafael J. Wysocki : > > > On Friday, April 27, 2012, Arve Hjønnevåg wrote: > > >> 2012/4/26 Rafael J. Wysocki : > > >> ... > > >> > --- > > >> > From: Rafael J. Wysocki > > >> > Subject: PM / Sleep: Add user space interface for manipulating wakeup sources, v3 > > >> > > > >> > Android allows user space to manipulate wakelocks using two > > >> > sysfs file located in /sys/power/, wake_lock and wake_unlock. > > >> > Writing a wakelock name and optionally a timeout to the wake_lock > > >> > file causes the wakelock whose name was written to be acquired (it > > >> > is created before is necessary), optionally with the given timeout. > > >> > Writing the name of a wakelock to wake_unlock causes that wakelock > > >> > to be released. > > >> > > > >> > Implement an analogous interface for user space using wakeup sources. > > >> > Add the /sys/power/wake_lock and /sys/power/wake_unlock files > > >> > allowing user space to create, activate and deactivate wakeup > > >> > sources, such that writing a name and optionally a timeout to > > >> > wake_lock causes the wakeup source of that name to be activated, > > >> > optionally with the given timeout. If that wakeup source doesn't > > >> > exist, it will be created and then activated. Writing a name to > > >> > wake_unlock causes the wakeup source of that name, if there is one, > > >> > to be deactivated. Wakeup sources created with the help of > > >> > wake_lock that haven't been used for more than 5 minutes are garbage > > >> > collected and destroyed. Moreover, there can be only WL_NUMBER_LIMIT > > >> > > >> I think it would be better if the garbage collection and limit was > > >> configurable and optional. I would probably turn both features off > > >> since I do not want to chase down bugs because a wakelock was ignored, > > >> and I think the garbage collection will erase stats that we care > > >> about. > > > > > > OK, but would you mind if I added the configurability as a separate incremental > > > patch? > > > > > > > That is fine with me. > > Cool, thanks! The following two patches add the configuration options for the limit and garbage collector. Please let me know if they are OK with you. Thanks, Rafael