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=-9.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 EAE2EC11F67 for ; Mon, 12 Jul 2021 07:41:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 710C461208 for ; Mon, 12 Jul 2021 07:41:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 710C461208 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8A7966B008A; Mon, 12 Jul 2021 03:41:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 87EE66B008C; Mon, 12 Jul 2021 03:41:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F8986B0096; Mon, 12 Jul 2021 03:41:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id 4E24C6B008A for ; Mon, 12 Jul 2021 03:41:33 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6EB1D22AC8 for ; Mon, 12 Jul 2021 07:41:32 +0000 (UTC) X-FDA: 78353140824.03.FD1B984 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 19E33900024F for ; Mon, 12 Jul 2021 07:41:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626075691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9UxiIsS2bDCDwcOogs+eEqta/QcjF32ApVFvqJdxX48=; b=e4KvFw6Mlr3IHm5QXv/cILj2lwKvSXziO9I2UwKFoxLFlP33J4GLVRs0v6rwWWI5Vqbaiq KQ057kNzsXKxIdU9SGTYDLK5q42mtyWA9PYcOwXC5wFhb0X6waJO74YSy271paH2ybr7mj 0b7JHj6vQeKoosaopib7Gp/e2B3FSyI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-514-qzlOZvzjN7utZIAtnJeIAA-1; Mon, 12 Jul 2021 03:41:30 -0400 X-MC-Unique: qzlOZvzjN7utZIAtnJeIAA-1 Received: by mail-wm1-f69.google.com with SMTP id v25-20020a1cf7190000b0290197a4be97b7so5932359wmh.9 for ; Mon, 12 Jul 2021 00:41:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=9UxiIsS2bDCDwcOogs+eEqta/QcjF32ApVFvqJdxX48=; b=VupDLiEtHL1n5UGzo8u1rmzci4hcVxepdIMsZshztQ3fDlIN1ZRAsQMUnGPLTyehDr hs7Qf9s38cybPn3dtmPPmuto06LewNo0MnlT3fGXWs5SoS3dMKFqRdYQz/5ZzCaeWMAq zSymYXfE9dKbTdz7keTiQKKuTGVNkPY2rCkjaxwn+GK9lRqJjbsL+J8VbzffKv8nn139 GEmJY3gATuGAB5FCyC5hSZ1YwwA9ojYpZyG/tIQAoSuB7B5lD7tWUJIl6jsxv+ajNOiC JAUmIZDCQ8yQhg+arKXwVGCTOUbhWqK83BQCPK3uJyQ4a1yseBKDfBfGVYsepW9a3S/7 VU2Q== X-Gm-Message-State: AOAM5335hjSclukwTY08Ykvdf9F9B00kYspjSFVyypmxLVrTz0aF0zO/ c8PPMHOfjpUfQWirHZd6BSExSWfMKocPKyjy08AUDwYQ3QwOeWGnfAyjSHSkz1VwFpQe7R+PKEt xLwi4m4/uRws= X-Received: by 2002:adf:f085:: with SMTP id n5mr38427768wro.148.1626075689087; Mon, 12 Jul 2021 00:41:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuph2xUEhOYsAOR+5Ndv4BRqy6A3z+3Uiy1VN8XUXUPlWOD/N6tuZKznFC2+4OHoqeGdmqWw== X-Received: by 2002:adf:f085:: with SMTP id n5mr38427734wro.148.1626075688834; Mon, 12 Jul 2021 00:41:28 -0700 (PDT) Received: from ?IPv6:2003:d8:2f0a:7f00:fad7:3bc9:69d:31f? (p200300d82f0a7f00fad73bc9069d031f.dip0.t-ipconnect.de. [2003:d8:2f0a:7f00:fad7:3bc9:69d:31f]) by smtp.gmail.com with ESMTPSA id b6sm2679799wmj.34.2021.07.12.00.41.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jul 2021 00:41:27 -0700 (PDT) Subject: Re: [PATCH v2] mm: Enable suspend-only swap spaces To: Michal Hocko , Evan Green Cc: Andrew Morton , Pavel Machek , Alex Shi , Alistair Popple , Jens Axboe , Johannes Weiner , Joonsoo Kim , "Matthew Wilcox (Oracle)" , Miaohe Lin , Minchan Kim , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org References: <20210709105012.v2.1.I09866d90c6de14f21223a03e9e6a31f8a02ecbaf@changeid> From: David Hildenbrand Organization: Red Hat Message-ID: <30dddfb1-388c-a593-0987-73e821216da9@redhat.com> Date: Mon, 12 Jul 2021 09:41:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e4KvFw6M; spf=none (imf29.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: nxj543c6ieyfo7iwt6esi7xtsk1idfmc X-Rspamd-Queue-Id: 19E33900024F X-Rspamd-Server: rspam01 X-HE-Tag: 1626075691-743820 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 12.07.21 09:03, Michal Hocko wrote: > [Cc linux-api] > > On Fri 09-07-21 10:50:48, 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. > > Could you expand some more on why a strict exclusion is really > necessary? I do understand that one might not want to have swap storage > available all the time but considering that swapon is really a light > operation so something like the following should be a reasonable > workaround, no? > swapon storage/file > s2disk > swapoff storage I'm certainly not a hibernation expert, but I'd guess this can also be triggered by HW events, so from the kernel and not only from user space where your workaround would apply. -- Thanks, David / dhildenb