mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andreas Robinson <andr345@gmail.com>,
	sam@ravnborg.org, linux-kernel@vger.kernel.org,
	Jon Masters <jonathan@jonmasters.org>
Subject: Re: [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel.
Date: Thu, 19 Feb 2009 22:59:48 +0100	[thread overview]
Message-ID: <ac3eb2510902191359o3e32c424h830e78cd0ace446a@mail.gmail.com> (raw)
In-Reply-To: <ac3eb2510902191248w26f1d1c0o95d68aaa3be097a1@mail.gmail.com>

On Thu, Feb 19, 2009 at 21:48, Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Thu, Feb 19, 2009 at 12:41, Kay Sievers <kay.sievers@vrfy.org> wrote:
>> On Thu, Feb 19, 2009 at 12:15, Rusty Russell <rusty@rustcorp.com.au> wrote:
>>> On Thursday 19 February 2009 00:27:58 Kay Sievers wrote:
>>>> some modules wait for 200-500 milliseconds to
>>>> get the lock released, some larger modules spend 50 milliseconds in
>>>> load_module(), many of them around 20 milliseconds.
>>>
>>> OK, this is an untested hack (don't try unloading modules, not sure symbol
>>> resolution isn't racy now I've killed the lock).  Does it change the numbers?
>>
>> That changes it dramatically. The numbers from the sycall until the
>> linked-in module are now down to 15-25 milliseconds, and for a few
>> large modules 50-100.
>>
>> (One crazy exception is ipv6, which takes 620 milliseconds to link, no
>> idea what it needs to do.)
>
> Sorry, this was caused by I/O wait from disk for that huge module, and
> gets to reasonable numbers by putting all modules into RAM before
> loading them.
>
>> I'll compare a few bootup times with and without the patch, and come
>> back later today with the real numbers.
>
> The whole massive parallel modprobe happens during udev coldplug. I
> tried a 2GHz Dual Core laptop, and a setup without initramfs here,
> which loads ~40 modules. All the kernel modules are copied to a ramfs
> mount before the coldplug is started.
>
> I measured the time from the first modprobe that happened in the
> kernel to the loading of "dummy", which I manually trigger from the
> udev boot script, and which gets called right after udev has settled
> and handled all events.
>
> With the mutex it takes 1.8 seconds, without it, it takes 1.3 seconds.
> If I comment out the creation of the stop_machine() threads, it gets
> down to 1.1 seconds.
>
> With the mutex, I see code waiting for up to 180 milliseconds waiting
> for the mutex, the average between 20-40 milliseconds.
>
> Without the mutex the largest time to link is 30 milliseconds, and
> most of them are around 5-10 milliseconds.
>
> Without the mutex and the stop_machine() creation, the flow of tracing
> output looks like real work and, depending on the actual module, they
> spend time in various stages of linking, relocation and so on, there
> are no long delays for any of the modules, like I see with the current
> code.
>
> It would be great, if we can safely minimize the time spent in the mutex.

Further testing revealed, if I only comment out the stop_machine()
preparation, which is used in an error case, I get almost the same
improvement, even with the original mutex in place. Without the mutex
it's still a bit better, maybe it would be much better if we have more
CPUs, but all the long delays are gone only with removing the
stop_machine() preparation.

Thanks,
Kay

  reply	other threads:[~2009-02-19 22:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-15 18:20 Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 1/6] New option: Static linking of external modules Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 2/6] module: add module ELF section with module_init() pointer Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 3/6] module: always prefix module parameters with the module name Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 4/6] kbuild: allow linking of an external object into vmlinux Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 5/6] scripts: new module preprocessor for static linking Andreas Robinson
2009-02-15 18:20 ` [RFC PATCH 6/6] kbuild: enable relinking of vmlinux without full kernel tree Andreas Robinson
2009-02-16 22:51 ` [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel Rusty Russell
2009-02-17 10:42   ` Andreas Robinson
2009-02-17 11:53     ` Kay Sievers
2009-02-18  4:58       ` Rusty Russell
2009-02-18  9:15         ` Kay Sievers
2009-02-18 10:25           ` Andreas Robinson
2009-02-20  0:37             ` Andreas Robinson
2009-02-20  1:55               ` Kay Sievers
2009-02-21 11:43                 ` Andreas Robinson
2009-03-02 14:32                   ` Andreas Robinson
2009-03-02 15:59                     ` Kay Sievers
2009-03-02 16:20                     ` Arjan van de Ven
2009-03-02 16:29                       ` Kay Sievers
2009-03-02 18:27                         ` Arjan van de Ven
2009-03-02 21:41                           ` Andreas Robinson
2009-03-04 18:47                           ` Andreas Robinson
2009-03-06  0:18                             ` Arjan van de Ven
2009-03-06 15:15                               ` Andreas Robinson
2009-03-06 15:45                                 ` Arjan van de Ven
2009-03-08 10:47                                   ` Andreas Robinson
2009-03-08 16:01                                     ` Arjan van de Ven
2009-03-08 20:13                                       ` [PATCH] sata_nv: add a module parameter to enable async scanning Andreas Robinson
2009-03-09 17:12                                       ` [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel Will Newton
2009-03-06  7:05                       ` fastboot kernel parameter Sitsofe Wheeler
2009-03-06 11:23                         ` Arjan van de Ven
2009-02-24  1:27               ` [RFC PATCH 0/6] module, kbuild: Faster boot with custom kernel Rusty Russell
2009-02-18 11:57           ` Rusty Russell
2009-02-18 13:57             ` Kay Sievers
2009-02-19 11:15               ` Rusty Russell
2009-02-19 11:41                 ` Kay Sievers
2009-02-19 20:48                   ` Kay Sievers
2009-02-19 21:59                     ` Kay Sievers [this message]
2009-02-20  0:58                       ` Rusty Russell
2009-02-20  1:33                         ` Kay Sievers
2009-02-24  1:39                           ` Rusty Russell
2009-02-20 11:32                         ` Rusty Russell
2009-02-23 16:42                           ` Kay Sievers
2009-02-25  7:03                             ` Rusty Russell
2009-02-25 18:12                               ` Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac3eb2510902191359o3e32c424h830e78cd0ace446a@mail.gmail.com \
    --to=kay.sievers@vrfy.org \
    --cc=andr345@gmail.com \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®