lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 21 May 2013 16:17:04 -0400
From:	KOSAKI Motohiro <kosaki.motohiro@...il.com>
To:	Karel Zak <kzak@...hat.com>
CC:	KOSAKI Motohiro <kosaki.motohiro@...il.com>,
	Rafael Aquini <aquini@...hat.com>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	akpm@...ux-foundation.org, hughd@...gle.com, shli@...nel.org,
	jmoyer@...hat.com, riel@...hat.com, lwoodman@...hat.com,
	mgorman@...e.de
Subject: Re: [RFC PATCH 02/02] swapon: add "cluster-discard" support

(5/21/13 6:26 AM), Karel Zak wrote:
> On Mon, May 20, 2013 at 09:02:43PM -0400, KOSAKI Motohiro wrote:
>>> -	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).
> 
>  Hmm.. currently we don't use any fallback for any swap flag (e.g.
>  0x10000) for compatibility with old kernels. Maybe it's better to
>  keep it simple and stupid and return an error message than introduce
>  any super-smart semantic to hide incompatible fstab configuration.

Hm. If so, I'd propose to revert the following change. 

> .B "\-d, \-\-discard"
>-Discard freed swap pages before they are reused, if the swap
>-device supports the discard or trim operation.  This may improve
>-performance on some Solid State Devices, but often it does not.
>+Enables swap discards, if the swap device supports that, and performs
>+a batch discard operation for the swap device at swapon time.


And instead, I suggest to make --discard-on-swapon like the following.
(better name idea is welcome) 

+--discard-on-swapon
+Enables swap discards, if the swap device supports that, and performs
+a batch discard operation for the swap device at swapon time.

I mean, preserving flags semantics removes the reason we need make a fallback.


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

Powered by Openwall GNU/*/Linux Powered by OpenVZ