From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 113EDC07E99 for ; Mon, 12 Jul 2021 21:37:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 95AEE61167 for ; Mon, 12 Jul 2021 21:37:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95AEE61167 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B57C06B0092; Mon, 12 Jul 2021 17:37:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B07996B0095; Mon, 12 Jul 2021 17:37:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A8946B0096; Mon, 12 Jul 2021 17:37:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id 796CA6B0092 for ; Mon, 12 Jul 2021 17:37:19 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 7D9FC267D5 for ; Mon, 12 Jul 2021 21:37:18 +0000 (UTC) X-FDA: 78355246956.32.65DC4B8 Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) by imf10.hostedemail.com (Postfix) with ESMTP id 3728D60019B5 for ; Mon, 12 Jul 2021 21:37:18 +0000 (UTC) Received: by mail-il1-f178.google.com with SMTP id a11so21121423ilf.2 for ; Mon, 12 Jul 2021 14:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1pWHLTVi/seYJklLFaD8uR16Mpsf9bybDbOoEox28Wk=; b=betyJUHVcpTHSCBSeD07sN0K8C6tPSmZfCoDPfxQES5lDAfQVYaMfIA26BViacjgf2 5X0L1rehs/mU2fK8En0euAyLpE7ibLO34iDwprIyh72moTtkvExMovhrF5ZLsG1El0Hx /fmZtmDd1tR5l9VwGr4CsUWbFoCLTz5D2Ijlc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1pWHLTVi/seYJklLFaD8uR16Mpsf9bybDbOoEox28Wk=; b=ejq5Zkscd47I5lYgoYDlJZwicyc7hKW0QPNfgDYPcCsb2b9vHw48N21G6CGXcjWnEs T8ys9Q//MFQerjW34LEDyYZv/JCYC9KnDCjoWchRxZSH0Z9ogTsBmUpNjh3EZdr9ua7B +OTZsfqVKTSQBdmNkwaHRWfHusWbVfzMGWnhoHIzm4M2TA4KJ2eAmEY/UXpn24B63WVD 9gqyWQkFhrYQSJ5gIPXHsEUd5qpfJHALnD8h7ZQokBMTHpXm8uTEEU1KoqayCP3RWGvl LvZYQl6cjA1WjkD7BXT1R06dyCfcDh50+A9Xfz2P/AMIIbWuEJsGMZS26UphY6gtEwFU uIsA== X-Gm-Message-State: AOAM531cxmkUJHC2oMQVPo/7hGIE6j3xL+loyrcWw7PYhQcxTocMB+j4 g0385pdx14atRb2N4T70H8Vfgu+QPs6Jfg== X-Google-Smtp-Source: ABdhPJwkbRJVuLUuoD8wchkOJFl6NVDy4C3dhd726pl7sOG8C2AQxbstU79/OEveQT7WsQ5ak/Vfbw== X-Received: by 2002:a92:d8d2:: with SMTP id l18mr600524ilo.165.1626125837413; Mon, 12 Jul 2021 14:37:17 -0700 (PDT) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com. [209.85.166.43]) by smtp.gmail.com with ESMTPSA id f4sm8933814ile.8.2021.07.12.14.37.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jul 2021 14:37:16 -0700 (PDT) Received: by mail-io1-f43.google.com with SMTP id l18so19552622iow.4 for ; Mon, 12 Jul 2021 14:37:15 -0700 (PDT) X-Received: by 2002:a02:2a07:: with SMTP id w7mr911188jaw.96.1626125835291; Mon, 12 Jul 2021 14:37:15 -0700 (PDT) MIME-Version: 1.0 References: <20210709105012.v2.1.I09866d90c6de14f21223a03e9e6a31f8a02ecbaf@changeid> <20210709152024.36f650dfec4c66ef3a60a845@linux-foundation.org> <20210709163328.16fcdd3601d1ba0b93baad65@linux-foundation.org> In-Reply-To: <20210709163328.16fcdd3601d1ba0b93baad65@linux-foundation.org> From: Evan Green Date: Mon, 12 Jul 2021 14:36:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] mm: Enable suspend-only swap spaces To: Andrew Morton Cc: David Hildenbrand , Pavel Machek , Alex Shi , Alistair Popple , Jens Axboe , Johannes Weiner , Joonsoo Kim , "Matthew Wilcox (Oracle)" , Miaohe Lin , Michal Hocko , Minchan Kim , Vlastimil Babka , LKML , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=betyJUHV; spf=pass (imf10.hostedemail.com: domain of evgreen@chromium.org designates 209.85.166.178 as permitted sender) smtp.mailfrom=evgreen@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-Rspamd-Server: rspam05 X-Stat-Signature: 1uys3m8t1rise34r7393uykp9ff8td3w X-Rspamd-Queue-Id: 3728D60019B5 X-HE-Tag: 1626125838-370574 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jul 9, 2021 at 4:33 PM Andrew Morton wrote: > > On Fri, 9 Jul 2021 16:23:18 -0700 Evan Green wrote: > > > On Fri, Jul 9, 2021 at 3:20 PM Andrew Morton wrote: > > > > > > On Fri, 9 Jul 2021 10:50:48 -0700 Evan Green 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