Re: Slow booting
Γιώργος Πάλλας <email@example.com> writes:
> Does this happen under specific conditions? I'm asking because my swap
> is 5GB on a debian squeeze 64bit box, and it inits in an instant.
Well, two points:
First, if you do these sorts of timings by doing "swapoff xxx"
followed by "swapon xxx" or by creating a new swapfile from scratch
and doing a "swapon xxx", then the "swapon" generally completes
instantly, since whatever information "swapon" wants to fiddle with is
already in memory. So, the question is whether your swap also
initializes instantly when it's first loaded on bootup.
Second, browsing the kernel code, it looks like the culprit *should*
be setup_swap_extents(), which walks the full list of swap blocks
checking for runs of blocks that are contiguous on disk. The trouble
is, this is only done for regular files, and block devices shouldn't
have any delay. That is, swapfiles should have a delay, swap
partitions should be almost instantaneous. (I can't easily test this
Since this is at odds with what Kamil reported in his "dmesg.txt"
(where he was swapping on /dev/sda3), either (1) I'm wrong about the
kernel code, and it's something else that's sucking up all the time
for both swap partitions and files, (2) Kamil's "/dev/sda3" is
actually a plain file instead of the sda3 block device he thinks it
is, or (3) Kamil's problem is unrelated to the usual problem of slow
mounting of swap files.