Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756646AbbDOX1m (ORCPT ); Wed, 15 Apr 2015 19:27:42 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:36030 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753225AbbDOX1d (ORCPT ); Wed, 15 Apr 2015 19:27:33 -0400 Date: Thu, 16 Apr 2015 00:27:16 +0100 From: Al Viro To: Andy Lutomirski Cc: One Thousand Gnomes , Greg Kroah-Hartman , Steven Rostedt , Richard Weinberger , "Eric W. Biederman" , Linus Torvalds , Andrew Morton , Arnd Bergmann , Tom Gundersen , Jiri Kosina , "linux-kernel@vger.kernel.org" , Daniel Mack , David Herrmann , Djalal Harouni Subject: Re: [GIT PULL] kdbus for 4.1-rc1 Message-ID: <20150415232716.GS889@ZenIV.linux.org.uk> References: <20150415154551.GE6801@home.goodmis.org> <20150415163520.GA25105@kroah.com> <20150415130649.6f9ab20f@gandalf.local.home> <20150415173145.GA26146@kroah.com> <20150415225611.0c256ea6@lxorguk.ukuu.org.uk> <20150415221804.GP889@ZenIV.linux.org.uk> <20150415224854.GQ889@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2072 Lines: 45 On Wed, Apr 15, 2015 at 03:54:10PM -0700, Andy Lutomirski wrote: > Huh, interesting. > > I was imagining that each of a server's peers (capability holders) > would have a fresh struct file, but maybe this wouldn't be needed at > all. You'd still need a way to get replies to your request, but the > API could just as easily be: > > int send_to_capability(int dest, int source, const void *data, size_t len, ...); > > where dest would be the destination's fd and source would be whatever > receive queue I expect the response on. > > So maybe this is feasible. It doesn't solve broadcasts, but dbus > unicast could easily layer over a facility like this and the context > switch problem would go away for unicast. > > Heck, I'd use it for my own proprietary stuff, too. It would be way > easier than the absurd tangle of socketpairs I currently use. BTW, the main issue with AF_UNIX passing is that recepient isn't asleep awaiting for descriptors - they are thrown by sender at whoever's receiving and sit there until somebody gets around to picking them. _IF_ we had client: I want a desciptor kernel: assign it a sequence number server: sees request (including sequence number) server: give this fd to originator of request #N kernel: check if originator is still there, insert the damn thing into their descriptor table if they still are and return the obtained number or server: tell the originator of request #N to fuck off kernel: check if originator is still there and gleefully pass the "fuck off" if they still are we wouldn't have the in-flight state at all, and there goes the garbage collection shite. With some elaboration, it could even carry the authentication traffic - "fuck off" might be "answer this challenge", with the next "I want a descriptor" carrying reply... -- 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/