Re: module boot time (was Re: [PATCH] module: Use binary search in lookup_symbol())

2011-05-21 Thread Jeff Mahoney
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/20/2011 05:29 PM, Tim Bird wrote: On 05/19/2011 12:56 PM, Jeff Mahoney wrote: On 05/18/2011 05:34 PM, Greg KH wrote: I don't think that's worth it, there has been talk, and some initial code, about adding kernel modules to the kernel image

Re: module boot time (was Re: [PATCH] module: Use binary search in lookup_symbol())

2011-05-20 Thread Tim Bird
On 05/19/2011 12:56 PM, Jeff Mahoney wrote: On 05/18/2011 05:34 PM, Greg KH wrote: I don't think that's worth it, there has been talk, and some initial code, about adding kernel modules to the kernel image itself, which would solve a lot of the i/o time of loading modules, and solves some

Re: module boot time (was Re: [PATCH] module: Use binary search in lookup_symbol())

2011-05-19 Thread Jeff Mahoney
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/18/2011 05:34 PM, Greg KH wrote: On Wed, May 18, 2011 at 02:10:15PM -0700, Tim Bird wrote: And why do people overly care for the load time? To reduce overall boot time. To reduce it even more, build the modules into the kernel :) That's

Re: [PATCH] module: Use binary search in lookup_symbol()

2011-05-19 Thread Rusty Russell
On Wed, 18 May 2011 17:26:56 +0200, Dirk Behme dirk.be...@googlemail.com wrote: The old version with the warning is in linux-next now http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commitdiff;h=903996de9b35213aaa4162c24351a2cb2931d9ac Yep, I switched to the new one after

Re: [PATCH] module: Use binary search in lookup_symbol()

2011-05-18 Thread Christoph Hellwig
On Tue, May 17, 2011 at 04:33:07PM -0700, Tim Bird wrote: That said, I can answer Greg's question. This is to speed up the symbol resolution on module loading. The last numbers I saw showed a reduction of about 15-20% for the module load time, for large-ish modules. Of course this is highly

Re: [PATCH] module: Use binary search in lookup_symbol()

2011-05-18 Thread Dirk Behme
On 17.05.2011 22:56, Alessio Igor Bogani wrote: This work was supported by a hardware donation from the CE Linux Forum. Signed-off-by: Alessio Igor Boganiabog...@kernel.org --- kernel/module.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/module.c

Re: [PATCH] module: Use binary search in lookup_symbol()

2011-05-18 Thread Tim Bird
On 05/18/2011 12:54 AM, Christoph Hellwig wrote: On Tue, May 17, 2011 at 04:33:07PM -0700, Tim Bird wrote: That said, I can answer Greg's question. This is to speed up the symbol resolution on module loading. The last numbers I saw showed a reduction of about 15-20% for the module load

Re: [PATCH] module: Use binary search in lookup_symbol()

2011-05-18 Thread Greg KH
On Wed, May 18, 2011 at 10:00:12AM -0700, Tim Bird wrote: On 05/18/2011 12:54 AM, Christoph Hellwig wrote: On Tue, May 17, 2011 at 04:33:07PM -0700, Tim Bird wrote: That said, I can answer Greg's question. This is to speed up the symbol resolution on module loading. The last numbers I

[PATCH] module: Use binary search in lookup_symbol()

2011-05-18 Thread Alessio Igor Bogani
The function is_exported() with its helper function lookup_symbol() are used to verify if a provided symbol is effectively exported by the kernel or by the modules. Now that both have their symbols sorted we can replace a linear search with a binary search which provide a considerably speed-up.

module boot time (was Re: [PATCH] module: Use binary search in lookup_symbol())

2011-05-18 Thread Tim Bird
On 05/18/2011 12:21 PM, Greg KH wrote: On Wed, May 18, 2011 at 10:00:12AM -0700, Tim Bird wrote: Carmelo Amoroso reported some good performance gains in this presentation: http://elinux.org/images/1/18/C_AMOROSO_Fast_lkm_loader_ELC-E_2009.pdf (See slide 22). He doesn't report the overall

Re: module boot time (was Re: [PATCH] module: Use binary search in lookup_symbol())

2011-05-18 Thread Greg KH
On Wed, May 18, 2011 at 02:10:15PM -0700, Tim Bird wrote: And why do people overly care for the load time? To reduce overall boot time. To reduce it even more, build the modules into the kernel :) That's what I do most of the time. For some projects, it is useful to build certain

Re: [PATCH] module: Use binary search in lookup_symbol()

2011-05-17 Thread Alessio Igor Bogani
Dear Mr. Behme, 2011/5/17 Dirk Behme dirk.be...@googlemail.com: [...] With the version above we should get a warning kernel/module.c: In function 'lookup_symbol': kernel/module.c:1809: warning: unused variable 'ks' Sorry It's my fault. I'll provide a right version in few hours. Ciao,

[PATCH] module: Use binary search in lookup_symbol()

2011-05-17 Thread Alessio Igor Bogani
This work was supported by a hardware donation from the CE Linux Forum. Signed-off-by: Alessio Igor Bogani abog...@kernel.org --- kernel/module.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index 1e2b657..795bdc7 100644 ---

Re: [PATCH] module: Use binary search in lookup_symbol()

2011-05-17 Thread Greg KH
On Tue, May 17, 2011 at 10:56:03PM +0200, Alessio Igor Bogani wrote: This work was supported by a hardware donation from the CE Linux Forum. Signed-off-by: Alessio Igor Bogani abog...@kernel.org --- That's nice, but _why_ do this change? What does it buy us? Please explain why you make a

Re: [PATCH] module: Use binary search in lookup_symbol()

2011-05-16 Thread Anders Kaseorg
On Mon, May 16, 2011 at 11:36, Dirk Behme dirk.be...@googlemail.com wrote: Then, thinking again, results in the question if the first argument of bsearch() shouldn't be 'name' rather than 'ks-name'? Yes, it should be. Then it would be the job of cmp_name() to check for start == stop == 0?

Re: [PATCH] module: Use binary search in lookup_symbol()

2011-05-16 Thread Joe Perches
On Mon, 2011-05-16 at 14:01 -0700, Joe Perches wrote: On Mon, 2011-05-16 at 22:23 +0200, Alessio Igor Bogani wrote: Signed-off-by: Alessio Igor Bogani abog...@kernel.org diff --git a/kernel/module.c b/kernel/module.c @@ -2055,10 +2055,8 @@ static const struct kernel_symbol