From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757369Ab0EZRkW (ORCPT ); Wed, 26 May 2010 13:40:22 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48463 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757138Ab0EZRkU (ORCPT ); Wed, 26 May 2010 13:40:20 -0400 Subject: Re: [PATCH 1/8] PM: Opportunistic suspend support. From: James Bottomley To: Pekka Enberg Cc: Peter Zijlstra , Arve =?ISO-8859-1?Q?Hj=F8nnev=E5g?= , Florian Mickler , "Rafael J. Wysocki" , Alan Stern , Dmitry Torokhov , Linux-pm mailing list , Kernel development list , Len Brown , Pavel Machek , Randy Dunlap , Andrew Morton , Andi Kleen , Cornelia Huck , Tejun Heo , Jesse Barnes , Nigel Cunningham , Ming Lei , Wu Fengguang , Maxim Levitsky , linux-doc@vger.kernel.org, Matthew Garrett , Greg KH , tytso@mit.edu In-Reply-To: References: <201005252344.37639.rjw@sisk.pl> <1274863342.5882.4850.camel@twins> <20100526112303.3fef15a4@schatten.dmk.lab> <1274866402.5882.5051.camel@twins> <1274868384.5882.5169.camel@twins> <1274869262.5882.5222.camel@twins> <1274890736.4467.574.camel@mulgrave.site> Content-Type: text/plain; charset="UTF-8" Date: Wed, 26 May 2010 12:40:11 -0500 Message-ID: <1274895611.4467.805.camel@mulgrave.site> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2010-05-26 at 20:25 +0300, Pekka Enberg wrote: > Hi James, > > 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. > > On Wed, May 26, 2010 at 7:18 PM, James Bottomley > wrote: > > 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. > > Incorrect statement how exactly? A JVM can do mmap(), for example, > just fine through FileChannel.map() so there's no need for > heavy-weight RPC. Incorrect in that an arbitrary C application can't link to a java API. mmap and some other messaging (like signals) is just another form of IPC ... the list I gave wasn't exhaustive. > Furthermore, the whole discussion is moot anyway as > Android runs Dalvik which can be hacked to support whatever > communication mechanism is the best choice here. > > So can we drop the whole "we need to do it in kernel because Java is > hard" nonsense and concentrate on real issues? I've lost you. This argument seems to hinge on whether or not you believe that suspend in any form is a solution to the rogue app problem ... whether it's implemented in Java or C is an ancillary issue. James