All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Michael Chang <mchang@suse.com>
Cc: Paul Menzel <pmenzel@molgen.mpg.de>,
	Jeff Mahoney <jeffm@suse.com>,
	Daniel Kiper <daniel.kiper@oracle.com>,
	Mike Gilbert <floppym@gentoo.org>,
	The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH 2/2] grub2: use stat instead of udevadm for partition lookup
Date: Wed, 14 Jul 2021 08:45:11 +0200	[thread overview]
Message-ID: <YO6H9+3WrLyRNcPU@pevik> (raw)
In-Reply-To: <20210714062449.GA18534@mercury>

Hi Michael,

> On Tue, Jul 13, 2021 at 12:52:12PM +0200, Petr Vorel wrote:
> > Hi Paul,

> > > Dear Petr, dear Jeff,


> > > Am 08.07.21 um 17:55 schrieb Petr Vorel:
> > > > From: Jeff Mahoney <jeffm@suse.com>

> > > > sysfs_partition_path calls udevadm to resolve the sysfs path for
> > > > a block device. That can be accomplished by stating the device node
> > > > and using the major/minor to follow the symlinks in /sys/dev/block/.

> > > > This cuts the execution time of grub2-mkconfig from 10s to 2s on
> > > > my system.

> > > Petr, where you able to reproduce this issue?
> > No, I'm sorry, I haven't even tried, because accessing sysfs seems to me as a
> > quickest way anyway. But agree that we drag this patch in opensuse from 2017
> > (for 2.02~rc1), it might not be relevant for nowadays systems.

> > > Could the specifications of Jeff’s system be added to the commit message?
> > Jeff, Michael, could you verify if it's still relevant?

> It is still relevant per my test, although not as considerable as Jeff's
> system.

> I was using openSUSE Tumbleweed, pretty much all defaults and simple,
> btrfs as root file system without any abstraction disks (lvm, mdadm and
> encryption).

>  NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
>  sr0   11:0    1  663M  0 rom  
>  vda  253:0    0   20G  0 disk 
>  vda1 253:1    0  1.4G  0 part [SWAP]
>  vda2 253:2    0 18.6G  0 part /

> The output of `time grub2-mkconfig -o /boot/grub2/grub.cfg` with the
> patch applied.

>  real    0m1.292s
>  user    0m0.782s
>  sys     0m0.427s

> and without

>  real    0m2.323s
>  user    0m1.295s
>  sys     0m0.956s

> This cuts the execution to somewhere near 55%, which is pretty signifcant.

Thanks a lot for testing. I'll send v2 shortly.

> Please note if testing on lvm, there wouldn't have difference on the
> execution time as libdevmapper is used instead of udevadm to get the
> partition start.
Good to know (some of my system have lvm).

Kind regards,
Petr

> Thanks,
> Michael


  reply	other threads:[~2021-07-14  6:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 15:55 [PATCH 0/2] linux: use stat instead of udevadm for partition lookup + cleanup Petr Vorel
2021-07-08 15:55 ` [PATCH 1/2] osdep: Introduce major.h and use it Petr Vorel
2021-07-13 17:36   ` Daniel Kiper
2021-07-13 19:07     ` Petr Vorel
2021-07-14  6:54       ` Petr Vorel
2021-07-14 12:55         ` Daniel Kiper
2021-07-14 14:42           ` Petr Vorel
2021-07-14 14:47             ` Petr Vorel
2021-07-08 15:55 ` [PATCH 2/2] grub2: use stat instead of udevadm for partition lookup Petr Vorel
2021-07-13  9:25   ` Paul Menzel
2021-07-13 10:52     ` Petr Vorel
2021-07-14  6:24       ` Michael Chang
2021-07-14  6:45         ` Petr Vorel [this message]
2021-07-14  4:16     ` Michael Chang
2021-07-13 17:48   ` Daniel Kiper
2021-07-13 18:03     ` Jeff Mahoney
2021-07-13 19:10       ` Petr Vorel
2021-07-14 13:00         ` Daniel Kiper

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=YO6H9+3WrLyRNcPU@pevik \
    --to=pvorel@suse.cz \
    --cc=daniel.kiper@oracle.com \
    --cc=floppym@gentoo.org \
    --cc=grub-devel@gnu.org \
    --cc=jeffm@suse.com \
    --cc=mchang@suse.com \
    --cc=pmenzel@molgen.mpg.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.