Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp98100ybg; Tue, 22 Oct 2019 16:50:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUyn0UE6wrNHr03dG88KQAM7lqCM5iHqnTCE2mMDzMBl22CkzqN3UWgp1R/SpMhqiHJjtB X-Received: by 2002:a17:906:1e54:: with SMTP id i20mr3704681ejj.227.1571788254394; Tue, 22 Oct 2019 16:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571788254; cv=none; d=google.com; s=arc-20160816; b=U+elmbFvBwLj1Fr0502ZJosIIq+aijGyBIy1KeW53xzciB8P8mq0Ak65H5HRfzvRfZ KoGSd/3W5m8xQAN1Jwi+Ne47NNxaAf6Q2g8l/1SNVeN5ZQDbmkWvwmBTyFuIcj+YNj6c vpK3M3uDEePtgvAgD/5mECcUYB0AFIodjSehPVLoW0A7eYDUSGoqzNxBhu4OeKJP7Hsv LfbYpQjxYmBcx83O0bAy6LFH/sShUF5Akijh+x+nMshw3DbR6ZPq0Gy9Ispz6O1j870H EUArVZHViZA/a0yy7ZVbahoGywHk3eY/4+8Wvjfdx4rbjcHQnmtyFVKjHkZYSTNoY6iV iWEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=UNVZthZu6v3pyXi3jOLBoCHiTliiyCL5CwMvuY+QdZE=; b=U42B/OQGL7pkNCIwd/h4lWXOGvgkH7/eIWjNoaY4JXS8HpD/+GqLcrwQOebh3i2J4N oWFcA9IabXjqhYLEkqx8KMVgTZmrW8BAXswyeeMFBUght2428HoNzOyLLgN/O0yiCH92 zVuetefnZYoX+3R08PaQSDJUz3kZzymlfBb4lOtckYFvdMfHgWbT8iLimlFHsTps0ohR tboYQrkyGHBfxXKgKAw9KiqgKOiLxhYKEPBnBePC/0zZezbnhrP5qS5sGEMLHSpZMIHg KF2vvW1saWGrtpPgLpNGTH/jmNm9/hfRwG+iz8ZEfFZIUC4Ff+xF2XgfmYYvHDiF5eE+ pugg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gEXFnTP6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q40si4293102eda.218.2019.10.22.16.50.16; Tue, 22 Oct 2019 16:50:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gEXFnTP6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389143AbfJVUJZ (ORCPT + 99 others); Tue, 22 Oct 2019 16:09:25 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:38030 "EHLO mail-wr1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388573AbfJVUJZ (ORCPT ); Tue, 22 Oct 2019 16:09:25 -0400 Received: by mail-wr1-f43.google.com with SMTP id v9so8209432wrq.5 for ; Tue, 22 Oct 2019 13:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=UNVZthZu6v3pyXi3jOLBoCHiTliiyCL5CwMvuY+QdZE=; b=gEXFnTP6XUv2nTHtG/e7Y+cBbJB7OGBg8CacRfchlei8vWM9WmtMeaGUqUqHp3V8W3 PkMq0tjl2m4mvxnB2/0/20VglzOf0ArWZHvFt74HoVgq85Z0IGTESTOPjOUdcRreyvVo ozdmXq93RhRzfIDS7moCYZVRNO4JI3ljbzpgi9a8M5YxwlTvP/EB6cK0R/xVGFRASmCo Vgkzoc5NejtFBkQGo8Q9GnzDKsWeS32j9ORhXzGrWMLjHgXdTAGJXFrQ/Nia+o1l6wF/ hOFd6mm+LvYXcsjzKTGikO7NzilqDBH1+DYwRU5DrrolouIED8HQh37CQhajqEKSL8vj +Gtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=UNVZthZu6v3pyXi3jOLBoCHiTliiyCL5CwMvuY+QdZE=; b=oEdkRXS6MqfbrqYOJHxxgC4NJJ+sgX1RI/bq+PpfEpQLceBbjiB9O/jYWDHBDOWLYH o7NIuP4DZyP8PxQl6oA59+ckH+VQD1UasC2natfj3kHP50K1moa/oyX6uz0D14LSsCG0 L3j0FdMAN3JH6BnZzGwjZ9gc+g8MahFtH4Sn6HoC43icOzUShLOjXAcwF6tyMrpq3OS8 z8AtgTv/HNHtKy25lE1eu0VS9CGRi759qtaBaY4rRcb1WGFUOkR6cRbaBAPYkv847pAf E89bgteCR8q3V9ifyvJcAlZ/lrNeennve+da0SqQt30B0n+DDoyWWuAB2X+ng1Ug+9NL A0qg== X-Gm-Message-State: APjAAAUDMpzwj/7Ru4yjN/24hx8Ti7/AJ9/p/kRoKh44jISyL844NZRR 10xrKkrqQTqHWbQgu1TnfQ44+ifZVImzFE66FgsXzcGbPG0= X-Received: by 2002:adf:e7c2:: with SMTP id e2mr4981661wrn.29.1571774962099; Tue, 22 Oct 2019 13:09:22 -0700 (PDT) MIME-Version: 1.0 From: Luigi Semenzato Date: Tue, 22 Oct 2019 13:09:10 -0700 Message-ID: Subject: is hibernation usable? To: linux-kernel Cc: Linux PM , Andrew Morton , Geoff Pike , Bas Nowaira , "Rafael J. Wysocki" , Sonny Rao , Brian Geffon Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Following a thread in linux-pm (https://marc.info/?l=linux-mm&m=157012300901871) I have some issues that may be of general interest. 1. To the best of my knowledge, Linux hibernation is guaranteed to fail if more than 1/2 of total RAM is in use (for instance, by anonymous pages). My knowledge is based on evidence, experiments, code inspection, the thread above, and a comment in Documentation/swsusp.txt, copied here: "Instead, we load the image into unused memory and then atomically copy it back to it original location. This implies, of course, a maximum image size of half the amount of memory." 2. There's no simple/general workaround. Rafael suggested on the thread "Whatever doesn't fit into 50% of RAM needs to be swapped out before hibernation". This is a good suggestion: I am actually close to achieving this using memcgroups, but it's a fair amount of work, and a fairly special case. Not everybody uses memcgroups, and I don't know of other reliable ways of forcing swap from user level. 3. A feature that works only when 1/2 of total RAM can be allocated is, in my opinion, not usable, except possibly under special circumstances, such as mine. Most of the available articles and documentation do not mention this important fact (but for the excerpt I mentioned, which is not in a prominent position). Two questions then: A. Should the documentation be changed to reflect this fact more clearly? I feel that the current situation is a disservice to the user community. B. Would it be worthwhile to improve the hibernation code to remove this limitation? Is this of interest to anybody (other than me)? Thank you in advance!