Richard W.M. Jones
2016-Mar-17 10:07 UTC
[Libguestfs] [PATCH supermin 0/5] Make supermin mini-initrd quieter and faster.
Various patches to make supermin quieter. By outputting fewer messages on the fast path, we use the slow emulated UART less, and this improves boot times. Also remove some kernel modules that we cannot or should not be using, which also improves boot times. Rich.
Richard W.M. Jones
2016-Mar-17 10:07 UTC
[Libguestfs] [PATCH supermin 1/5] init: If "quiet" is found on the command line, suppress debug output.
--- init/init.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/init/init.c b/init/init.c index 80b2232..3014de2 100644 --- a/init/init.c +++ b/init/init.c @@ -71,10 +71,10 @@ static const char *moderror(int err) } } -/* Leave this enabled for now. When we get more confident in the boot - * process we can turn this off or make it configurable. +/* If "quiet" is found on the command line, set this which suppresses + * ordinary debug messages. */ -#define verbose 1 +static int quiet = 0; static void mount_proc (void); static void print_uptime (void); @@ -90,7 +90,6 @@ main () { mount_proc (); - print_uptime (); fprintf (stderr, "supermin: ext2 mini initrd starting up: " PACKAGE_VERSION #if defined(__dietlibc__) @@ -105,6 +104,12 @@ main () "\n"); read_cmdline (); + quiet = strstr (cmdline, "quiet") != NULL; + + if (!quiet) { + fprintf (stderr, "supermin: cmdline: %s\n", cmdline); + print_uptime (); + } /* Create some fixed directories. */ mkdir ("/dev", 0755); @@ -112,7 +117,7 @@ main () mkdir ("/sys", 0755); /* Mount /sys. */ - if (verbose) + if (!quiet) fprintf (stderr, "supermin: mounting /sys\n"); if (mount ("sysfs", "/sys", "sysfs", 0, "") == -1) { perror ("mount: /sys"); @@ -208,7 +213,7 @@ main () exit (EXIT_FAILURE); found: - if (verbose) + if (!quiet) fprintf (stderr, "supermin: picked %s as root device\n", path); fgets (line, sizeof line, fp); @@ -229,7 +234,7 @@ main () perror ("ioctl: TIOCSCTTY"); #endif - if (verbose) + if (!quiet) fprintf (stderr, "supermin: creating /dev/root as block special %d:%d\n", major, minor); @@ -239,7 +244,7 @@ main () } /* Mount new root and chroot to it. */ - if (verbose) + if (!quiet) fprintf (stderr, "supermin: mounting new root on /root\n"); if (mount ("/dev/root", "/root", "ext2", MS_NOATIME, "") == -1) { perror ("mount: /root"); @@ -250,7 +255,7 @@ main () * Documentation/filesystems/ramfs-rootfs-initramfs.txt * We could remove the old initramfs files, but let's not bother. */ - if (verbose) + if (!quiet) fprintf (stderr, "supermin: chroot\n"); if (chroot ("/root") == -1) { @@ -282,7 +287,7 @@ insmod (const char *filename) { size_t size; - if (verbose) + if (!quiet) fprintf (stderr, "supermin: internal insmod %s\n", filename); int fd = open (filename, O_RDONLY); @@ -323,7 +328,7 @@ mount_proc (void) if (access ("/proc/uptime", R_OK) == -1) { mkdir ("/proc", 0755); - if (verbose) + if (!quiet) fprintf (stderr, "supermin: mounting /proc\n"); if (mount ("proc", "/proc", "proc", 0, "") == -1) { @@ -370,8 +375,6 @@ read_cmdline (void) len = strlen (cmdline); if (len >= 1 && cmdline[len-1] == '\n') cmdline[len-1] = '\0'; - - fprintf (stderr, "supermin: cmdline: %s\n", cmdline); } /* Display a directory on stderr. This is used for debugging only. */ -- 2.5.0
Richard W.M. Jones
2016-Mar-17 10:07 UTC
[Libguestfs] [PATCH supermin 2/5] init: Drop ide module from the mini-initrd.
In all modern kernels IDE support is provided by libata, not the ancient ide*.ko module. The other disadvantage of this wildcard was that it picked up various unrelated modules, eg. ideapad_slidebar.ko (plus dependencies). --- src/ext2_initrd.ml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ext2_initrd.ml b/src/ext2_initrd.ml index 09536d3..50ac924 100644 --- a/src/ext2_initrd.ml +++ b/src/ext2_initrd.ml @@ -38,7 +38,6 @@ let kmods = [ "ext2.ko*"; "ext4.ko*"; (* CONFIG_EXT4_USE_FOR_EXT23=y option might be set *) "virtio*.ko*"; - "ide*.ko*"; "libata*.ko*"; "piix*.ko*"; "scsi_transport_spi.ko*"; -- 2.5.0
Richard W.M. Jones
2016-Mar-17 10:07 UTC
[Libguestfs] [PATCH supermin 3/5] Revert "helper: Add megaraid drivers to the initrd."
The megaraid driver was added to test an old bug. Remove it since copying this driver to the mini-initrd and loading it each time is not free. This reverts commit 9da479658818738b2a2a68456e867cdb609472c8. --- src/ext2_initrd.ml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ext2_initrd.ml b/src/ext2_initrd.ml index 50ac924..f222bb8 100644 --- a/src/ext2_initrd.ml +++ b/src/ext2_initrd.ml @@ -50,7 +50,6 @@ let kmods = [ "crc*.ko*"; "libcrc*.ko*"; "ibmvscsic.ko*"; - "megaraid*.ko*"; ] let rec build_initrd debug tmpdir modpath initrd -- 2.5.0
Richard W.M. Jones
2016-Mar-17 10:07 UTC
[Libguestfs] [PATCH supermin 4/5] init: Drop mbcache.ko.
This module is described as "Filesystem Meta Information Block Cache (mbcache). The mbcache caches blocks of block devices that need to be located by their device/block number, as well as by other criteria (such as the block's contents)." It is compiled into the kernel in Fedora, and if it is required on other distros then it should be pulled in by module dependencies. --- src/ext2_initrd.ml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ext2_initrd.ml b/src/ext2_initrd.ml index f222bb8..730f806 100644 --- a/src/ext2_initrd.ml +++ b/src/ext2_initrd.ml @@ -46,7 +46,6 @@ let kmods = [ "sym53c8xx.ko*"; "ata_piix.ko*"; "sr_mod.ko*"; - "mbcache.ko*"; "crc*.ko*"; "libcrc*.ko*"; "ibmvscsic.ko*"; -- 2.5.0
Richard W.M. Jones
2016-Mar-17 10:07 UTC
[Libguestfs] [PATCH supermin 5/5] init: Drop SCSI modules.
Also drop the sr_mod module used by the deprecated guestfs_add_cdrom interface. --- src/ext2_initrd.ml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/ext2_initrd.ml b/src/ext2_initrd.ml index 730f806..5e841ea 100644 --- a/src/ext2_initrd.ml +++ b/src/ext2_initrd.ml @@ -40,12 +40,7 @@ let kmods = [ "virtio*.ko*"; "libata*.ko*"; "piix*.ko*"; - "scsi_transport_spi.ko*"; - "scsi_mod.ko*"; - "sd_mod.ko*"; - "sym53c8xx.ko*"; "ata_piix.ko*"; - "sr_mod.ko*"; "crc*.ko*"; "libcrc*.ko*"; "ibmvscsic.ko*"; -- 2.5.0
Pino Toscano
2016-Mar-18 13:01 UTC
Re: [Libguestfs] [PATCH supermin 0/5] Make supermin mini-initrd quieter and faster.
On Thursday 17 March 2016 10:07:34 Richard W.M. Jones wrote:> Various patches to make supermin quieter. By outputting fewer > messages on the fast path, we use the slow emulated UART less, and > this improves boot times. > > Also remove some kernel modules that we cannot or should not be using, > which also improves boot times.The series LGTM. Thanks, -- Pino Toscano
Török Edwin
2016-Mar-20 11:30 UTC
Re: [Libguestfs] [PATCH supermin 5/5] init: Drop SCSI modules.
On 03/17/2016 12:07, Richard W.M. Jones wrote:> Also drop the sr_mod module used by the deprecated guestfs_add_cdrom > interface. > --- > src/ext2_initrd.ml | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/src/ext2_initrd.ml b/src/ext2_initrd.ml > index 730f806..5e841ea 100644 > --- a/src/ext2_initrd.ml > +++ b/src/ext2_initrd.ml > @@ -40,12 +40,7 @@ let kmods = [ > - "sd_mod.ko*";sd_mod.ko is required on Debian jessie (with kernel from backports 4.3.0-0.bpo.1-amd64), otherwise it won't find /sys/block/sdb/dev. Best regards, -- Edwin Török | Co-founder and Lead Developer Skylable open-source object storage: reliable, fast, secure http://www.skylable.com
Kashyap Chamarthy
2016-Mar-21 06:02 UTC
Re: [Libguestfs] [PATCH supermin 0/5] Make supermin mini-initrd quieter and faster.
On Thu, Mar 17, 2016 at 10:07:34AM +0000, Richard W.M. Jones wrote:> Various patches to make supermin quieter. By outputting fewer > messages on the fast path, we use the slow emulated UART less, and > this improves boot times. > > Also remove some kernel modules that we cannot or should not be using, > which also improves boot times.Trying to apply this series on current Git master fails for me. I'm here: $ git describe v5.1.15-10-gaa720f5 While applying, the first patch ("init: If "quiet" is found on the command line, suppress debug output") fails: $ git am `git-find-series-in-maildir \ ~/Mail/RH/libguestfs/cur/1458209606_0.20513.tesla\,U\=1561870\,FMD5\=d735770317fa502b04f5c5707608ec3c\:2\,FS` Applying: init: If "quiet" is found on the command line, suppress debug output. error: patch failed: init/init.c:71 error: init/init.c: patch does not apply Patch failed at 0001 init: If "quiet" is found on the command line, suppress debug output. The copy of the patch that failed is found in: /home/kashyapc/tinker-space/supermin/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". I don't mind applying patche series from list at all for testing, but just wondering -- have any convenient branch to test? I quickly checked on GitHub, but I couldn't your 'supermin' tree there. -- /kashyap
Richard W.M. Jones
2016-Mar-21 08:41 UTC
Re: [Libguestfs] [PATCH supermin 0/5] Make supermin mini-initrd quieter and faster.
On Mon, Mar 21, 2016 at 07:02:32AM +0100, Kashyap Chamarthy wrote:> On Thu, Mar 17, 2016 at 10:07:34AM +0000, Richard W.M. Jones wrote: > > Various patches to make supermin quieter. By outputting fewer > > messages on the fast path, we use the slow emulated UART less, and > > this improves boot times. > > > > Also remove some kernel modules that we cannot or should not be using, > > which also improves boot times. > > Trying to apply this series on current Git master fails for me. > > I'm here: > > $ git describe > v5.1.15-10-gaa720f5 > > While applying, the first patch ("init: If "quiet" is found on the > command line, suppress debug output") fails: > > $ git am `git-find-series-in-maildir \ > ~/Mail/RH/libguestfs/cur/1458209606_0.20513.tesla\,U\=1561870\,FMD5\=d735770317fa502b04f5c5707608ec3c\:2\,FS` > Applying: init: If "quiet" is found on the command line, suppress debug output. > error: patch failed: init/init.c:71 > error: init/init.c: patch does not apply > Patch failed at 0001 init: If "quiet" is found on the command line, suppress debug output. > The copy of the patch that failed is found in: > /home/kashyapc/tinker-space/supermin/.git/rebase-apply/patch > When you have resolved this problem, run "git am --continue". > If you prefer to skip this patch, run "git am --skip" instead. > To restore the original branch and stop patching, run "git am --abort". > > I don't mind applying patche series from list at all for testing, but > just wondering -- have any convenient branch to test? I quickly checked > on GitHub, but I couldn't your 'supermin' tree there.I think it's because I pushed all these patches upstream already. See: https://github.com/libguestfs/supermin You'll probably find the libguestfs patches for boot analysis more interesting. See: https://github.com/rwmjones/libguestfs/commits/master Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Reasonably Related Threads
- [PATCH supermin 0/5] Make supermin mini-initrd quieter and faster.
- Re: [PATCH supermin 5/5] init: Drop SCSI modules.
- [PATCH supermin 5/5] init: Drop SCSI modules.
- [PATCH RFC supermin] ext2_initrd: error out if we can't add anything
- [PATCH supermin 0/2] Allow an alternate libc to be used for init.