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=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 55EB6C35641 for ; Fri, 21 Feb 2020 09:36:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1B336207FD for ; Fri, 21 Feb 2020 09:36:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B336207FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C63156B000C; Fri, 21 Feb 2020 04:36:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C39F96B000D; Fri, 21 Feb 2020 04:36:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B79456B000E; Fri, 21 Feb 2020 04:36:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id A15CE6B000C for ; Fri, 21 Feb 2020 04:36:40 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 40C14181AC9CB for ; Fri, 21 Feb 2020 09:36:40 +0000 (UTC) X-FDA: 76513629360.10.crib31_746566b2fe025 X-HE-Tag: crib31_746566b2fe025 X-Filterd-Recvd-Size: 4743 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Feb 2020 09:36:39 +0000 (UTC) Received: by mail-wr1-f47.google.com with SMTP id w15so1193666wru.4 for ; Fri, 21 Feb 2020 01:36:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fttQOOv4xbgc3N7wuWKLpsK6IZKSEPyxzY4b9QO9DYU=; b=pi3EogWv5jAHKXaf5BWZSUv+XngDOguww+sbiBQoRCfUuu37i0iRGHzuyPU/kFrDvu c8Tzr5jWRqI1/AhmzCBchyFPThM/G7mWfb530HKCzRb0xypY/j51fwlgNcHyP5HK5d52 OpDk1UvkGS++ihBGNhHmYs/bM+wewwdjoTsSs/2O8GwRWwOlbFaa4UobrXrCCEEcc18B R3VTYjD96YXuLjJkgTJUb2tLZx5OLndV/FXxFhVFmo7cDDIrW8fRnqieE/T6V9uqaj6O 7P3qeWQXucVRow1YzunTxZHO1RPYnA5xK/J8xF4eA01LKMdh2Uyird7XIPmbzfecMuW6 tKUw== X-Gm-Message-State: APjAAAXtxRgNrSektumD0CCZtdmz3RPg1qeXZv84CTBaW20Oo3FwSSkP IV5F5YWDf0524obGmUwvly7eNsG2 X-Google-Smtp-Source: APXvYqwMB/j+4OtqvPIvMMYYGCukRtGpa/JsmfkBlrXsYAC/ivaoy+IatxHgOn7v0lN1eed3/4qMqA== X-Received: by 2002:a5d:540f:: with SMTP id g15mr45764094wrv.86.1582277798833; Fri, 21 Feb 2020 01:36:38 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id h13sm3293314wrw.54.2020.02.21.01.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 01:36:37 -0800 (PST) Date: Fri, 21 Feb 2020 10:36:35 +0100 From: Michal Hocko To: "Rafael J. Wysocki" Cc: Luigi Semenzato , Chris Murphy , Linux Memory Management List , Linux PM Subject: Re: is hibernation usable? Message-ID: <20200221093635.GN20509@dhcp22.suse.cz> References: <20200221084910.GM20509@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri 21-02-20 10:04:18, Rafael J. Wysocki wrote: > On Fri, Feb 21, 2020 at 9:49 AM Michal Hocko wrote: > > > > On Thu 20-02-20 09:38:06, Luigi Semenzato wrote: > > > I was forgetting: forcing swap by eating up memory is dangerous > > > because it can lead to unexpected OOM kills > > > > Could you be more specific what you have in mind? swapoff causing the > > OOM killer? > > > > > , but you can mitigate that > > > by giving the memory-eaters a higher OOM kill score. Still, some way > > > of calling try_to_free_pages() directly from user-level would be > > > preferable. I wonder if such API has been discussed. > > > > No, there is no API to trigger the global memory reclaim. You could > > start the reclaim by increasing min_free_kbytes but I wouldn't really > > recommend that unless you know exactly what you are doing and also I > > fail to see the point. If s2disk fails due to insufficient swap space > > then how can a pro-active reclaim help in the first place? > > My understanding of the problem is that the size of swap is > (theoretically) sufficient, but it is not used as expected during the > preallocation of image memory. > > It was stated in one of the previous messages (not in this thread, > cannot find it now) that swap (of the same size as RAM) was activated > (swapon) right before hibernation, so theoretically that should be > sufficient AFAICS. Hmm, this is interesting. Let me have a closer look... pm_restrict_gfp_mask which would completely rule out any IO happens after hibernate_preallocate_memory is done and my limited understanding tells me that this is where all the reclaim happens (via shrink_all_memory). It is quite possible that the MM decides to not swap in that path - depending on the memory usage - and miss it's target. More details would be needed. E.g. vmscan tracepoints could tell us more. -- Michal Hocko SUSE Labs