From russell@coker.com.au Wed Mar 26 17:53:56 2003 Received: with ECARTIS (v1.0.0; list devfs); Wed, 26 Mar 2003 17:53:59 -0800 (PST) Received: from sat.sws.net.au (postfix@[202.5.161.49]) by oss.sgi.com (8.12.8/8.12.5) with SMTP id h2R1rDq9003880 for ; Wed, 26 Mar 2003 17:53:56 -0800 Received: from localhost (localhost [127.0.0.1]) by sat.sws.net.au (Postfix) with ESMTP id 8CB6ABF44 for ; Thu, 27 Mar 2003 12:53:11 +1100 (EST) Received: from sat.sws.net.au ([127.0.0.1]) by localhost (sat [127.0.0.1:10024]) (amavisd-new) with ESMTP id 27278-04 for ; Thu, 27 Mar 2003 12:53:10 +1100 (EST) Received: from tsv.sws.net.au (unknown [61.95.69.2]) by sat.sws.net.au (Postfix) with ESMTP id 2F2EABF43 for ; Thu, 27 Mar 2003 12:53:10 +1100 (EST) Received: from lyta.coker.com.au (localhost [127.0.0.1]) by tsv.sws.net.au (Postfix) with ESMTP id C55219253C for ; Thu, 27 Mar 2003 12:53:11 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by lyta.coker.com.au (Postfix) with ESMTP id 7BF213A52 for ; Thu, 27 Mar 2003 02:52:59 +0100 (CET) From: Russell Coker Reply-To: Russell Coker To: devfs@oss.sgi.com Subject: module loading Date: Thu, 27 Mar 2003 02:52:54 +0100 User-Agent: KMail/1.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200303270252.54104.russell@coker.com.au> X-Virus-Scanned: by amavisd-new-20021227-p2 (Debian) X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-archive-position: 112 X-ecartis-version: Ecartis v1.0.0 Sender: devfs-bounce@oss.sgi.com Errors-to: devfs-bounce@oss.sgi.com X-original-sender: russell@coker.com.au Precedence: bulk X-list: devfs Content-Length: 481 Lines: 12 Would it be possible to have the kernel execute modprobe when a non-existant device node is accessed? IE If an application attempts to access /dev/ppp could the kernel run "modprobe /dev/ppp" directly (not through devfsd)? -- http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page From Andrey.Borzenkov@siemens.com Wed Mar 26 22:08:30 2003 Received: with ECARTIS (v1.0.0; list devfs); Wed, 26 Mar 2003 22:08:40 -0800 (PST) Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by oss.sgi.com (8.12.8/8.12.5) with SMTP id h2R67mq9021424 for ; Wed, 26 Mar 2003 22:08:30 -0800 Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.11.6/8.11.6) with ESMTP id h2R67f029068; Thu, 27 Mar 2003 07:07:41 +0100 (MET) Received: from MOWD019A.mow.siemens.ru ([163.242.196.119]) by mail1.siemens.de (8.11.6/8.11.6) with ESMTP id h2R67es00517; Thu, 27 Mar 2003 07:07:40 +0100 (MET) Received: by mowd019a.mow.siemens.ru with Internet Mail Service (5.5.2653.19) id ; Thu, 27 Mar 2003 09:10:27 +0300 Received: from mw2b210c (163.242.193.12 [163.242.193.12]) by MOWD019A.mow.siemens.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id HW93KKVV; Thu, 27 Mar 2003 09:10:24 +0300 From: Borzenkov Andrey To: "'Russell Coker'" , devfs@oss.sgi.com Subject: RE: module loading Date: Thu, 27 Mar 2003 09:07:33 +0300 Message-ID: <6134254DE87BD411908B00A0C99B044F03A0B68C@mowd019a.mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 Importance: Normal In-Reply-To: <200303270252.54104.russell@coker.com.au> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h2R67mq9021424 X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-archive-position: 113 X-ecartis-version: Ecartis v1.0.0 Sender: devfs-bounce@oss.sgi.com Errors-to: devfs-bounce@oss.sgi.com X-original-sender: Andrey.Borzenkov@siemens.com Precedence: bulk X-list: devfs Content-Length: 793 Lines: 20 > > Would it be possible to have the kernel execute modprobe when a non- > existant > device node is accessed? > > IE If an application attempts to access /dev/ppp could the kernel run > "modprobe /dev/ppp" directly (not through devfsd)? > Theoretically, yes. Doing this means that either every file system must support it in its ->lookup method or you need special file system type for /dev. The latter exists and is called devfs :) The former may be problematic because at the time ->lookup is called we do not have full pathname - just inode pointing to directory and single component inside this directory. So implementation may need to unwalk directory name (like sys_getcwd does, actually just call it) - and this for _every_ lookup. And almost for every file system type. -andrey From Andrey.Borzenkov@siemens.com Wed Mar 26 22:49:36 2003 Received: with ECARTIS (v1.0.0; list devfs); Wed, 26 Mar 2003 22:49:41 -0800 (PST) Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28]) by oss.sgi.com (8.12.8/8.12.5) with SMTP id h2R6nXq9022566 for ; Wed, 26 Mar 2003 22:49:35 -0800 Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.11.6/8.11.6) with ESMTP id h2R6nQe22553; Thu, 27 Mar 2003 07:49:26 +0100 (MET) Received: from MOWD019A.mow.siemens.ru ([163.242.196.119]) by mail1.siemens.de (8.11.6/8.11.6) with ESMTP id h2R6nPs21576; Thu, 27 Mar 2003 07:49:26 +0100 (MET) Received: by mowd019a.mow.siemens.ru with Internet Mail Service (5.5.2653.19) id ; Thu, 27 Mar 2003 09:52:12 +0300 Received: from mw2b210c (163.242.193.12 [163.242.193.12]) by MOWD019A.mow.siemens.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id HW93KK8R; Thu, 27 Mar 2003 09:52:09 +0300 From: Borzenkov Andrey To: "'Russell Coker'" , devfs@oss.sgi.com Subject: RE: module loading Date: Thu, 27 Mar 2003 09:49:17 +0300 Message-ID: <6134254DE87BD411908B00A0C99B044F03A0B68D@mowd019a.mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 Importance: Normal In-Reply-To: <6134254DE87BD411908B00A0C99B044F03A0B68C@mowd019a.mow.siemens.ru> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h2R6nXq9022566 X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-archive-position: 114 X-ecartis-version: Ecartis v1.0.0 Sender: devfs-bounce@oss.sgi.com Errors-to: devfs-bounce@oss.sgi.com X-original-sender: Andrey.Borzenkov@siemens.com Precedence: bulk X-list: devfs Content-Length: 1116 Lines: 31 > > > > Would it be possible to have the kernel execute modprobe when a non- > > existant > > device node is accessed? > > > > IE If an application attempts to access /dev/ppp could the kernel run > > "modprobe /dev/ppp" directly (not through devfsd)? > > > > Theoretically, yes. Doing this means that either every file system must > support it in its ->lookup method or you need special file system type for > /dev. The latter exists and is called devfs :) The former may be > problematic > because at the time ->lookup is called we do not have full pathname - just > inode pointing to directory and single component inside this directory. So > implementation may need to unwalk directory name (like sys_getcwd does, > actually just call it) - and this for _every_ lookup. And almost for every > file system type. > Correction - it is obviously possible to put it in fs/namei.c:link_path_walk() & friends. If lookup failed, modprobe and restart. This is complicated because it can be relative pathname but then you could compare mnt pointer in parent nd with mnt for /dev (to avoid path unwalking). -andrey From russell@coker.com.au Thu Mar 27 09:52:36 2003 Received: with ECARTIS (v1.0.0; list devfs); Thu, 27 Mar 2003 09:52:39 -0800 (PST) Received: from sat.sws.net.au (postfix@[202.5.161.49]) by oss.sgi.com (8.12.8/8.12.5) with SMTP id h2RHqXq9030170 for ; Thu, 27 Mar 2003 09:52:35 -0800 Received: from localhost (localhost [127.0.0.1]) by sat.sws.net.au (Postfix) with ESMTP id 621E5BF43; Fri, 28 Mar 2003 04:52:31 +1100 (EST) Received: from sat.sws.net.au ([127.0.0.1]) by localhost (sat [127.0.0.1:10024]) (amavisd-new) with ESMTP id 08157-09; Fri, 28 Mar 2003 04:52:28 +1100 (EST) Received: from tsv.sws.net.au (unknown [61.95.69.2]) by sat.sws.net.au (Postfix) with ESMTP id 62509BF45; Fri, 28 Mar 2003 04:52:26 +1100 (EST) Received: from lyta.coker.com.au (localhost [127.0.0.1]) by tsv.sws.net.au (Postfix) with ESMTP id 8A86F92704; Fri, 28 Mar 2003 04:52:25 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by lyta.coker.com.au (Postfix) with ESMTP id 777B07E02; Thu, 27 Mar 2003 12:19:35 +0100 (CET) From: Russell Coker Reply-To: Russell Coker To: Borzenkov Andrey , devfs@oss.sgi.com Subject: Re: module loading Date: Thu, 27 Mar 2003 12:19:34 +0100 User-Agent: KMail/1.5.1 References: <6134254DE87BD411908B00A0C99B044F03A0B68C@mowd019a.mow.siemens.ru> In-Reply-To: <6134254DE87BD411908B00A0C99B044F03A0B68C@mowd019a.mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200303271219.34936.russell@coker.com.au> X-Virus-Scanned: by amavisd-new-20021227-p2 (Debian) X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-archive-position: 115 X-ecartis-version: Ecartis v1.0.0 Sender: devfs-bounce@oss.sgi.com Errors-to: devfs-bounce@oss.sgi.com X-original-sender: russell@coker.com.au Precedence: bulk X-list: devfs Content-Length: 1133 Lines: 27 On Thu, 27 Mar 2003 07:07, Borzenkov Andrey wrote: > > Would it be possible to have the kernel execute modprobe when a non- > > existant > > device node is accessed? > > > > IE If an application attempts to access /dev/ppp could the kernel run > > "modprobe /dev/ppp" directly (not through devfsd)? > > Theoretically, yes. Doing this means that either every file system must > support it in its ->lookup method or you need special file system type for > /dev. The latter exists and is called devfs :) The former may be I only want to use devfs. The problem is that currently modprobe is only run by devfsd in the case of a lookup of a non-existant device, while the kernel runs modprobe in the case of a device node existing but there being no driver to match. I would like to have the kernel run modprobe in both instances to remove the need for devfsd on small systems. -- http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page From Andrey.Borzenkov@siemens.com Thu Mar 27 22:50:58 2003 Received: with ECARTIS (v1.0.0; list devfs); Thu, 27 Mar 2003 22:51:08 -0800 (PST) Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by oss.sgi.com (8.12.8/8.12.5) with SMTP id h2S6ouq9001629 for ; Thu, 27 Mar 2003 22:50:58 -0800 Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by david.siemens.de (8.11.6/8.11.6) with ESMTP id h2S6omk25573; Fri, 28 Mar 2003 07:50:48 +0100 (MET) Received: from MOWD019A.mow.siemens.ru ([163.242.196.119]) by mail1.siemens.de (8.11.6/8.11.6) with ESMTP id h2S6oGA01807; Fri, 28 Mar 2003 07:50:16 +0100 (MET) Received: by mowd019a.mow.siemens.ru with Internet Mail Service (5.5.2653.19) id ; Fri, 28 Mar 2003 09:53:05 +0300 Received: from mw2b210c (163.242.193.12 [163.242.193.12]) by MOWD019A.mow.siemens.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id HZBJW7DH; Fri, 28 Mar 2003 09:52:59 +0300 From: Borzenkov Andrey To: "'Russell Coker'" , devfs@oss.sgi.com Subject: RE: module loading Date: Fri, 28 Mar 2003 09:50:05 +0300 Message-ID: <6134254DE87BD411908B00A0C99B044F03A0B696@mowd019a.mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 In-Reply-To: <200303271219.34936.russell@coker.com.au> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h2S6ouq9001629 X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-archive-position: 116 X-ecartis-version: Ecartis v1.0.0 Sender: devfs-bounce@oss.sgi.com Errors-to: devfs-bounce@oss.sgi.com X-original-sender: Andrey.Borzenkov@siemens.com Precedence: bulk X-list: devfs Content-Length: 1665 Lines: 47 > On Thu, 27 Mar 2003 07:07, Borzenkov Andrey wrote: > > > Would it be possible to have the kernel execute modprobe when a non- > > > existant > > > device node is accessed? > > > > > > IE If an application attempts to access /dev/ppp could the kernel run > > > "modprobe /dev/ppp" directly (not through devfsd)? > > > > Theoretically, yes. Doing this means that either every file system must > > support it in its ->lookup method or you need special file system type > for > > /dev. The latter exists and is called devfs :) The former may be > > I only want to use devfs. > > The problem is that currently modprobe is only run by devfsd in the case > of a > lookup of a non-existant device, while the kernel runs modprobe in the > case > of a device node existing but there being no driver to match. > > I would like to have the kernel run modprobe in both instances to remove > the > need for devfsd on small systems. > Yes, I understand. O.K. look in fs/devfs/base.c:try_modload(). This is the function that is called when lookup fails. Now you could instead of calling devsd_notify_de() generate (relative) path using devfs_generate_path() and directly call modprobe. Bear in mind that devfs_generate_path() won't return absolute pathname (i.e. /dev/ppp) - only relative to mount point (i.e. ppp). The reason is, file system itself has no idea where it has been mounted on. It is possible to add full path name resolution based on getcwd but I guess relative pathname serves probably even better. I have not checked for possible races. OTOH is overhead of running devfsd really significant? Program itself is pretty small and mostly sleeps. -andrey From russell@coker.com.au Fri Mar 28 05:35:35 2003 Received: with ECARTIS (v1.0.0; list devfs); Fri, 28 Mar 2003 05:35:49 -0800 (PST) Received: from sat.sws.net.au (postfix@[202.5.161.49]) by oss.sgi.com (8.12.8/8.12.5) with SMTP id h2SDZVq9019166 for ; Fri, 28 Mar 2003 05:35:34 -0800 Received: from localhost (localhost [127.0.0.1]) by sat.sws.net.au (Postfix) with ESMTP id B9DFDBF47; Sat, 29 Mar 2003 00:35:28 +1100 (EST) Received: from sat.sws.net.au ([127.0.0.1]) by localhost (sat [127.0.0.1:10024]) (amavisd-new) with ESMTP id 25901-10; Sat, 29 Mar 2003 00:35:27 +1100 (EST) Received: from tsv.sws.net.au (unknown [61.95.69.2]) by sat.sws.net.au (Postfix) with ESMTP id 6B2BABF45; Sat, 29 Mar 2003 00:35:27 +1100 (EST) Received: from lyta.coker.com.au (localhost [127.0.0.1]) by tsv.sws.net.au (Postfix) with ESMTP id 2E41192704; Sat, 29 Mar 2003 00:35:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by lyta.coker.com.au (Postfix) with ESMTP id BC7708416; Fri, 28 Mar 2003 14:35:18 +0100 (CET) From: Russell Coker Reply-To: Russell Coker To: Borzenkov Andrey , devfs@oss.sgi.com Subject: Re: module loading Date: Fri, 28 Mar 2003 14:35:18 +0100 User-Agent: KMail/1.5.1 References: <6134254DE87BD411908B00A0C99B044F03A0B696@mowd019a.mow.siemens.ru> In-Reply-To: <6134254DE87BD411908B00A0C99B044F03A0B696@mowd019a.mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200303281435.18213.russell@coker.com.au> X-Virus-Scanned: by amavisd-new-20021227-p2 (Debian) X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-archive-position: 117 X-ecartis-version: Ecartis v1.0.0 Sender: devfs-bounce@oss.sgi.com Errors-to: devfs-bounce@oss.sgi.com X-original-sender: russell@coker.com.au Precedence: bulk X-list: devfs Content-Length: 1387 Lines: 35 On Fri, 28 Mar 2003 07:50, Borzenkov Andrey wrote: > > I would like to have the kernel run modprobe in both instances to remove > > the > > need for devfsd on small systems. > > Yes, I understand. > > O.K. look in fs/devfs/base.c:try_modload(). This is the function that is > called when lookup fails. Now you could instead of calling > devsd_notify_de() generate (relative) path using devfs_generate_path() and > directly call modprobe. Or perhaps I could modify devfsd_notify_de() to do this automatically when devfsd is not running. > Bear in mind that devfs_generate_path() won't return absolute pathname > (i.e. /dev/ppp) - only relative to mount point (i.e. ppp). The reason is, Yes, that's fine. > OTOH is overhead of running devfsd really significant? Program itself is > pretty small and mostly sleeps. The Familiar people working on iPaQ support seem to think that it is significant, which is why they don't have devfsd installed. So for /dev/ppp they create the device node with mknod to allow old-style module auto-loading, which results in an error -17 when the module is loaded (can't add directory entry). -- http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page From Andrey.Borzenkov@siemens.com Fri Mar 28 06:10:33 2003 Received: with ECARTIS (v1.0.0; list devfs); Fri, 28 Mar 2003 06:10:37 -0800 (PST) Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2]) by oss.sgi.com (8.12.8/8.12.5) with SMTP id h2SE9pq9019423 for ; Fri, 28 Mar 2003 06:10:32 -0800 Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.11.6/8.11.6) with ESMTP id h2SE9gQ29191; Fri, 28 Mar 2003 15:09:42 +0100 (MET) Received: from MOWD019A.mow.siemens.ru ([163.242.196.119]) by mail1.siemens.de (8.11.6/8.11.6) with ESMTP id h2SE9fG03321; Fri, 28 Mar 2003 15:09:41 +0100 (MET) Received: by mowd019a.mow.siemens.ru with Internet Mail Service (5.5.2653.19) id ; Fri, 28 Mar 2003 17:12:30 +0300 Received: from mw2b210c (163.242.193.12 [163.242.193.12]) by MOWD019A.mow.siemens.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id HZBJXAL2; Fri, 28 Mar 2003 17:12:28 +0300 From: Borzenkov Andrey To: "'Russell Coker'" , devfs@oss.sgi.com Subject: RE: module loading Date: Fri, 28 Mar 2003 17:09:34 +0300 Message-ID: <6134254DE87BD411908B00A0C99B044F03A0B69E@mowd019a.mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 In-Reply-To: <200303281435.18213.russell@coker.com.au> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h2SE9pq9019423 X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-archive-position: 118 X-ecartis-version: Ecartis v1.0.0 Sender: devfs-bounce@oss.sgi.com Errors-to: devfs-bounce@oss.sgi.com X-original-sender: Andrey.Borzenkov@siemens.com Precedence: bulk X-list: devfs Content-Length: 696 Lines: 19 > > O.K. look in fs/devfs/base.c:try_modload(). This is the function that is > > called when lookup fails. Now you could instead of calling > > devsd_notify_de() generate (relative) path using devfs_generate_path() > and > > directly call modprobe. > > Or perhaps I could modify devfsd_notify_de() to do this automatically when > devfsd is not running. > not without further changes. Try_modload checks event mask and does not call devfsd_notify_de if it does not include LOOKUP. OTOH this check looks redundant; it is repeated in devfsd_notify_de anyway. Besides devfsd_notify_de is called in other cases as well, not just to do modprobe. So try_modload looks more logical choice. -andrey