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.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS 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 8E6DFC07E9B for ; Fri, 9 Jul 2021 22:20:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F2FD3613C2 for ; Fri, 9 Jul 2021 22:20:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2FD3613C2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 986736B0073; Fri, 9 Jul 2021 18:20:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9368E6B0078; Fri, 9 Jul 2021 18:20:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FE896B007B; Fri, 9 Jul 2021 18:20:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 58AB66B0073 for ; Fri, 9 Jul 2021 18:20:27 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8817080CF33D for ; Fri, 9 Jul 2021 22:20:26 +0000 (UTC) X-FDA: 78344469252.28.A606F13 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf23.hostedemail.com (Postfix) with ESMTP id 2C7F19000093 for ; Fri, 9 Jul 2021 22:20:26 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id DB4BD6135D; Fri, 9 Jul 2021 22:20:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1625869225; bh=YxOGHnFK7zHo3ZQ1uL7Ew9G7n9/Bc/0BlbJmvQtw/0g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=O61Fj30YeJr0FncTJMCR8+Vwu+hqNy9pPStQCkOhJyQUaA3huJaNZxglYU60lMmm+ 7iDazENg1KolkNRqd7BqFaJo94jdbj2HHmjzXsRdPVSgxw87TmiKicgqErzvKSWqtf a4TOZQZEvrD5pnCVVrMrCB00Fd5vchK2y1xoZW7Y= Date: Fri, 9 Jul 2021 15:20:24 -0700 From: Andrew Morton To: Evan Green 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 , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] mm: Enable suspend-only swap spaces Message-Id: <20210709152024.36f650dfec4c66ef3a60a845@linux-foundation.org> In-Reply-To: <20210709105012.v2.1.I09866d90c6de14f21223a03e9e6a31f8a02ecbaf@changeid> References: <20210709105012.v2.1.I09866d90c6de14f21223a03e9e6a31f8a02ecbaf@changeid> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 2C7F19000093 X-Stat-Signature: 75bryczxw9q8a3wkfs8hubd5j1mbkbpf Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=O61Fj30Y; spf=pass (imf23.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1625869226-423493 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, 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? Once we have a description of how this thing gets set, please let's discuss what happens if someone tries to enable generic swap onto that device after hibernation has set SWAP_FLAG_NOSWAP (I'm basically guessing now). Will it work? Is there a backward-compatibility issue here?