Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755136AbcJ2WNm (ORCPT ); Sat, 29 Oct 2016 18:13:42 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:55730 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753024AbcJ2WNk (ORCPT ); Sat, 29 Oct 2016 18:13:40 -0400 From: Arnd Bergmann To: Tom Gundersen Subject: Re: [RFC v1 02/14] bus1: provide stub cdev /dev/bus1 Date: Sun, 30 Oct 2016 00:13:14 +0200 User-Agent: KMail/1.12.2 (Linux/4.4.0-41-generic; KDE/4.3.2; x86_64; ; ) Cc: Andy Lutomirski , David Herrmann , Hannes Reinecke , Jiri Kosina , "linux-kernel@vger.kernel.org" , Andrew Morton , Josh Triplett , Greg KH , Steven Rostedt , Linus Torvalds References: <20161026191810.12275-1-dh.herrmann@gmail.com> <2469565.N6oiQLH2B8@wuerfel> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201610300013.14598.arnd@arndb.de> X-Provags-ID: V03:K0:6xINjIFJv7gMG3CfdywbxhKrS1WviRLCgj5+mw0xi8BR+beehtF ZMpi35wIwMCgVXMyn6j3972rP5cvgPQx6klkWomLwWruenY5ZtsvEoTyXCzYbZefocgHgKx mb58gjMQZ8SkN4kgxgeTNagC8OcLbNc4uoBgEIMPcytP/kFSxmLvl1ZU05dCo28TLEawi9A u0ym6yHPRoY5opwOA4SNg== X-UI-Out-Filterresults: notjunk:1;V01:K0:zApNBCRfk3c=:ntFJZ5jy9eKBTpvFrjpucR Jr4Jl8sClHk3hY0HSO5KzjZwLVkKDgyB/ehr6m0qNb1utTn7JtR8S9yd0D3FYzDbBDt9g2KBI J+GzphovEfC14+oJLfKZiolRNK1B6owPgqhNvuBDf2zehkWcVdcs4Sscs1Wwt7qgGfMrC5bkf I487vAtbEW++xF6UxTuiNAJP8enORSLtZj5qyIlQIy5w395pBWjQpEGl6Po3f+ju9VkCSd7S6 xj1KspeQMZgF3DuybRJJBeGyGtUxsrbKK27fSUuI+D6FWoln31oa/s0OWyPvkh+JtPLsKhB5K VIXoK1nTe/WN9qs9Tz8uHeZW9M94xRDH5L2XovHsjCvUtubrWFzkkWhQ3FbW5sBv0lQP4/opK XMrCi13RQl3M0SMlwFsi7Lp19XmJusjKneRxf9QK3u8DywvEnKgrH21TQRaSYFtM8ljFk0jPx 1a6XGZNNkMNd0svXXIvhaAH8XnDV0rMB3hgRYch145tpRzT6GqvUKbdUyqJ9nPryA15dogZ6d fnjPphWynAJT1q8Lx6WqoPbz19E0mtXoVA8+wtzBbBAX/9Ey2BvsSGhegkHsDao5vPi03byK0 +Vlg3p2XbAiEExIEmOM1Zm7Zlp/4Oxmg9Y66dCrVp2PAdn3tFQ2DGJRM+nEsVgU1oVdtUerd9 6H64U4vBc2gbhJYXKW771JqMpFLJP/uJSf2sBoxm6ddgimgLM74/mKBx4ULZgRrJTo+G1gFOt co1YyspDCTjGsQO3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2064 Lines: 44 On Thursday 27 October 2016, Tom Gundersen wrote: > On Thu, Oct 27, 2016 at 11:11 AM, Arnd Bergmann wrote: > > On Thursday, October 27, 2016 1:54:05 AM CEST Tom Gundersen wrote: > >> On Thu, Oct 27, 2016 at 1:19 AM, Andy Lutomirski wrote: > >> > This may have been covered elsewhere, but could this use syscalls instead? > >> > >> Yes, syscalls would work essentially the same. For now, we are using a > >> cdev as it makes it a lot more convenient to develop and test as an > >> out-of-tree module, but that could be changed easily before the final > >> submission, if that's what we want. > > > > > > Generally speaking, I think syscalls would be appropriate here, and put > > bus1 into a similar category as the other ipc interfaces (shm, msg, sem, > > mqueue, ...). > > Could you elaborate on why you think syscalls would be more > appropriate than ioctls? Linus already answered this, but I'd also add that core kernel features just make sense to be syscalls, rather than stuffing them in a random device driver. > > - Have a mountable file system, and use open() on that to create > > connections. Advantages are that it's fairly easy to have one > > instance per fs-namespace, and you can have user-defined naming > > of objects in the file system. > > Note that currently we only have one object (/dev/bus1) and each fd is > disconnected from anything else on creation, so not sure what benefits > a filesystem (or several instances of it) would give? I have not tried to understand some of the main concepts of bus1, so I simply assumed that there was some way of looking up handles of other instances. Using a file system gives you a natural way to look up resources by name the way we do e.g. for mq_open(), and it lets you easy decide whether containers should share a view of the same namespace by mounting the same instance of the file system into them or having separate instances. If you don't ever need to look up a handle by name in bus1, using a mountable file system would not help you. Arnd