Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp46145pxv; Wed, 21 Jul 2021 15:11:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyr51TnI9cJ5eEBrZUb2pULqU5Cfb+88xQVPjNHv3voXz85R875ixZ+qeRB7cx+Vhe8vtkx X-Received: by 2002:a05:6638:3a4:: with SMTP id z4mr32669374jap.65.1626905461289; Wed, 21 Jul 2021 15:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626905461; cv=none; d=google.com; s=arc-20160816; b=pVFGbmHHaiIHU9WxaDWDLV+RAQJB0R6ygkwdPIsQPqngJdxaod6NeKOYImBQoyyYfT MeWC43qohEwIR9isx3NTZWNIwMRBG/2hkVlQX4yUOpQWjPi9xG7aCvVA54xm8Lkt1G/o QkELSlwLHpvQqbw0Y47+LnyR3uN2f35p5dhRbqbR+QD23ifW/yKXWh7hHtXsXLuHTu8a APpPb/LyrXCKZcoooEyR7LWv058flMZtbiTFXa7686qn8B3BJ5UUO+7yEwpWXnkTTTKO 3oOv1+PUogba2TXd0b5CvgLSmOwFMumhCogwpDh+SCg6QBikpAHkK/sHsG5hEzXjWUDk wB1A== 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=PRQoUBPPz4e4sUfzFOCLjWQaNo5+DiCFjgZEi4qcw+U=; b=Apw5AIjOrVk4+UudOvBNbh50vfGKE0vM+Xzogd0vwYRhFXYxtmFpEp4yyfQngVhgVd aCXd9muK+vXQ6yIR70jij/PKaZGiAxBb3hYUHJYEPitoQIau1pmLJ19JYqFi7oe8ApgM Gk6bfN3rMqOfCxLivlUka+6G40R/8VNnLKMmESVRMILwBQBHZWx0JANulTLL+Vx7kFrW Y/A3Bnj6RaZSSbf+isHEqjidtB74T1izK8inOckLw1/rgzEkrDXstkx99541mxWM7Lkz JblUWlirriD4z9d9l6AvVj3DprOxvSrokk/FlnDSU5HPgfk9amup+6xwoSeKujmrI+ZW BgwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=CzFN5nvR; 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 16si16360829ioe.32.2021.07.21.15.10.48; Wed, 21 Jul 2021 15:11:01 -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=CzFN5nvR; 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 S229809AbhGUV2w (ORCPT + 99 others); Wed, 21 Jul 2021 17:28:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:43724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbhGUV2w (ORCPT ); Wed, 21 Jul 2021 17:28:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1768560FD7; Wed, 21 Jul 2021 22:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1626905368; bh=vXdm+vn+XFhJA3Kvx7SiR6QB9bWzL6cufqSZNd0/ZjI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CzFN5nvRhWnOXfFa5pKgVVGsOSxFkTBYZkbC8+GFmLi1HGIoXOYxLTcl0z+yBibG7 guR6c260lMY+0YTCtGCn5RNmBDCVQl/XBtkgbYmTB4l8DnrXDgsCggDZifbf19Mtp/ jF9KM70Xr74hrDPINGcTMCrBuSTZCsYTcMFg2eu8= Date: Wed, 21 Jul 2021 15:09:26 -0700 From: Andrew Morton To: Evan Green Cc: linux-api@vger.kernel.org, David Hildenbrand , Michal Hocko , Pavel Machek , Alex Shi , Alistair Popple , Johannes Weiner , Joonsoo Kim , "Matthew Wilcox (Oracle)" , Miaohe Lin , Minchan Kim , Suren Baghdasaryan , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3] mm: Enable suspend-only swap spaces Message-Id: <20210721150926.ce56fb8b5fa733d9727bd37e@linux-foundation.org> In-Reply-To: <20210721143946.v3.1.I09866d90c6de14f21223a03e9e6a31f8a02ecbaf@changeid> References: <20210721143946.v3.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 Wed, 21 Jul 2021 14:40:28 -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. Swap and hibernate also have different security/integrity > requirements, prompting folks to possibly set up something like block-level > integrity for swap and image-level integrity for hibernate. Keeping swap > and hibernate separate in these cases becomes not just a matter of > preference, but correctness. > > 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. This flag will be passed in by utilities like swapon(8), usage would > probably look something like: swapon -o noswap /dev/sda2. Will patches to swapon and its manpage be prepared? > 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. >