[lkml]   [2021]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v1] mm: Enable suspend-only swap spaces

> Currently it's not possible to enable hibernation without also enabling
> generic swap for a given swap area. These two use cases are not the
> same. For example there may be users who want to enable hibernation,
> but whose drives don't have the write endurance for generic swap
> activities.
> Add a new SWAP_FLAG_NOSWAP that adds a swap region but refuses to allow
> generic swapping to it. This region can still be wired up for use in
> suspend-to-disk activities, but will never have regular pages swapped to
> it.
> Signed-off-by: Evan Green <>

Makes sense to me.

Reviewed-by: Pavel Machek <>

> #define SWAP_FLAG_DISCARD_ONCE 0x20000 /* discard swap area at swapon-time */
> #define SWAP_FLAG_DISCARD_PAGES 0x40000 /* discard page-clusters after use */
> +#define SWAP_FLAG_NOSWAP 0x80000 /* use only for suspend, not swap */

I'd say "only for hibernation". And actually maybe code would be more clear if logic was reverted.

Aha, and you may want to check... does the hibernation still work for you without the swap?

Because we need half memory free to create swap image and swap is really quite useful for that.

Best regards,
(cesky, pictures)

 \ /
  Last update: 2021-07-01 22:03    [W:0.087 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site