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]
Message-ID: <CAE=gft5qdEvi=xtQEUwvCH=M_82daY-TRsosMMQ0SHVRCsr2JQ@mail.gmail.com>
Date:   Mon, 12 Jul 2021 14:36:39 -0700
From:   Evan Green <evgreen@...omium.org>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     David Hildenbrand <david@...hat.com>, Pavel Machek <pavel@....cz>,
        Alex Shi <alexs@...nel.org>,
        Alistair Popple <apopple@...dia.com>,
        Jens Axboe <axboe@...nel.dk>,
        Johannes Weiner <hannes@...xchg.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        Miaohe Lin <linmiaohe@...wei.com>,
        Michal Hocko <mhocko@...e.com>,
        Minchan Kim <minchan@...nel.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org
Subject: Re: [PATCH v2] mm: Enable suspend-only swap spaces

On Fri, Jul 9, 2021 at 4:33 PM Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> On Fri, 9 Jul 2021 16:23:18 -0700 Evan Green <evgreen@...omium.org> wrote:
>
> > On Fri, Jul 9, 2021 at 3:20 PM Andrew Morton <akpm@...ux-foundation.org> wrote:
> > >
> > > On Fri,  9 Jul 2021 10:50:48 -0700 Evan Green <evgreen@...omium.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).

Sure, I can augment the commit text to include some of this, and what
it would likely look like from the commandline. I'll send a v3 for
that.

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

Yes! I was originally planning to do that once this was accepted, but
can also spin it up in parallel if requested.
-Evan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ