Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1021810pxv; Fri, 9 Jul 2021 15:21:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwA8ilnMdBYj+rZqNK6PSCfllbCnn4kiVY3W2Qt+lwLqOV9SHGVySgy0Fy2xyZU4DwOzFK2 X-Received: by 2002:a5e:8612:: with SMTP id z18mr13394456ioj.38.1625869273482; Fri, 09 Jul 2021 15:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625869273; cv=none; d=google.com; s=arc-20160816; b=xvvGgXx9yREOgeFfuLMq2ozRZJvxhlD0y/mCjiUCbtFLN5++i7Tg7+47TUzV7wGjxk IGOCCnT6lLjViEabRW8qHzgrnn3FbD4U5a1oeoVXpYHIsn2pMc68h+OC83+ZIVtb0R/T k2RrkNeNwpv9w68Q1FJxGkEfusu0JMQbMre4nWJz/hp8R5UYY27PBreeFrns7MV3O8e5 Fr5HWmN4wednivaqiZARUDomPNJ9nrzyGYHlSlYpWUr4ogsMAT0J0sRm2H/dR0irz5kD jJjyl8PkAXM7hIe9lBKac0FatnSGnOagrM0EM7kZ4OXj8Qz9KyTotdeHxOnvsbjEITSn 1ixw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=BlC8yxZ1hwnx1n5KsXAkE9IuvL5MabxzsjVDTYvtD9E=; b=hajaeBruinFwefGSaZ0EIufy4ZC6AlLjN30YsKp1xkzw3mzZMuxxlnKn2cmcBke9HU cVHf/sYt+hefTCsDfPb6+6oqhub7XDORCw1n0M5+fYs3X6E3irqrwk7sYBjDum875GGx f44HouDbu/M29SlaUG7D5DzuU4xqmbcdMaeT0Caq61fguY5Z+PuJxkGdp0uD2fz5E/xJ RxBa54aaHmEND5M9rc941RBZ6n8lYEfXyBCvqMBBgjULUusWFVoeJr3snA6IQDwjlqmF IVxUtpTTY1RnMA8mnr8AW6sDkxqlGnSdHF2axoJ9/WJxlvebAMIDBXizfxxQjMsngSRW VriQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=O61Fj30Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t3si7961409iof.33.2021.07.09.15.20.58; Fri, 09 Jul 2021 15:21:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=O61Fj30Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229792AbhGIWXJ (ORCPT + 99 others); Fri, 9 Jul 2021 18:23:09 -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?