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=-2.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 D112FC28CBC for ; Sun, 3 May 2020 19:58:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6FDCD20644 for ; Sun, 3 May 2020 19:58:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WBLz7pPo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FDCD20644 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D09DB8E0005; Sun, 3 May 2020 15:58:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CBAB98E0001; Sun, 3 May 2020 15:58:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD13D8E0005; Sun, 3 May 2020 15:58:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id A52588E0001 for ; Sun, 3 May 2020 15:58:33 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5C2D8180AD83B for ; Sun, 3 May 2020 19:58:33 +0000 (UTC) X-FDA: 76776470106.11.park31_84e08cfd56c48 X-HE-Tag: park31_84e08cfd56c48 X-Filterd-Recvd-Size: 4558 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Sun, 3 May 2020 19:58:32 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id j3so7627767ljg.8 for ; Sun, 03 May 2020 12:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=I+Vh3kNnLyyVN6mbTbLsEBpJsjjShxxKsqUSxLAinBY=; b=WBLz7pPofs18/elkv/7wmBVu84QVATqmG1gQdIKPjrRnmH/8SiZjhWNib7XfIeKIoc 6rimmZUb8b+SLeSn9Y8E/osIsSMmfDav/Ibmj/DDVVY84e+PIavvy26mz2LZ074IEasT /9XuMPAfv+rib5TIzEZYKGH+KgxxRqUJKpMlJ8CysGicZH3fkhxBvDeY4wGYj3cjcjTP bfncIP/R7/Fp3/GuhCNWztnVvy5BSF0X6TkySVt4aIXfG2tYhIj49amOIizehCLlsNgZ CEs8OjpUld02e8W93Dfpbdu/mUjQ52EmtZsLdaUjT7oPaMPkkflLYs4GhSQASnC0iSk8 YgOg== 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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=I+Vh3kNnLyyVN6mbTbLsEBpJsjjShxxKsqUSxLAinBY=; b=lWSB0QKXMuLXOh1nzMcSDlrW4dygKIUXp8g91I/GrHktnZ3oPj7V2Hh7J38hi22+SF tCYTQzY/4FwcZeKLUOT9JT9ioDUYn1lUhv9LnRh6wBQXky7EoGJpK4ptdn3hx5Nf+1oy gH7CQiU74/3n/VmGLGjB0lFWNsc+cV+ZnGjPFxCJo5W06gJN305ue1QCGW9f2cyb1HZm ttxltFyHh7KYyAYYbNkGfW/IJ6zYl3VSGXgtLvPWNwqnR+eUDeBMoXFuglnpXt9FHxdk Tta1ozDZAjZRexIXp0v8ewooBqR1qs49dUmJuUiPUoFHTONHu0K5Wpb915BFPzEqWjfW gB4g== X-Gm-Message-State: AGi0PuYBPEIF7nPoGZklpTmsOfhlRksbd4SdOmpC3Yndy5qWlhcNiANb oQnQIQXGGfes/2DBNwDsnP+LgJ+9 X-Google-Smtp-Source: APiQypKn30QGJuzBXIi+eaTgRruxE3k/wP28MF5V83X2YFzJgV8unb/IIgVNmt1CDf4O8SV/c4DWrQ== X-Received: by 2002:a2e:878b:: with SMTP id n11mr8496848lji.196.1588535911101; Sun, 03 May 2020 12:58:31 -0700 (PDT) Received: from [192.168.1.38] (88-114-211-119.elisa-laajakaista.fi. [88.114.211.119]) by smtp.gmail.com with ESMTPSA id i14sm7331630lfl.21.2020.05.03.12.58.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 May 2020 12:58:30 -0700 (PDT) Subject: Re: Tmpfs size accounting misses memory allocations To: Hugh Dickins Cc: Helge Deller , Pete Zaitcev , linux-mm@kvack.org References: <63ab63bd-d6c6-a96a-9667-bbe8edb7cedb@gmail.com> <38759fbe-77a1-f105-ccde-9529170bd9a0@gmail.com> From: Topi Miettinen Message-ID: <9d509a61-8914-9fc4-b6e8-c157dbb68326@gmail.com> Date: Sun, 3 May 2020 22:58:28 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: I did more testing to find out a more specific test case. It seems that indeed encrypted swap on LVM logical volume is needed. Swap on unencrypted LVM volume, encrypted swap on raw partition or no swap at all is not enough. On those cases, OOM killer starts after both RAM and swap (if any) has been exhausted and after that it's possible to recover if essential processes did not get killed. The same happens with either tmpfs, SysV shm and just malloc(). However, in case swap is on encrypted LVM volume, the system becomes very unresponsive after RAM (not even swap yet) is filled with either tmpfs or SysV shm. It's possible to use SysRq and switch VTs (but it happens slowly). But bash does not respond and the cursor can stop blinking for a while. OOM killer is not triggered. Manual invocation of OOM killer with SysRq kills the bad process, but the system never recovers. Exhausting the RAM+swap with malloc() does not trigger this. Here's the entry for swap in /etc/crypttab: cswap /dev/mapper/levy-swap /dev/urandom cipher=aes-xts-plain64,size=256,hash=sha1,swap /dev/mapper/levy-swap is a LVM volume on SSD with the same size as RAM (16GB). I tested this with Debian kernel 5.6.0-1-amd64. -Topi