linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Heming Zhao <heming.zhao@suse.com>
To: David Teigland <teigland@redhat.com>
Cc: Martin Wilck <mwilck@suse.de>,
	"linux-lvm@redhat.com" <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] system boot time regression when using lvm2-2.03.05
Date: Thu, 5 Sep 2019 12:35:53 +0000	[thread overview]
Message-ID: <370ba3fa-53df-7213-8876-d37ef1a3b57e@suse.com> (raw)
In-Reply-To: <ff7a48ee-221d-d5a3-14ad-074806abf5b8@suse.com>

Hello David,

Today I may find the key of regression.

In pvscan_cache_cmd, the code in below area "#if 0 .. #endif take a huge 
time. When I used below modified code to boot, the time reduced from 
1min to 1.389s.

The _online_pvscan_one responsible to lvmetad_pvscan_single in lvm2-2.02 
code. But lvmetad_pvscan_single had been removed from lvm2 since 2.03. 
So below if() area looks useless in lvm2-2.03.

pvscan_cache_cmd() //code for git latest version
{
    ...
         if (!dm_list_empty(&add_devs)) {
                 log_print("zhm %s %d", __func__, __LINE__);
                 label_scan_devs(cmd, cmd->filter, &add_devs);

                 dm_list_iterate_items(devl, &add_devs) {
                         dev = devl->dev;

                         if (dev->flags & DEV_FILTER_OUT_SCAN) {
                                 log_print("pvscan[%d] device %s 
excluded by filter.", getpid(), dev_name(dev));
                                 continue;
                         }

                         add_single_count++;
#if 0
                         //zhm: lvm2-2.02 func: lvmetad_pvscan_single()
                         if (!_online_pvscan_one(cmd, dev, NULL, 
complete_vgnames, saved_vgs, 0, &pvid_without_metadata))
                                 add_errors++;
#endif
                 }
         }
    ...
}

Thanks


On 9/4/19 4:13 PM, Heming Zhao wrote:
> Thanks for you reply.
> 
> I found the latest lvm2 git source code contains your 3 commits. So I
> built lvm2 with today's git code. But there is no big change as before.
> 
> ENV: fedora30 server edition, 896 PVs.
> 
> All below results from today's work.
> 
> [with patch]
> event_activation = 1 && obtain_device_list_from_udev = 1
> boot time: 1min 44.295s
> 
> event_activation = 0 && obtain_device_list_from_udev = 0
> boot time: 59.759s
> 
> [without patch]
> event_activation = 1 && obtain_device_list_from_udev = 1
> boot time: 1min 56.040s
> 
> event_activation = 0 && obtain_device_list_from_udev = 0
> boot time: 1min 6.715s
> 
> Thanks.
> 
> On 9/3/19 11:17 PM, David Teigland wrote:
>> On Tue, Sep 03, 2019 at 05:02:25AM +0000, Heming Zhao wrote:
>>> Test result URL:
>>> https://gist.github.com/zhaohem/f9951bb016962cdd07bf7c9d3d7fd525
>>
>> At least part of the problem is caused by lvm waiting on udev, e.g.
>> WARNING: Device /dev/vdf76 not initialized in udev database even after waiting 10000000 microseconds.
>>
>> I recently wrote this patch to stop that:
>> https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0534cd9cd4066c88a7dd815f2f3206a177169334
>>
>> With this older patch, obtain_device_list_from_udev=0 can also help avoid it:
>> https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3ebce8dbd2d9afc031e0737f8feed796ec7a8df9
>>
>> Also, I just pushed out this commit that makes the pvscan activations
>> faster when there are many PVs:
>> https://sourceware.org/git/?p=lvm2.git;a=commit;h=25b58310e3d606a85abc9bd50991ccb7ddcbfe25
>>
>> Dave
>>
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
> 

  reply	other threads:[~2019-09-05 12:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 13:52 [linux-lvm] system boot time regression when using lvm2-2.03.05 Heming Zhao
2019-08-29 14:37 ` David Teigland
2019-09-03  5:02   ` Heming Zhao
2019-09-03 15:17     ` David Teigland
2019-09-04  8:13       ` Heming Zhao
2019-09-05 12:35         ` Heming Zhao [this message]
2019-09-05 16:55           ` David Teigland
2019-09-06  4:31             ` Heming Zhao
2019-09-06  5:01               ` Heming Zhao
2019-09-06  6:51                 ` Martin Wilck
2019-09-06  8:46                   ` Heming Zhao
2019-09-06 14:15                     ` David Teigland
2019-09-06 14:26                     ` David Teigland
2019-09-06 14:03                   ` David Teigland
2019-09-09 11:42                     ` Heming Zhao
2019-09-09 14:09                       ` David Teigland
2019-09-10  8:01                         ` Martin Wilck
2019-09-10 15:20                           ` David Teigland
2019-09-10 20:38                             ` Zdenek Kabelac
2019-09-11  7:17                               ` Martin Wilck
2019-09-11  9:13                                 ` Zdenek Kabelac
2019-09-12 13:58                                   ` Martin Wilck

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=370ba3fa-53df-7213-8876-d37ef1a3b57e@suse.com \
    --to=heming.zhao@suse.com \
    --cc=linux-lvm@redhat.com \
    --cc=mwilck@suse.de \
    --cc=teigland@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).