[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <519AC7B3.5060902@gmail.com>
Date: Mon, 20 May 2013 21:02:43 -0400
From: KOSAKI Motohiro <kosaki.motohiro@...il.com>
To: Rafael Aquini <aquini@...hat.com>
CC: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org, hughd@...gle.com, shli@...nel.org,
kzak@...hat.com, jmoyer@...hat.com, riel@...hat.com,
lwoodman@...hat.com, mgorman@...e.de, kosaki.motohiro@...il.com
Subject: Re: [RFC PATCH 02/02] swapon: add "cluster-discard" support
> +.B "\-c, \-\-cluster\-discard"
> +Swapping will discard clusters of swap pages in between freeing them
> +and re-writing to them, if the swap device supports that. This option
> +also implies the
> +.I \-d, \-\-discard
> +swapon flag.
I'm not sure this is good idea. Why can't we make these flags orthogonal?
> /* If true, don't complain if the device/file doesn't exist */
> static int ifexists;
> @@ -570,8 +574,11 @@ static int do_swapon(const char *orig_special, int prio,
> << SWAP_FLAG_PRIO_SHIFT);
> }
> #endif
> - if (fl_discard)
> + if (fl_discard) {
> flags |= SWAP_FLAG_DISCARD;
> + if (fl_discard > 1)
> + flags |= SWAP_FLAG_DISCARD_CLUSTER;
This is not enough, IMHO. When running this code on old kernel, swapon() return EINVAL.
At that time, we should fall back swapon(0x10000).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists