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=-7.2 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 21F00C6377D for ; Thu, 22 Jul 2021 17:25:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02B2661287 for ; Thu, 22 Jul 2021 17:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229801AbhGVQoe (ORCPT ); Thu, 22 Jul 2021 12:44:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbhGVQoc (ORCPT ); Thu, 22 Jul 2021 12:44:32 -0400 Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6AA7C061575 for ; Thu, 22 Jul 2021 10:25:07 -0700 (PDT) Received: by mail-qt1-x834.google.com with SMTP id r17so4733073qtp.5 for ; Thu, 22 Jul 2021 10:25:07 -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=uEFq+AoRTm11R6uCVQcmvnevcQX1q6Q/z0Ka5ymSSsI=; b=PxC+1qAM+LiGC9/AqtUM9wFshgBXJ7k34p5t9jtIY6MU7Gz56O3Ews8ITNFwZPwuQV rrymVFx3fLPqJ9YttbM1AavDvQ7ibkE1EBE2qOUR5iw+Tzgej9OhLlDrjVEiTGU7BswJ ic45iKRQyyPrQ0+6VsrwaCgcGigcAf1WMlm3E= 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=uEFq+AoRTm11R6uCVQcmvnevcQX1q6Q/z0Ka5ymSSsI=; b=PlgQxmolHRaQtXMtR29qpgF6S7P7Hx77PThE/ugY9QBVy77zm8gUx9YRnrLdPg8F1J apTc9XhG8qdD1SYtl0S76nXsVmNfu5Ze1y+qbf/ZrU4fMlHt5ZTaQnjuqjHqbq5i3t2E 8Xv7dLfFE5Ioc4h+sTiFEvyg/Hf8Jrt84KOTxBC2TR/pySsRnpqnnZaJqRdNy0G0Bs/o A0TyXyBvzsRI7hna1VPu+andUVKOL3vaFIDKXvucKrG2YdRpyhryYywSKIrXar20S01u Pzo6AF7MHy7uaCVLYI7enEFy4LKkKlw19wz+LHhhq72TliAxkOAqxgIH7RLHCDO8GsUm uGig== X-Gm-Message-State: AOAM531XDQpY9opEKAJqyUb7g2GkkUTRftetQBFwSDg3YvDIvlepi9e+ GfhTCAlNuPxV6387tDpEXdjxUp3CUlrJ8g== X-Google-Smtp-Source: ABdhPJxdy+1iehcXgRbFyL922LpbQpCGAUBU4KaFLuiqxUpirXbU3zZ5kqg3TcO89IPxMq+YLntpJA== X-Received: by 2002:ac8:5e91:: with SMTP id r17mr668526qtx.48.1626974706832; Thu, 22 Jul 2021 10:25:06 -0700 (PDT) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com. [209.85.222.181]) by smtp.gmail.com with ESMTPSA id z23sm8588605qts.96.2021.07.22.10.25.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Jul 2021 10:25:06 -0700 (PDT) Received: by mail-qk1-f181.google.com with SMTP id j184so6111132qkd.6 for ; Thu, 22 Jul 2021 10:25:06 -0700 (PDT) X-Received: by 2002:a02:6d5d:: with SMTP id e29mr526246jaf.44.1626974215148; Thu, 22 Jul 2021 10:16:55 -0700 (PDT) MIME-Version: 1.0 References: <20210721143946.v3.1.I09866d90c6de14f21223a03e9e6a31f8a02ecbaf@changeid> <20210721150926.ce56fb8b5fa733d9727bd37e@linux-foundation.org> In-Reply-To: <20210721150926.ce56fb8b5fa733d9727bd37e@linux-foundation.org> From: Evan Green Date: Thu, 22 Jul 2021 10:16:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] mm: Enable suspend-only swap spaces To: Andrew Morton 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 , LKML , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 21, 2021 at 3:09 PM Andrew Morton wrote: > > 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? Yes, I'll work on that today. Thanks Andrew! -Evan 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=-7.2 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 5B7BBC6377D for ; Thu, 22 Jul 2021 17:23:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AF80861241 for ; Thu, 22 Jul 2021 17:23:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF80861241 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 F286A6B0036; Thu, 22 Jul 2021 13:23:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED9266B005D; Thu, 22 Jul 2021 13:23:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC7EF6B006C; Thu, 22 Jul 2021 13:23:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C0AE66B0036 for ; Thu, 22 Jul 2021 13:23:21 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 62993181AEF1A for ; Thu, 22 Jul 2021 17:23:21 +0000 (UTC) X-FDA: 78390895002.12.4419C0D Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) by imf03.hostedemail.com (Postfix) with ESMTP id 05D0E30002C7 for ; Thu, 22 Jul 2021 17:23:19 +0000 (UTC) Received: by mail-qt1-f182.google.com with SMTP id v14so4716882qtc.8 for ; Thu, 22 Jul 2021 10:23:19 -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=uEFq+AoRTm11R6uCVQcmvnevcQX1q6Q/z0Ka5ymSSsI=; b=PxC+1qAM+LiGC9/AqtUM9wFshgBXJ7k34p5t9jtIY6MU7Gz56O3Ews8ITNFwZPwuQV rrymVFx3fLPqJ9YttbM1AavDvQ7ibkE1EBE2qOUR5iw+Tzgej9OhLlDrjVEiTGU7BswJ ic45iKRQyyPrQ0+6VsrwaCgcGigcAf1WMlm3E= 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=uEFq+AoRTm11R6uCVQcmvnevcQX1q6Q/z0Ka5ymSSsI=; b=juUMTo7EeiKJDLumQJwJpR4faNLPpQ1+k7ZT9OjTJi7U4lYCfCtmmylH6oE0Tjc85z 8QdIeMLHokIS8Le4SPmb/tJoxHK6nuYEKaZg1fXHe09eh9sSDHD4QxP7yupGCSUzBioZ hwP+Rrve1aIMwKR3xq2IFmmcAKZExs4rPYPp1pWV11QMna6F35+8b5kl9l87/9Yhu+YH 9PT1+qI/y5t0u++qu3q+Bt7ok5ujEtLVdRlHyEA54kf3C11NCmpPLIALfiqg3MskIwOV NP4PavysgsOTtzQ6dvSMLZLv0zh4bPA8fSaQ6CmjBZ4aaRKU2tkOh29URGeFKYtjsl3P za+g== X-Gm-Message-State: AOAM532mP6YNc7FZjO7rsDXkhCQrXh9yj1UDGPx1R6QHkorP3RjhUWwV P/qMJh37TTgZyBukoo5HIgpjYr0y8wHe0w== X-Google-Smtp-Source: ABdhPJwbFNr50f96Lb7+Mv5J8QQanBIF94oejp2rUwMBVkY6YicB7DmIUfumLDoQV+g+Yqen9qzqnQ== X-Received: by 2002:ac8:5752:: with SMTP id 18mr655351qtx.298.1626974599083; Thu, 22 Jul 2021 10:23:19 -0700 (PDT) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com. [209.85.222.169]) by smtp.gmail.com with ESMTPSA id a24sm10939522qtj.43.2021.07.22.10.23.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Jul 2021 10:23:18 -0700 (PDT) Received: by mail-qk1-f169.google.com with SMTP id j184so6105954qkd.6 for ; Thu, 22 Jul 2021 10:23:18 -0700 (PDT) X-Received: by 2002:a02:6d5d:: with SMTP id e29mr526246jaf.44.1626974215148; Thu, 22 Jul 2021 10:16:55 -0700 (PDT) MIME-Version: 1.0 References: <20210721143946.v3.1.I09866d90c6de14f21223a03e9e6a31f8a02ecbaf@changeid> <20210721150926.ce56fb8b5fa733d9727bd37e@linux-foundation.org> In-Reply-To: <20210721150926.ce56fb8b5fa733d9727bd37e@linux-foundation.org> From: Evan Green Date: Thu, 22 Jul 2021 10:16:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] mm: Enable suspend-only swap spaces To: Andrew Morton 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 , LKML , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 05D0E30002C7 X-Stat-Signature: ep79rgb93pn395ad9hjoaxhf3rqp6qdr Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=PxC+1qAM; spf=pass (imf03.hostedemail.com: domain of evgreen@chromium.org designates 209.85.160.182 as permitted sender) smtp.mailfrom=evgreen@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-HE-Tag: 1626974599-292939 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 Wed, Jul 21, 2021 at 3:09 PM Andrew Morton wrote: > > 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? Yes, I'll work on that today. Thanks Andrew! -Evan