From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1m3Ye7-00011b-Az for mharc-grub-devel@gnu.org; Wed, 14 Jul 2021 02:45:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ydy-00010A-BV for grub-devel@gnu.org; Wed, 14 Jul 2021 02:45:18 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:43874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3Ydw-0005zp-NV for grub-devel@gnu.org; Wed, 14 Jul 2021 02:45:18 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9866520265; Wed, 14 Jul 2021 06:45:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1626245113; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7pdgVWyuy81uFAenMnXGXskuUZlQqX1UBFT+MuIhh5Q=; b=sV23V6Aao8cxB/uN0HREQwSkSr70dm/tk7D5gbu5W/fUQdHvwKg/TeeEUfA2I9TG3RLtsE DBVbsl932eWVPz2BpWFtkX3mF6Hs44g6jwMxQdgeuNv4dBc3Yxk4Yj1P00W5pjfM42TllT LDjeJ8dyJNbGBu4nH5FSU1LBtWWL0Bk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1626245113; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7pdgVWyuy81uFAenMnXGXskuUZlQqX1UBFT+MuIhh5Q=; b=64RH3TNGv+RcU0XQCmJ2FA3hmHj1g1VhahLJgHKLb2zjIfnkR1R5asJaL7MPHrTj+W4y4k XnY6LaCMfNMMmQBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4D7FE13BE6; Wed, 14 Jul 2021 06:45:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Z1/yD/mH7mA9cAAAMHmgww (envelope-from ); Wed, 14 Jul 2021 06:45:13 +0000 Date: Wed, 14 Jul 2021 08:45:11 +0200 From: Petr Vorel To: Michael Chang Cc: Paul Menzel , Jeff Mahoney , Daniel Kiper , Mike Gilbert , The development of GNU GRUB Subject: Re: [PATCH 2/2] grub2: use stat instead of udevadm for partition lookup Message-ID: Reply-To: Petr Vorel References: <20210708155558.26466-1-pvorel@suse.cz> <20210708155558.26466-3-pvorel@suse.cz> <33f16d1e-162c-6eb1-b0d0-fa69d4a2dbe4@molgen.mpg.de> <20210714062449.GA18534@mercury> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210714062449.GA18534@mercury> Received-SPF: pass client-ip=195.135.220.29; envelope-from=pvorel@suse.cz; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2021 06:45:21 -0000 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 > > > > 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