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 A2304C07E99 for ; Fri, 9 Jul 2021 22:20:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77288613BE for ; Fri, 9 Jul 2021 22:20:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231225AbhGIWXK (ORCPT ); Fri, 9 Jul 2021 18:23:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:52392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbhGIWXJ (ORCPT ); Fri, 9 Jul 2021 18:23:09 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?