[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201005042202.40197.rjw@sisk.pl>
Date: Tue, 4 May 2010 22:02:40 +0200
From: "Rafael J. Wysocki" <rjw@...k.pl>
To: Arve Hjønnevåg <arve@...roid.com>
Cc: Alan Stern <stern@...land.harvard.edu>,
"Linux-pm mailing list" <linux-pm@...ts.linux-foundation.org>,
Kernel development list <linux-kernel@...r.kernel.org>,
Tejun Heo <tj@...nel.org>, Oleg Nesterov <oleg@...hat.com>,
Randy Dunlap <rdunlap@...otime.net>,
Andrew Morton <akpm@...ux-foundation.org>,
Ryusuke Konishi <konishi.ryusuke@....ntt.co.jp>,
Jim Collar <jim.collar@...are.net>,
"Greg Kroah-Hartman" <gregkh@...e.de>, Avi Kivity <avi@...hat.com>,
Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
Cornelia Huck <cornelia.huck@...ibm.com>,
Nigel Cunningham <nigel@...onice.net>,
linux-doc@...r.kernel.org
Subject: Re: [PATCH 2/8] PM: suspend_block: Add driver to access suspend blockers from user-space
On Tuesday 04 May 2010, Arve Hjønnevåg wrote:
> 2010/5/3 Rafael J. Wysocki <rjw@...k.pl>:
> > On Monday 03 May 2010, Arve Hjønnevåg wrote:
> >> On Mon, May 3, 2010 at 8:03 AM, Rafael J. Wysocki <rjw@...k.pl> wrote:
> >> > On Sunday 02 May 2010, Alan Stern wrote:
> >> >> On Sun, 2 May 2010, Rafael J. Wysocki wrote:
> >> >>
> >> >> > Hmm. It doesn't seem to be possible to create two different suspend blockers
> >> >> > using the same file handle. So, what exactly is a process supposed to do to
> >> >> > use two suspend blockers at the same time?
> >> >>
> >> >> Open the file twice, thereby obtaining two file handles.
> >> >
> >> > Well, that's what I thought.
> >> >
> >> > I must admit I'm not really comfortable with this interface. IMO it would
> >> > be better if _open() created the suspend blocker giving it a name based on
> >> > the name of the process that called it. Something like
> >> > "<process name>_<timestamp>" might work at first sight.
> >> >
> >> > Alternatively, "<process_name><number>", where <number> is 0 for the first
> >> > suspend blocker created by the given process, 1 for the second one etc., also
> >> > seems to be doable.
> >>
> >> I think it is important to let user-space specify the name. If a
> >> process uses multiple suspend blockers, it is impossible to tell what
> >> each one is used for if they are automatically named.
> >
> > Well, the problem is the only purpose of this is user space debugging, isn't it?
> >
> At the moment, yes.
OK
> But having an explicit init call also simplifies future expansion.
That's irrelevant. Let's focus _only_ on the "at the moment" part, please.
And BTW, a "future expansion" is not relevant at all to the patchset at hand
and let's work with this assumption from now on. OK?
> If we ever need to add back multiple types of
> suspend blockers, we can add an init call with a type argument and
> have the current init call use the default type. If the past we have
> had types that keeps the screen on and prevented idle sleep modes. In
> the future we could for instance want to specify if a suspend blocker
> should prevent suspend when the battery is low or when the lid is
> closed.
_If_ we ever do anything like thie, _then_ we will extend the interface.
> > Now, while I don't think it's generally bad to provide kernel interfaces
> > helping to debug user space, I'm not quite sure if that should be done at the
> > expense of the clarity of kernel-user space interfaces.
> >
> > I wonder how many cases there are in which distinguishing between suspend
> > blockers used by the same user space task is practically relevant.
> >
>
> I think all of them (when more than one suspend blocker is used).
So how many user space processes use more than one suspend blocker right
now on Android? I'm interested only in the order of magnitude.
Rafael
--
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