From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 867995C25A for ; Thu, 17 May 2018 00:04:09 +0000 (UTC) Received: from mail-it0-f66.google.com (mail-it0-f66.google.com [209.85.214.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 273B130EE34B for ; Thu, 17 May 2018 00:03:58 +0000 (UTC) Received: by mail-it0-f66.google.com with SMTP id n202-v6so6585509ita.1 for ; Wed, 16 May 2018 17:03:58 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Patrick Mitchell Date: Wed, 16 May 2018 20:03:56 -0400 Message-ID: Subject: Re: [linux-lvm] pvscan takes 45-90 minutes booting off ISO with thin pools Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-lvm@redhat.com Changing the ISO's lvm.conf, setting "activation = 0" in global makes it boot very quickly. I can then manually run a single "pvscan --cache --activate ay" to activat everything, and it just takes a few seconds. So, I'm thinking this has to be a locking problem with trying to activate so many logical volumes and thin pools simultaneously. On Mon, May 14, 2018 at 1:02 AM, Patrick Mitchell wrote: > Sometimes when booting off an Arch installation ISO (even recent > kernel 4.16.8 & lvm2 2.02.177) LVM's pvscan takes 60-90 minutes. This > is with large thin pools, which seems to have caused such delays for > people in the past, with a fix being adding "--skip-mappings" in > thin_check_options. > > This used to always happen when booting off an ISO, until I made a > custom one with "--skip-mappings". With this, it's intermittent. > Sometimes nearly instant, sometimes 45-90 minutes. > > This delay never happens when booting off an install on a drive. (I'm > thinking there must be a cache that obviously doesn't exist on the > ISO?) > > When there's a massive delay: > > root@archiso ~ # date && ps ax | grep scan > Mon May 14 03:08:14 UTC 2018 > 717 ? S 718 ? S 719 ? S 720 ? S 721 ? S 722 ? S 724 ? S 725 ? S 727 ? S 728 ? S 731 ? S 733 ? S 748 ? S 752 ? S 753 ? S 754 ? S 755 ? S 756 ? S 757 ? S 759 ? S 768 ? S > And iotop shows 0 bytes being read or written for most of it. > > Is Arch using pvscan incorrectly? Is it meant for a process to be ran > for each device? Is concurrently running a pvscan for each devicepath > causing lock contention? Should Arch be running one instance of > pvscan without device major and minor block numbers? > > Here is Arch's "lvm2-pvscan@.service" > > ===== > > [Unit] > Description=LVM2 PV scan on device %i > Documentation=man:pvscan(8) > DefaultDependencies=no > StartLimitInterval=0 > BindsTo=dev-block-%i.device > Requires=lvm2-lvmetad.socket > After=lvm2-lvmetad.socket lvm2-lvmetad.service > Before=shutdown.target > Conflicts=shutdown.target > > [Service] > Type=oneshot > RemainAfterExit=yes > ExecStart=/usr/bin/lvm pvscan --cache --activate ay %i > ExecStop=/usr/bin/lvm pvscan --cache %i