linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Rafael Aquini <aquini@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org, hughd@google.com, kzak@redhat.com,
	jmoyer@redhat.com, kosaki.motohiro@gmail.com, riel@redhat.com,
	lwoodman@redhat.com, mgorman@suse.de
Subject: Re: [PATCH 01/02] swap: discard while swapping only if SWAP_FLAG_DISCARD_PAGES
Date: Fri, 28 Jun 2013 10:14:54 +0800	[thread overview]
Message-ID: <20130628021454.GA16423@kernel.org> (raw)
In-Reply-To: <537407790857e8a5d4db5fb294a909a61be29687.1369529143.git.aquini@redhat.com>

On Sun, May 26, 2013 at 01:31:55AM -0300, Rafael Aquini wrote:
> This patch introduces SWAP_FLAG_DISCARD_PAGES and SWAP_FLAG_DISCARD_ONCE
> new flags to allow more flexibe swap discard policies being flagged through
> swapon(8). The default behavior is to keep both single-time, or batched, area
> discards (SWAP_FLAG_DISCARD_ONCE) and fine-grained discards for page-clusters
> (SWAP_FLAG_DISCARD_PAGES) enabled, in order to keep consistentcy with older
> kernel behavior, as well as maintain compatibility with older swapon(8).
> However, through the new introduced flags the best suitable discard policy 
> can be selected accordingly to any given swap device constraint.

I'm sorry to response this thread so later. I thought if we just want to
discard the swap partition once at swapon, we really should do it in swapon
tool. The swapon tool can detect the swap device supports discard, any swap
partition is empty at swapon, and we have ioctl to do discard in userspace, so
we have no problem to do discard at the tool. If we don't want to do discard at
all, let the tool handles the option. Kernel is not the place to handle the
complexity.

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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2013-06-28  2:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-26  4:31 [PATCH 00/02] swap: allowing a more flexible DISCARD policy V2 Rafael Aquini
2013-05-26  4:31 ` [PATCH 01/02] swap: discard while swapping only if SWAP_FLAG_DISCARD_PAGES Rafael Aquini
2013-05-26 11:44   ` KOSAKI Motohiro
2013-05-26 13:52     ` Rafael Aquini
2013-05-26 14:55       ` KOSAKI Motohiro
2013-05-26 15:30         ` Rafael Aquini
2013-05-26 16:02           ` KOSAKI Motohiro
2013-06-28  2:14   ` Shaohua Li [this message]
2013-05-26  4:31 ` [PATCH 02/02] swapon: allow a more flexible swap discard policy Rafael Aquini
2013-05-26 16:32   ` KOSAKI Motohiro
2013-08-23 11:03   ` Karel Zak

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=20130628021454.GA16423@kernel.org \
    --to=shli@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=aquini@redhat.com \
    --cc=hughd@google.com \
    --cc=jmoyer@redhat.com \
    --cc=kosaki.motohiro@gmail.com \
    --cc=kzak@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lwoodman@redhat.com \
    --cc=mgorman@suse.de \
    --cc=riel@redhat.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;
as well as URLs for NNTP newsgroup(s).