mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grzegorz Kulewski <kangur@polcom.net>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, kernel@kolivas.org
Subject: Re: Slow swapon for big (12GB) swap
Date: Mon, 10 Apr 2006 13:45:32 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.63.0604101332490.31989@alpha.polcom.net> (raw)
In-Reply-To: <20060410025419.65456ca9.akpm@osdl.org>

On Mon, 10 Apr 2006, Andrew Morton wrote:
> Grzegorz Kulewski <kangur@polcom.net> wrote:
>> On Mon, 10 Apr 2006, Andrew Morton wrote:
>>> Grzegorz Kulewski <kangur@polcom.net> wrote:
>>>> I am using big swap here (as a backing for potentially huge tmpfs). And I
>>>>  wonder why swapon on such big (like 12GB) swap takes about 7 minutes
>>>>  (continuous disk IO).
>>>
>>> It's a bit quicker here:
>>>
>>> vmm:/usr/src/25# mkswap /dev/hda6
>>> Setting up swapspace version 1, size = 54031826 kB
>>> vmm:/usr/src/25# time swapon /dev/hda6
>>> swapon /dev/hda6  0.00s user 0.04s system 74% cpu 0.054 total
>>>
>>>
>>>> Is this expected?
>>>
>>> Nope.
>>>
>>>> Why it is like that?
>>>
>>> Are you using a swapfile or a swap partition?
>>
>> Swap file.
>>
>>
>>> If it's a swapfile then perhaps the filesystem is being inefficient in its
>>> bmap() function.  Which filesystem is it?
>>
>> Ext3.
>>
>
> OK.  A 12G file is around 3000 indirect blocks.  At 10 milliseconds each
> I'd expect it to take 30-odd seconds.  A 14G swapfile here takes 20 second
> for swapon.

That is what I would expect.


> Maybe your disks are slow, or the fs is already quite full+fragmented.

Well, the disk is slow but not that slow... For example dd creating this 
file goes at about 20-25MB/s and takes about 10 minutes IIRC, so it is not 
*that* bad...

The disk is not full or even close to:
/dev/hda4          /mnt/data        52552,1  27343,6  24140,4  54%  ext3

and file count is not that high too:
/dev/hda4            6836224   42333 6793891    1% /mnt/data

and it should not be fragmented in any way. It is rather new (3 months 
old) filesystem with several bigger files and small amount of smaller. 
Used mainly as a data store and backup. Very infrequently written to (new 
blocks/files).

I think I will test new kernel soon. Maybe with and without -ck. Maybe 
disk scheduler (probably CFQ) does something stupid... Or swap prefetch... 
Or anything...


Thanks,

Grzegorz Kulewski


  reply	other threads:[~2006-04-10 11:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-09 11:45 Grzegorz Kulewski
2006-04-10  7:34 ` Helge Hafting
2006-04-10 10:17   ` Grzegorz Kulewski
2006-04-11 11:30     ` Jan Engelhardt
2006-04-11 11:46       ` linux-os (Dick Johnson)
2006-04-10  7:40 ` Andrew Morton
2006-04-10  9:44   ` Antonio Vargas
2006-04-10 10:25   ` Grzegorz Kulewski
2006-04-10  9:54     ` Andrew Morton
2006-04-10 11:45       ` Grzegorz Kulewski [this message]
2006-04-10 10:27     ` Con Kolivas

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=Pine.LNX.4.63.0604101332490.31989@alpha.polcom.net \
    --to=kangur@polcom.net \
    --cc=akpm@osdl.org \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®