linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Evan Green <evgreen@chromium.org>
Cc: David Hildenbrand <david@redhat.com>, Pavel Machek <pavel@ucw.cz>,
	Alex Shi <alexs@kernel.org>, Alistair Popple <apopple@nvidia.com>,
	Jens Axboe <axboe@kernel.dk>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Miaohe Lin <linmiaohe@huawei.com>, Michal Hocko <mhocko@suse.com>,
	Minchan Kim <minchan@kernel.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH v2] mm: Enable suspend-only swap spaces
Date: Fri, 9 Jul 2021 16:33:28 -0700	[thread overview]
Message-ID: <20210709163328.16fcdd3601d1ba0b93baad65@linux-foundation.org> (raw)
In-Reply-To: <CAE=gft48qBiq_cbdf2AZa_Ap1eB3BBvrLLD3m2cBwkYPy3b8Nw@mail.gmail.com>

On Fri, 9 Jul 2021 16:23:18 -0700 Evan Green <evgreen@chromium.org> wrote:

> On Fri, Jul 9, 2021 at 3:20 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > On Fri,  9 Jul 2021 10:50:48 -0700 Evan Green <evgreen@chromium.org> wrote:
> >
> > > 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.
> > >
> > > Swap regions with SWAP_FLAG_NOSWAP set will not appear in /proc/meminfo
> > > under SwapTotal and SwapFree, since they are not usable as general swap.
> > >
> >
> > This patch doesn't appear to set SWAP_FLAG_NOSWAP anywhere.  Perhaps
> > there's another patch somewhere which changes the hibernation code?  If
> > so, can we please have both patches in a series?
> 
> There's no other patch, in the kernel at least. SWAP_FLAG_* is exposed
> to usermode, which would set it when calling swapon(2). Once this
> patch is accepted, I'll have to add the option into util-linux [1], so
> that I can use it in my init scripts.
> 
> Said a different way, this patch isn't about altering how hibernate
> behaves, but about giving usermode the freedom to set up hibernate and
> swap independently.

OK, can we please get this into the changelog?  And it would be helpful
to describe how this will be invoked via swapon(8).

And I expect an update to the swapon syscall's manpage will be in order.



  reply	other threads:[~2021-07-09 23:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 17:50 [PATCH v2] mm: Enable suspend-only swap spaces Evan Green
2021-07-09 22:20 ` Andrew Morton
2021-07-09 23:23   ` Evan Green
2021-07-09 23:33     ` Andrew Morton [this message]
2021-07-12 21:36       ` Evan Green
2021-07-12  7:03 ` Michal Hocko
2021-07-12  7:41   ` David Hildenbrand
2021-07-14  5:43     ` Michal Hocko
2021-07-14  7:51       ` David Hildenbrand
2021-07-14  8:00         ` Michal Hocko
2021-07-27 12:04         ` Pavel Machek
2021-07-27 12:19           ` David Hildenbrand
2021-07-27 12:01     ` Pavel Machek
2021-07-12 21:32   ` Evan Green
2021-07-14  5:41     ` Michal Hocko
2021-07-14 22:39       ` Evan Green
2021-07-27 12:10         ` Pavel Machek

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=20210709163328.16fcdd3601d1ba0b93baad65@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alexs@kernel.org \
    --cc=apopple@nvidia.com \
    --cc=axboe@kernel.dk \
    --cc=david@redhat.com \
    --cc=evgreen@chromium.org \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.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).