[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1274890736.4467.574.camel@mulgrave.site>
Date: Wed, 26 May 2010 11:18:56 -0500
From: James Bottomley <James.Bottomley@...e.de>
To: Pekka Enberg <penberg@...helsinki.fi>
Cc: Peter Zijlstra <peterz@...radead.org>,
Arve Hjønnevåg <arve@...roid.com>,
Florian Mickler <florian@...kler.org>,
"Rafael J. Wysocki" <rjw@...k.pl>,
Alan Stern <stern@...land.harvard.edu>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Linux-pm mailing list <linux-pm@...ts.linux-foundation.org>,
Kernel development list <linux-kernel@...r.kernel.org>,
Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
Randy Dunlap <rdunlap@...otime.net>,
Andrew Morton <akpm@...ux-foundation.org>,
Andi Kleen <ak@...ux.intel.com>,
Cornelia Huck <cornelia.huck@...ibm.com>,
Tejun Heo <tj@...nel.org>,
Jesse Barnes <jbarnes@...tuousgeek.org>,
Nigel Cunningham <nigel@...onice.net>,
Ming Lei <tom.leiming@...il.com>,
Wu Fengguang <fengguang.wu@...el.com>,
Maxim Levitsky <maximlevitsky@...il.com>,
linux-doc@...r.kernel.org, Matthew Garrett <mjg59@...f.ucam.org>,
Greg KH <gregkh@...e.de>, tytso@....edu
Subject: Re: [PATCH 1/8] PM: Opportunistic suspend support.
On Wed, 2010-05-26 at 13:29 +0300, Pekka Enberg wrote:
> Yup, I don't quite get Arve's argument either. C code can interact
> with Java code (and vice versa) just fine in userspace.
This is an incorrect statement. It's possible for java to call C via
the JNI, even though there are quite a few gotchas that mean not just
*any* C code can do it (been there, tripped over some of them, although
they were all ultimately ironed out). It's very difficult for C to call
directly into Java without being specially coded because it involves
creating and managing a JVM (so in general, arbitrary C code can't do
this). The usual way we do C -> Java is process to process via some
intermediary like RPC or Corba or SOAP (or even JSON) ... which gets
very messy for a mobile device.
On Wed, 2010-05-26 at 12:21 +0200, Peter Zijlstra wrote:
> So provide a C interface to it as well?
The way Android is currently coded, all user space suspend blocks are
handled in Java code at what's called the Frameworks layer (Frameworks
is the Java API for apps) this is also how the suspend permissions are
managed and presented to the user. The few C applications which block
suspend just manipulate the device directly.
> Surely you can have the java thing have a unix socket or something a C
> app can talk to. That shouldn't be hard at all.
>
> Or make the suspend manager a C proglet and provide a JNI interface,
> or whatever.
It's a fairly large piece of code to try to rewrite in C, so I don't
think that's feasible on a reasonable timescale. Android does have the
concept of special sockets that can be used to communicate from less to
more privileged processes (it has a very segmented runtime model), so
these might be usable ... they have a drawback that they're essentially
named pipes, so no multiplexing, but one per suspend influencing C
process shouldn't be a huge burden.
James
--
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