Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751262AbbD2UZH (ORCPT ); Wed, 29 Apr 2015 16:25:07 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:33940 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750997AbbD2UZD (ORCPT ); Wed, 29 Apr 2015 16:25:03 -0400 MIME-Version: 1.0 In-Reply-To: References: <20150423163616.GA10874@kroah.com> <20150423171640.GA11227@kroah.com> <553A4A2F.5090406@samsung.com> <20150428171840.GB11351@thunk.org> <21824.5086.446831.189915@quad.stoffel.home> <5540D2F9.2010704@redhat.com> <55413158.5060808@gmail.com> From: Andy Lutomirski Date: Wed, 29 Apr 2015 13:24:40 -0700 Message-ID: Subject: Re: [GIT PULL] kdbus for 4.1-rc1 To: David Lang Cc: Austin S Hemmelgarn , Harald Hoyer , Arnd Bergmann , Havoc Pennington , "linux-kernel@vger.kernel.org" , Jiri Kosina , Andrew Morton , Daniel Mack , One Thousand Gnomes , Linus Torvalds , Lukasz Skalski , "Theodore Ts'o" , Tom Gundersen , Greg Kroah-Hartman , David Herrmann , "Eric W. Biederman" , John Stoffel , Djalal Harouni Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2134 Lines: 57 On Wed, Apr 29, 2015 at 1:15 PM, David Lang wrote: > On Wed, 29 Apr 2015, Andy Lutomirski wrote: > >> On Wed, Apr 29, 2015 at 12:30 PM, Austin S Hemmelgarn >> wrote: >>> >>> On 2015-04-29 14:54, Andy Lutomirski wrote: >>>> >>>> >>>> On Apr 29, 2015 5:48 AM, "Harald Hoyer" wrote: >>>>> >>>>> >>>>> >>>>> * Being in the kernel closes a lot of races which can't be fixed with >>>>> the current userspace solutions. For example, with kdbus, there is >>>>> a >>>>> way a client can disconnect from a bus, but do so only if no >>>>> further >>>>> messages present in its queue, which is crucial for implementing >>>>> race-free "exit-on-idle" services >>>> >>>> >>>> >>>> This can be implemented in userspace. >>>> >>>> Client to dbus daemon: may I exit now? >>>> Dbus daemon to client: yes (and no more messages) or no >>>> >>> Depending on how this is implemented, there would be a potential issue if >>> a >>> message arrived for the client after the daemon told it it could exit, >>> but >>> before it finished shutdown, in which case the message might get lost. >>> >> >> Then implement it the right way? The client sends some kind of >> sequence number with its request. > > > so any app in the system can prevent any other app from exiting/restarting > by just sending it the equivalent of a ping over dbus? > > preventing an app from exiting because there are unhandled messages doesn't > mean that those messages are going to be handled, just that they will get > read and dropped on the floor by an app trying to exit. Sometimes you will > just end up with a hung app that can't process messages and needs to be > restarted, but can't be restarted because there are pending messages. I think this consideration is more or less the same whether it's handled in the kernel or in userspace, though. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/