linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
To: Rafael Aquini <aquini@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org, hughd@google.com, shli@kernel.org,
	kzak@redhat.com, jmoyer@redhat.com, riel@redhat.com,
	lwoodman@redhat.com, mgorman@suse.de, kosaki.motohiro@gmail.com
Subject: Re: [RFC PATCH 01/02] swap: discard while swapping only if SWAP_FLAG_DISCARD_CLUSTER
Date: Mon, 20 May 2013 20:55:33 -0400	[thread overview]
Message-ID: <519AC605.4070709@gmail.com> (raw)
In-Reply-To: <e3ae11727f13e1580ae66ce80845e9002ec90ea6.1369092449.git.aquini@redhat.com>

(5/20/13 8:04 PM), Rafael Aquini wrote:
> Intruduce a new flag to make page-cluster fine-grained discards while swapping
> conditional, as they can be considered detrimental to some setups. However,
> keep allowing batched discards at sys_swapon() time, when enabled by the
> system administrator. 
> 
> Signed-off-by: Rafael Aquini <aquini@redhat.com>
> ---
>  include/linux/swap.h |  8 +++++---
>  mm/swapfile.c        | 12 ++++++++----
>  2 files changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/swap.h b/include/linux/swap.h
> index 1701ce4..ab2e742 100644
> --- a/include/linux/swap.h
> +++ b/include/linux/swap.h
> @@ -19,10 +19,11 @@ struct bio;
>  #define SWAP_FLAG_PREFER	0x8000	/* set if swap priority specified */
>  #define SWAP_FLAG_PRIO_MASK	0x7fff
>  #define SWAP_FLAG_PRIO_SHIFT	0
> -#define SWAP_FLAG_DISCARD	0x10000 /* discard swap cluster after use */
> +#define SWAP_FLAG_DISCARD	0x10000 /* enable discard for swap areas */
> +#define SWAP_FLAG_DISCARD_CLUSTER 0x20000 /* discard swap clusters after use */

>From point of backward compatibility view, 0x10000 should be disable both discarding
when mount and when IO.
And, introducing new two flags, enable mount time discard and enable IO time discard.

IOW, Please consider newer kernel and older swapon(8) conbination.
Other than that, looks good to me.


--
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-21  0:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21  0:04 [RFC PATCH 00/02] swap: allowing a more flexible DISCARD policy Rafael Aquini
2013-05-21  0:04 ` [RFC PATCH 01/02] swap: discard while swapping only if SWAP_FLAG_DISCARD_CLUSTER Rafael Aquini
2013-05-21  0:55   ` KOSAKI Motohiro [this message]
2013-05-21 21:06     ` Rafael Aquini
2013-05-21  0:04 ` [RFC PATCH 02/02] swapon: add "cluster-discard" support Rafael Aquini
2013-05-21  1:02   ` KOSAKI Motohiro
2013-05-21 10:26     ` Karel Zak
2013-05-21 20:17       ` KOSAKI Motohiro
2013-05-21 21:13         ` Rafael Aquini
2013-05-21 22:01           ` KOSAKI Motohiro
2013-05-22 13:52             ` Jeff Moyer
2013-05-21 10:13   ` 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=519AC605.4070709@gmail.com \
    --to=kosaki.motohiro@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aquini@redhat.com \
    --cc=hughd@google.com \
    --cc=jmoyer@redhat.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).