Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 689264 Details for
Bug 875356
OS prober is slow
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
0003-Parallelize-by-spindle.patch
0003-Parallelize-by-spindle.patch (text/plain), 8.90 KB, created by
John Reiser
on 2013-01-28 19:26:02 UTC
(
hide
)
Description:
0003-Parallelize-by-spindle.patch
Filename:
MIME Type:
Creator:
John Reiser
Created:
2013-01-28 19:26:02 UTC
Size:
8.90 KB
patch
obsolete
>From 83d8faa328f803f31b23b81ab78a1bc9b8b51008 Mon Sep 17 00:00:00 2001 >From: John Reiser <jreiser@BitWagon.com> >Date: Sat, 22 Dec 2012 21:05:55 -0800 >Subject: [PATCH 3/4] Parallelize by spindle. > >--- > linux-boot-probes/common/50mounted-tests | 11 +-- > os-prober | 130 ++++++++++++++++++------------- > os-probes/common/50mounted-tests | 12 +-- > os-probes/mounted/common/40lsb | 3 +- > os-probes/mounted/common/90linux-distro | 9 +-- > 5 files changed, 85 insertions(+), 80 deletions(-) > >diff --git a/linux-boot-probes/common/50mounted-tests b/linux-boot-probes/common/50mounted-tests >index 481255f..fb85d67 100755 >--- a/linux-boot-probes/common/50mounted-tests >+++ b/linux-boot-probes/common/50mounted-tests >@@ -3,16 +3,9 @@ > . /usr/share/os-prober/common.sh > set -e > >-tmpmntdir=/var/lib/os-prober/mount >-mkdir "$tmpmntdir" >/dev/null 2>&1 || true >-(cd $tmpmntdir >- umount -f lbp* >/dev/null 2>&1 || true >- rmdir lbp* >/dev/null 2>&1 || true >-) >+while read partition mntpfx; do > >-while read partition; do >- >-tmpmnt=$tmpmntdir/lbp$(( mount_count+=1 )) >+tmpmnt=$mntpfx-$(( mount_count+=1 )) > mkdir $tmpmnt > > xtra_types="" >diff --git a/os-prober b/os-prober >index 19aaa1c..ad18396 100755 >--- a/os-prober >+++ b/os-prober >@@ -44,58 +44,70 @@ if type dmraid >/dev/null 2>&1; then > fi > > partitions () { >- # Exclude partitions that have whole_disk sysfs attribute set. >- if [ -d /sys/block ]; then >- # Exclude partitions on physical disks that are part of a >- # Serial ATA RAID disk. >- for part in /sys/block/*/*[0-9]; do >- if [ -f "$part/start" -a ! -f "$part/whole_disk" ] \ >- && ! on_sataraid $part; then >- name="${part##*/}" >- # An empty name designates a root. >- if [ 0 -eq ${#name} ]; then >- name='/' >- fi >- if [ -e "/dev/$name" ]; then >- echo "/dev/$name" >- fi >- fi >- done >+ filter="$1" >+ mntpfx="$2" >+ local drvcnt >+ # Exclude partitions that have whole_disk sysfs attribute set. >+ if [ -d /sys/block ]; then >+ # Exclude partitions on physical disks that are part of a >+ # Serial ATA RAID disk. >+ for drive in /sys/block/*; do >+ set -- $drive/*[0-9]; if [ -r "$1" ]; then # actual partitions >+ (( drvcnt += 1 )) >+ for part do # iterates over result of "set --" above >+ if [ -f "$part/start" -a ! -f "$part/whole_disk" ] \ >+ && ! on_sataraid $part; then >+ name="${part##*/}" >+ # An empty name designates a root. >+ if [ 0 -eq ${#name} ]; then >+ name='/' >+ fi >+ if [ -e "/dev/$name" ]; then >+ echo "/dev/$name" "$mntpfx-$drvcnt" >+ fi >+ fi >+ done | "$filter" & >+ fi >+ done > >- # Add Serial ATA RAID devices >- if type dmraid >/dev/null 2>&1 && \ >- dmraid -s -c >/dev/null 2>&1; then >- for raidset in $(dmraid -sa -c); do >- for part in /dev/mapper/"$raidset"*[0-9]; do >- echo "$part" >- done >- done >- fi >- elif [ "$(uname -s)" = Linux ]; then >- echo "Cannot find list of partitions! (Try mounting /sys.)" >&2 >- return 1 >- else >- # We don't know how to probe OSes on non-Linux kernels. For >- # now, just don't get in the way. >- return 0 >- fi >+ # Add Serial ATA RAID devices >+ if type dmraid >/dev/null 2>&1 \ >+ && dmraid -s -c >/dev/null 2>&1; then >+ (( drvcnt += 1 )) >+ for raidset in $(dmraid -sa -c); do >+ for part in /dev/mapper/"$raidset"*[0-9]; do >+ echo "$part" "$mntpfx-$drvcnt" >+ done >+ done | "$filter" & >+ fi >+ elif [ "$(uname -s)" = Linux ]; then >+ echo "Cannot find list of partitions! (Try mounting /sys.)" >&2 >+ return 1 >+ else >+ # We don't know how to probe OSes on non-Linux kernels. For >+ # now, just don't get in the way. >+ return 0 >+ fi > >- # Add MD RAID devices >- if [ -f /proc/mdstat ] ; then >- awk '/^md/ {printf "/dev/"$1"\n"}' /proc/mdstat >- fi >+ # Add MD RAID devices >+ if [ -f /proc/mdstat ] ; then >+ (( drvcnt += 1 )) >+ awk "/^md/ {printf \"/dev/\$1 $mntpfx-$drvcnt\\n\"}" /proc/mdstat | "$filter" & >+ fi > >- # Also detect OSes on LVM volumes (assumes LVM is active) >- if type lvs >/dev/null 2>&1; then >- LVM_SUPPRESS_FD_WARNINGS=1 log_output \ >- lvs --noheadings --separator : -o vg_name,lv_name 2>/dev/null | >- sed "s|-|--|g;s|^[[:space:]]*\(.*\):\(.*\)$|/dev/mapper/\1-\2|" >- # Double the original dashes to distinguish them from the >- # single dash that will be added later. Ignore leading >- # whitespace, then find two fields separated by a colon >- # and replace using /dev/mapper with the fields separated >- # by a dash. >- fi >+ # Also detect OSes on LVM volumes (assumes LVM is active) >+ if type lvs >/dev/null 2>&1; then >+ (( drvcnt += 1 )) >+ LVM_SUPPRESS_FD_WARNINGS=1 log_output \ >+ lvs --noheadings --separator : -o vg_name,lv_name 2>/dev/null | >+ sed "s|-|--|g;s|^[[:space:]]*\(.*\):\(.*\)$|/dev/mapper/\1-\2 $mntpfx-$drvcnt |" | >+ # Double the original dashes to distinguish them from the >+ # single dash that will be added later. Ignore leading >+ # whitespace, then find two fields separated by a colon >+ # and replace using /dev/mapper with the fields separated >+ # by a dash. >+ "$filter" >+ fi > } > > parse_proc_mdstat () { # filters stdin >@@ -193,9 +205,10 @@ pipe_not_yet="${pipe_not_yet#|}" > # logger process that reads its stdin. Stderr remains available for > # debugging and emergencies. > # Plumbing by John Reiser (jreiser bitwagon com), November 2012. >+# Parallelize by spindles December 2012. > >-partitions | ( ( ( >- while read partition ; do >+func1() { # The filter chain for each spindle >+( while read partition mntpfx; do > # Distribute to proper entrypoint in pipeline of filters. > > if ! mapped="$(mapdevfs "$partition")"; then >@@ -212,7 +225,7 @@ partitions | ( ( ( > continue > fi > eval 'mpoint="$MPOINT_'$tamed'"'; if [ -z "$mpoint" ]; then >- echo "$partition" # not yet mounted >+ echo "$partition" "$mntpfx" # not yet mounted > else # already mounted > mpoint="$(unescape_mount "$mpoint")" > if [ "$mpoint" != "/target/boot" \ >@@ -224,7 +237,18 @@ partitions | ( ( ( > fi > done \ > | eval "${pipe_not_yet}" >-) 8>&1 | eval "${pipe_mounted}" | while read line; do >+) 8>&1 | eval "${pipe_mounted}" >+} >+ >+# Directory for temporary mount points >+tmpmntdir=/var/lib/os-prober >+mkdir "$tmpmntdir" >/dev/null 2>&1 || true >+(cd $tmpmntdir >+ umount -f osp* >/dev/null 2>&1 || true >+ rmdir osp* >/dev/null 2>&1 || true >+) >+ >+( ( partitions func1 $tmpmntdir/osp | while read line; do > echo '?'unknown "$line" > set -f; set -- $line; set +f > part="$1"; dir="$2"; type="$3"; discard="$4" >diff --git a/os-probes/common/50mounted-tests b/os-probes/common/50mounted-tests >index 01c336e..74d9f03 100755 >--- a/os-probes/common/50mounted-tests >+++ b/os-probes/common/50mounted-tests >@@ -20,17 +20,11 @@ for mod_type in $(grep -v nodev /proc/filesystems); do > fi > done > >-tmpmntdir=/var/lib/os-prober/mount >-mkdir "$tmpmntdir" >/dev/null 2>&1 || true >-(cd $tmpmntdir >- umount -f osp* >/dev/null 2>&1 || true >- rmdir osp* >/dev/null 2>&1 || true >-) > >+# The main loop >+while read partition mntpfx; do > >-while read partition; do >- >-tmpmnt=$tmpmntdir/osp$(( mount_count+=1 )) >+tmpmnt="$mntpfx"-$(( mount_count+=1 )) > mkdir $tmpmnt > > xtra_types="" >diff --git a/os-probes/mounted/common/40lsb b/os-probes/mounted/common/40lsb >index 2b7e576..a8e2246 100755 >--- a/os-probes/mounted/common/40lsb >+++ b/os-probes/mounted/common/40lsb >@@ -2,7 +2,7 @@ > # Test for LSB systems. > set -e > >-. $execpfx/common.sh >+# . $execpfx/common.sh > > while read partition dir type discard; do > >@@ -11,6 +11,7 @@ if [ ! -e "$file" ]; then > echo "$partition $dir $type $discard"; continue # failure > fi > >+# Lines are shell syntax: var="value" > while read line; do eval "$line"; done < $file > > release="$DISTRIB_RELEASE" >diff --git a/os-probes/mounted/common/90linux-distro b/os-probes/mounted/common/90linux-distro >index 80c6df2..1125fad 100755 >--- a/os-probes/mounted/common/90linux-distro >+++ b/os-probes/mounted/common/90linux-distro >@@ -124,14 +124,7 @@ function filter() { > done # read next partition > } > >-# Use two parallel streams to filter alternating partitions. >-# Count the over-all results to avoid a race when incrementing the label. >-( ( ( while read line; do echo "$line" 1>&5 # side2 >- if read line; then echo "$line" # side1 >- fi >- done | filter 1>&- # side1 >-) 5>&1 | filter 1>&- # side2 >-) 6>&1 | while read line; do result "$line$((label += 1)):linux"; done >+( filter 6>&1 1>&- | while read line; do result "$line$((label += 1)):linux"; done > ) 7>&1 > > # EOF >-- >1.8.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 875356
:
652201
|
688069
|
689262
|
689263
| 689264 |
689265
|
692170
|
692171
|
692172