linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jason Mattax <jmattax@storytotell.org>
Cc: kamezawa.hiroyu@jp.fujitsu.com, cesarb@cesarb.net,
	emunson@mgebm.net, penberg@kernel.org, linux-mm@kvack.org,
	Hugh Dickins <hughd@google.com>
Subject: Re: Possible Swapfile bug
Date: Thu, 22 Mar 2012 12:46:35 -0700	[thread overview]
Message-ID: <20120322124635.85fd4673.akpm@linux-foundation.org> (raw)
In-Reply-To: <4F6B5236.20805@storytotell.org>

On Thu, 22 Mar 2012 10:24:22 -0600
Jason Mattax <jmattax@storytotell.org> wrote:

> Swapon very slow with swapfiles.
> 
> After upgrading the kernel my swap file loads very slowly, while a swap 
> partition is unaffected. With the newer kernel (2.6.33.1) I get
> 
> # time swapon -v /var/swapfile
> swapon on /var/swapfile
> swapon: /var/swapfile: found swap signature: version 1, page-size 4, 
> same byte order
> swapon: /var/swapfile: pagesize=4096, swapsize=6442450944, 
> devsize=6442450944
> 
> real    4m35.355s
> user    0m0.001s
> sys    0m1.786s
> 
> while with the older kernel (2.6.32.27) I get
> # time swapon -v /var/swapfile
> swapon on /var/swapfile
> swapon: /var/swapfile: found swap signature: version 1, page-size 4, 
> same byte order
> swapon: /var/swapfile: pagesize=4096, swapsize=6442450944, 
> devsize=6442450944
> 
> real    0m1.158s
> user    0m0.000s
> sys     0m0.876s
> 
> this stays true even for new swapfiles I create with dd.
> 
> the file is on an OCZ Vertex2 SSD.

Probably the vertex2 discard problem.  

We just merged a patch which will hopefully fix it:

--- a/mm/swapfile.c~swap-dont-do-discard-if-no-discard-option-added
+++ a/mm/swapfile.c
@@ -2103,7 +2103,7 @@ SYSCALL_DEFINE2(swapon, const char __use
 			p->flags |= SWP_SOLIDSTATE;
 			p->cluster_next = 1 + (random32() % p->highest_bit);
 		}
-		if (discard_swap(p) == 0 && (swap_flags & SWAP_FLAG_DISCARD))
+		if ((swap_flags & SWAP_FLAG_DISCARD) && discard_swap(p) == 0)
 			p->flags |= SWP_DISCARDABLE;
 	}
 

But Hugh doesn't like it and won't tell us why :)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-03-22 19:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 16:24 Jason Mattax
2012-03-22 19:46 ` Andrew Morton [this message]
2012-03-23  0:49   ` Jason Mattax
2012-03-23 12:05     ` Hugh Dickins
2012-03-24  3:56       ` Jason Mattax
2012-03-25 19:39         ` Hugh Dickins
2012-03-25 21:21           ` Jason Mattax

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=20120322124635.85fd4673.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cesarb@cesarb.net \
    --cc=emunson@mgebm.net \
    --cc=hughd@google.com \
    --cc=jmattax@storytotell.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@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