linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rafael Aquini <aquini@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hughd@google.com,
	shli@kernel.org, kzak@redhat.com, jmoyer@redhat.com,
	kosaki.motohiro@gmail.com, riel@redhat.com, lwoodman@redhat.com,
	mgorman@suse.de
Subject: [PATCH 00/02] swap: allowing a more flexible DISCARD policy V2
Date: Sun, 26 May 2013 01:31:54 -0300	[thread overview]
Message-ID: <cover.1369529143.git.aquini@redhat.com> (raw)

Considering the use cases where the swap device supports discard:
a) and can do it quickly;
b) but it's slow to do in small granularities (or concurrent with other
   I/O);
c) but the implementation is so horrendous that you don't even want to
   send one down;

And assuming that the sysadmin considers it useful to send the discards down
at all, we would (probably) want the following solutions:

  i. do the fine-grained discards for freed swap pages, if device is 
     capable of doing so optimally;
 ii. do single-time (batched) swap area discards, either at swapon 
     or via something like fstrim (not implemented yet);
iii. allow doing both single-time and fine-grained discards; or
 iv. turn it off completely (default behavior)


As implemented today, one can only enable/disable discards for swap, but 
one cannot select, for instance, solution (ii) on a swap device like (b)
even though the single-time discard is regarded to be interesting, or
necessary to the workload because it would imply (1), and the device
is not capable of performing it optimally.

This patchset addresses the scenario depicted above by introducing a
way to ensure the (probably) wanted solutions (i, ii, iii and iv) can
be flexibly flagged through swapon(8) to allow a sysadmin to select
the best suitable swap discard policy accordingly to system constraints.

Changeset from V1:
01 (kernel)       swap: discard while swapping only if SWAP_FLAG_DISCARD_PAGES
* ensure backwards compatibility with older swapon(8) releases;      (mkosaki)

02 (util-linux) swapon: allow a more flexible swap discard policy
* introduce discard policy selector as an optional argument of --discard option;
* rename user-visible discard policy names;           (mkosaki, karel, jmoyer) 

--
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>

             reply	other threads:[~2013-05-26  4:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-26  4:31 Rafael Aquini [this message]
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
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=cover.1369529143.git.aquini@redhat.com \
    --to=aquini@redhat.com \
    --cc=akpm@linux-foundation.org \
    --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 \
    --cc=shli@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;
as well as URLs for NNTP newsgroup(s).