linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Heming Zhao <heming.zhao@suse.com>
To: Martin Wilck <mwilck@suse.de>,
	LVM general discussion and development <linux-lvm@redhat.com>,
	David Teigland <teigland@redhat.com>
Subject: Re: [linux-lvm] system boot time regression when using lvm2-2.03.05
Date: Fri, 6 Sep 2019 08:46:52 +0000	[thread overview]
Message-ID: <4552ae36-09fc-9145-d768-80b4ef572bca@suse.com> (raw)
In-Reply-To: <8b432efdabc3de82146ea6cb87b27c89556bf72e.camel@suse.de>

the _online_pvscan_one cost too much time when booting.
It mainly job is to create file in /run/lvm/pvs_online, which role is to replace lvmetad.

when comment out _online_pvscan_one, below folders are blank
/run/lvm/pvs_online  & /run/lvm/vgs_online

I am not familiar with vg metadata layout. I GUESS the vg metadata is recorded on the first PV dev of PVs group devs. So the _online_pv_found job just use the vg metadata info to find/print whether or not this vg is ready. this part code cost time & less useful when system boot. Or in another word, this part code is not necessary for online vg/lv.
```c
_online_pv_found()
{
     _online_pvid_file_create // call open() to create "/run/lvm/pvs_online/xx"

     ... ...

     //zhm: below code just count the not online PV number.
     dm_list_iterate_items(pvl, &vg->pvs) {
         if (!_online_pvid_file_exists((const char *)&pvl->pv->id.uuid))
             pvids_not_online++;

         /* Check if one of the devs on the command line is in this VG. */
         if (dev_args && dev_in_device_list(pvl->pv->dev, dev_args))
             dev_args_in_vg = 1;
     }
}
```

the core/key code for online lvs is _pvscan_aa():
_pvscan_aa
  +-> _pvscan_aa_direct
  |    vgchange_activate
  |
  or
  |
  +-> process_each_vg   //this func can work without reading /run/lvm/pvs_online/xx
       _pvscan_aa_single
         vgchange_activate

So my first patch partly backout commit 25b58310e3d6. To use process_each_vg active lvs, this func can work without reading /run/lvm/pvs_online/xx.

For the _pvscan_aa_direct(), I don't totally understand it. I need some time to dig it.


On 9/6/19 2:51 PM, Martin Wilck wrote:
> On Fri, 2019-09-06 at 05:01 +0000, Heming Zhao wrote:
>> I just tried to only apply below patch (didn't partly backout commit
>> 25b58310e3).
>> The attrs of lvs output still have 'a' bit.
>>
>> ```patch
>> +#if 0
>>      			if (!_online_pvscan_one(cmd, dev, NULL,
>> complete_vgnames, saved_vgs, 0, &pvid_without_metadata))
>>      				add_errors++;
>> +#endif
> 
> 
> IIUC this would mean that you skip David's "pvs_online" file generation
> entirely. How did the auto-activation happen, then?
> 
>> ```
>>
>> the output of "systemd-analysis blame | head -n 10":
>> ```
>>            59.279s systemd-udev-settle.service
>>            39.979s dracut-initqueue.service
>>             1.676s lvm2-activation-net.service
> 
> Could it be that lvm2-activation-net.service activated the VGs? I can
> imagine that that would be efficient, because when this service runs
> late in the boot process, I'd expect all PVs to be online, so
> everything can be activated in a single big swoop. Unfortunately, this
> wouldn't work in general, as it would be too late for booting from LVM
> volumes.
> 
> However I thought all lvm2-acticvation... services were gone with LVM
> 2.03?
> 
> Regards
> Martin
> 
> 

  reply	other threads:[~2019-09-06  8:46 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
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 [this message]
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=4552ae36-09fc-9145-d768-80b4ef572bca@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).