From: Shaohua Li <shli@kernel.org>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Holger Kiehl <Holger.Kiehl@dwd.de>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-mm@kvack.org
Subject: Re: [RFC]swap: don't do discard if no discard option added
Date: Wed, 21 Mar 2012 12:31:47 +0800 [thread overview]
Message-ID: <CANejiEUyPSNQ7q85ZDz-B3iHikHLgZLBNOF-p4evkxjGo5+M0g@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.00.1203202019140.1842@eggly.anvils>
2012/3/21 Hugh Dickins <hughd@google.com>:
> On Tue, 20 Mar 2012, Shaohua Li wrote:
>>
>> Even don't add discard option, swapon will do discard, this sounds buggy,
>> especially when discard is slow or buggy.
>
> It's not a bug in swapon, it's an intentional feature, made explicit in
> commit 339944663273 "swap: discard while swapping only if SWAP_FLAG_DISCARD"
> and in the swapon(2) manpage. We were also careful in wording the swapon(8)
> manpage and the comment on SWAP_FLAG_DISCARD in swap.h - too lawyerly ;-?
>
> It appears to be a bug in the Vertex 2: I did receive one other such
> report on a Vertex 2 fourteen months ago, and in the absence of further
> reports, we decided to consider that user's drive defective. I wonder
> if Holger's drive is defective, or if it's true of all Vertex 2s, or
> if it depends on the firmware revision, and a later revision fixes it.
>
> If the latter (if there is a firmware revision which fixes it), then
> I think it's clear that SWAP_FLAG_DISCARD should continue to behave
> as it does at present, with discard at swapon independent of it.
>
> Holger, do you have the latest firmware on this drive?
> Have any other Vertex 2 users observed this behaviour?
>
> I've seen no such problem with the original OCZ Vertex, nor with
> their Vertex 3, nor with the Intel drives I've tried (and you
> report no problem with FusionIO's, though no advantage either).
>
> But if there's no good firmware for the Vertex 2, I'm not so sure
> what to do: two reports in fourteen months, on a superseded drive -
> is that strong enough to disable a feature which appeared to offer
> some advantage on others?
>
> Is there a lower level at which we could blacklist the Vertex 2
> to disable driver support for its discard?
Holger uses raid for swap. We currently didn't do discard request
merge as low SCSI driver doesn't allow. So for the raid0 case, we
will split big discard request to chunk size, which is 512k. This will
increase discard request number. This can be fixed later. But on
the other hand, if user doesn't explictly enable discard, why enable
it? Like fs, we didn't do runtime discard and only run trim occasionally
since discard is slow.
Thanks,
Shaohua
--
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>
next prev parent reply other threads:[~2012-03-21 4:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-20 12:34 Shaohua Li
2012-03-20 18:21 ` Holger Kiehl
2012-03-20 19:42 ` Andrew Morton
2012-03-21 3:57 ` Hugh Dickins
2012-03-21 4:31 ` Shaohua Li [this message]
2012-03-21 4:56 ` Andrew Morton
2012-03-23 11:23 ` Hugh Dickins
2012-03-23 11:00 ` Hugh Dickins
2012-03-21 17:55 ` Holger Kiehl
2012-03-23 11:38 ` Hugh Dickins
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=CANejiEUyPSNQ7q85ZDz-B3iHikHLgZLBNOF-p4evkxjGo5+M0g@mail.gmail.com \
--to=shli@kernel.org \
--cc=Holger.Kiehl@dwd.de \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=martin.petersen@oracle.com \
/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