bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

up to 12 seconds to print partition table!


From: Richard Hirst
Subject: up to 12 seconds to print partition table!
Date: Mon, 25 Mar 2002 19:02:15 +0000
User-agent: Mutt/1.3.24i

Hi,
  I have an ia64 box here with 2G memory, and most of the memory used as
cache:

address@hidden:/build/parted/parted-1.4.24.ori-build# free
             total       used       free     shared    buffers     cached
Mem:       2055136    1835248     219888          0     117504    1317936
-/+ buffers/cache:     399808    1655328
Swap:       995984       2272     993712


I then have spare disk with 15 partitions on it, and:

address@hidden:/build/parted/parted-1.4.24.ori$ time sudo parted /dev/sdc p
Disk geometry for /dev/sdc: 0.000-4095.856 megabytes
Disk label type: GPT
Minor    Start       End     Filesystem  Name                  Flags
1          0.017    100.000  ext2                              lba
2        100.000    200.000  linux-swap                        lba
3        201.000    299.000  FAT                               lba
4        301.000    399.000  ext2                              lba
5        401.000    499.000  ext2                              lba
6        501.000    599.000  FAT                               lba
7        601.000    699.000  FAT                               lba
8        701.000    799.000                                    lba
9        801.000    899.000                                    lba
10       901.000    999.000                                    lba
11      1001.000   1099.000                                    lba
12      1101.000   1199.000  ext2                              lba
13      1201.000   1299.000                                    lba
14      1301.000   1399.000                                    lba
15      1401.000   1499.000                                    lba

real    0m12.477s
user    0m0.041s
sys     0m12.007s


Over 12 seconds!  If I flush memory (malloc and touch lots of pages), so

address@hidden:/build/parted/parted-1.4.24.ori-build# free
             total       used       free     shared    buffers     cached
Mem:       2055136     421664    1633472          0      52816     265856
-/+ buffers/cache:     102992    1952144
Swap:       995984      38640     957344

Then that comes down to 

real    0m3.834s
user    0m0.032s
sys     0m3.324s

If I make the device read-only, it gets reasonable:

real    0m0.457s
user    0m0.028s
sys     0m0.076s


The problem is libparted/device.c:_flush_cache(), which seems to be
getting called 8 times, making 16 BLKFLSHBUF on /dev/sdX, and 112
open/BLKFLSHBUF/close sequences on /dev/sdXn.  When readonly, the opens
fail, so most of those BLKFLSHBUF/close sequences don't happen.

Assuming we do really need to BLKFLSHBUF some times, can we at least
avoid doing it quite so often?

Is it done to avoid problems of accessing a block via sda and sda3 and
getting different results (as per a comment I found in cfdisk source)?

Cheers,
  Richard




reply via email to

[Prev in Thread] Current Thread [Next in Thread]