Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp87838pxv; Tue, 13 Jul 2021 22:44:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx98LY7yNUQmX5+21+VWbVBKBzeVAX3lYLwAwC9vasR/0jPcoNfyvscd8FIvl7bg/gWmOqF X-Received: by 2002:a17:907:3e88:: with SMTP id hs8mr10171228ejc.534.1626241492558; Tue, 13 Jul 2021 22:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626241492; cv=none; d=google.com; s=arc-20160816; b=SQ3OFhR7v6/M3aSYiHwQGcTv5Cg1CR+3bqarf3LlfqCLWoyTGi378d1BNpswLkj9Sl eXVUgjiDJ4P7ypWLyrnTEM7+7OeoPqy2waaXXNWA/f4vWompAU5YurdjlClIx8wmr3F8 crXPoZprFWSjBXNGgdzd6+kTJFW1sfhR8hPVDYhPK1CKMVCIzqYxXdNHLPqsF76h96Uq evvZmMQ+hxftAQUxfM0TfGt3pFzFIxE6ubBEsUV7jJZHSZPqqxG099UTTO/OcFUMNxbB 3Rucxwz56Xy9JHQbrVJRXVeAjEKWp8pAfy5gD4DUDAaSpCsXVv/wN5NhbRl9IHMyc2QA 0icQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=w0Zh1FaNIeHmI9GVj8h2vOVAdae8z/pZJcGsHZc1oV8=; b=Vtu+274yv3a5EsHIJAwUeiMzUaqTVkdgG+AYl5x05xXudW0VP4oyCgvc0n/TaOucmS CYL3sTPCf5TEkU2av6U7SbFcImPTbAzcnznHPYbqgFqRTSQCQi81W+qLJHp2yurxzLU6 eIn1tK5mX6w4H8W8wK8Y0dAuU8cYgTb7V3BIrogYpSzZFYZo1Zu4zhioTBXDkQVkIxue e8ZDweLHJIHYUXJsaEdzmo2AGzBGQDS+OfhxbveGB/GSrac+byABg5Gs2Dq/WOpLYiix Sjo2x4ovikb3TL6g6/FS87KoeH+2T8k0jJ/RYVhPU/acVtdwer6CYnc2HwMcQJPTHKP/ pWMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Vm0o20M9; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si1446924edd.302.2021.07.13.22.44.29; Tue, 13 Jul 2021 22:44:52 -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=@suse.com header.s=susede1 header.b=Vm0o20M9; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237943AbhGNFp4 (ORCPT + 99 others); Wed, 14 Jul 2021 01:45:56 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:48684 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237903AbhGNFpz (ORCPT ); Wed, 14 Jul 2021 01:45:55 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id A8A1A2025B; Wed, 14 Jul 2021 05:43:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1626241380; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=w0Zh1FaNIeHmI9GVj8h2vOVAdae8z/pZJcGsHZc1oV8=; b=Vm0o20M9JWN9Xa1tHFXAYZoOfGor4yHhrSmk3IT7mvZ0cQsvBaakMH46b2IpiVCbW6dwtI qjpX785zHJZ/xymUSAwNsdx05/G2IMHml0rtJiKM9LW7a+RkzRvJTq9ahbmIcLpu4eOfJB yHHtk7a9u6W8E3s+aWVFQlO7usYinQc= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 77F9CA3B81; Wed, 14 Jul 2021 05:43:00 +0000 (UTC) Date: Wed, 14 Jul 2021 07:43:00 +0200 From: Michal Hocko To: David Hildenbrand Cc: Evan Green , 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 Subject: Re: [PATCH v2] mm: Enable suspend-only swap spaces Message-ID: References: <20210709105012.v2.1.I09866d90c6de14f21223a03e9e6a31f8a02ecbaf@changeid> <30dddfb1-388c-a593-0987-73e821216da9@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30dddfb1-388c-a593-0987-73e821216da9@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 12-07-21 09:41:26, David Hildenbrand wrote: > 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. Is there anything preventing such a HW event doing the equivalent of the above? -- Michal Hocko SUSE Labs