Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp800244imu; Mon, 5 Nov 2018 08:58:56 -0800 (PST) X-Google-Smtp-Source: AJdET5d/yfYdbAdLFV3gtCGfjkdFJFzXqLyuxEvk7x8pcDbliqwbHhnPBVa1mGWeJitdHlSoD0Kz X-Received: by 2002:a17:902:15a8:: with SMTP id m37-v6mr22826933pla.256.1541437136748; Mon, 05 Nov 2018 08:58:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541437136; cv=none; d=google.com; s=arc-20160816; b=hPjqWAUcvEKOVdW9g32rEuYHguL1UOj9s+XySaGeRYlqJ+2PU8kB2dTEFytip3SfdE niJy9dBzfH5vTOmwFIm4CbX4my0jTlgebBv5BQGQzrBHdXaG37GBDLX9Px4tKWNlEbDb 1Bi16LokKTFfs4OlG5gKYv+Yy3ZuJV0putR87hzYPBSqf+enOIayoflg6JyYWQ4MxxMl kadSEj82bGD9z3tBH2ferjds+YGDQ4JDU/c256Gh0hKMmVR964n7a5z/RnzAIPwcKndU WUxwgwWf2JcSUa7JTupj/e4I2v1nqLqX8FOnLDb2e5gsPxjn6FpU0Zs4NRMQ34jrdrya El8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=3MmaN0jrCJbz+INAFVwP74cEKeTv/a6+GsClckRLvu0=; b=bzEGQov/VtjACP7wTpjyar52YQywKzJdS3z/vwJdVCVpDHwNmgDk9ub5v1LUR/9Z7Y H2BbYk/zTIU/tIklvttASKvVia2hn44Wh4jl+8deg8+wicZgR7Aj8tffGP1yE2hjagoo bDw6axTtw4CBfERDeEHDWQ0oJ0JE1YosRcHTS/+YAAA5RVRXAZfIg6tPmw749j2MQuDE pLIsuH6PXucTOB3R/ZXmpVewIFJ1+a7AZmD4vR++d3FzrfG2gCCDoUSa/Q92YTbqHNMx xCWyC201MLS9hd7SO/63v6JwcCta737tWLao1A43jGyeF3jw1g4XhOl2yXS/ftl34htt 5afA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JveS1ziF; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca10-v6si11123587plb.29.2018.11.05.08.58.41; Mon, 05 Nov 2018 08:58:56 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=JveS1ziF; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729943AbeKFCRE (ORCPT + 99 others); Mon, 5 Nov 2018 21:17:04 -0500 Received: from mail-it1-f174.google.com ([209.85.166.174]:51234 "EHLO mail-it1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729762AbeKFCRD (ORCPT ); Mon, 5 Nov 2018 21:17:03 -0500 Received: by mail-it1-f174.google.com with SMTP id h13so13677868itl.1 for ; Mon, 05 Nov 2018 08:56:29 -0800 (PST) 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=3MmaN0jrCJbz+INAFVwP74cEKeTv/a6+GsClckRLvu0=; b=JveS1ziF8Uj9TTS9AkouaGGAyeBsmvU4KrS00loZqZ/0UE8z0OUnmXoU2c4xLkBI4K 0woa9CafNuvxeCd1k62x3X0Ojy6Y4mRIGkr+BSpPjpD/+Tkl9tT76Mz5N+OVpjTls+xB e+It28czsNoURIXVf1LBM1g/4/rv7oD7EbWTA8EYKYUIY3uhq/n6fX7u03jWRn6Dho3e EQl3hjN+kkwRw/0XfB9O4UQgJ3KKEp9yGMCPuvnN+kByv0pkOrzTaIGcqI4frk80GFf8 5Auv6vbGyB/p6xaShSCI2Du4FmMtS5wtiZFtvUCpE2KmC7ewc1UCMzfj+jyY7QLSDDo4 gitA== 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=3MmaN0jrCJbz+INAFVwP74cEKeTv/a6+GsClckRLvu0=; b=P2rSM88LUvrNzDct5wuLmKIwwYlXe7XoJlJ0MleH2SAFzHPJzElYXGTvEr9gq0LkK6 zTOCJS3AT1LlNFx+3tRaSCLWnzmhFxgTZtlC6Hm39+4VfZXYerJtvPC7snhIWEykNe9n zKz6wCafTHSju2MMAjr30Q8qQxsjqVkTb/1Dp+ZPKvHj5PY08rTJFFCF26gkLpmTJZB/ m9wsCHC6eJXPO6SygXIJ+aD0za7IVaypATuq5JMfDUjlN3SVjA5hFTsoePwl1POAxdwo SlclxYXeYtHrACfJakxGiBuLoAVWtW+eul15W06p5KDpXXBror2yHiHB93iJV2zKTgLl 9yPw== X-Gm-Message-State: AGRZ1gJex1TZ3yvSgw/xOTek/BSQhipA2c2glgE5RH7uXnOTY6wQFpWV HEYwphMXI0s7Gy0aA0loC08= X-Received: by 2002:a24:8a84:: with SMTP id v126-v6mr7018089itd.132.1541436988836; Mon, 05 Nov 2018 08:56:28 -0800 (PST) Received: from [191.9.209.46] (rrcs-147-0-47-180.central.biz.rr.com. [147.0.47.180]) by smtp.gmail.com with ESMTPSA id d10-v6sm14243923itd.27.2018.11.05.08.56.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 08:56:27 -0800 (PST) Subject: Re: Creating compressed backing_store as swapfile To: valdis.kletnieks@vt.edu Cc: Adam Borowski , Pintu Agarwal , linux-mm@kvack.org, open list , kernelnewbies@kernelnewbies.org References: <20181105155815.i654i5ctmfpqhggj@angband.pl> <79d0c96a-a0a2-63ec-db91-42fd349d50c1@gmail.com> <42594.1541434463@turing-police.cc.vt.edu> <6a1f57b6-503c-48a2-689b-3c321cd6d29f@gmail.com> <83467.1541436836@turing-police.cc.vt.edu> From: "Austin S. Hemmelgarn" Message-ID: <20fe7145-8426-c67d-2ab2-258ec5717966@gmail.com> Date: Mon, 5 Nov 2018 11:55:58 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <83467.1541436836@turing-police.cc.vt.edu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/5/2018 11:53 AM, valdis.kletnieks@vt.edu wrote: > On Mon, 05 Nov 2018 11:28:49 -0500, "Austin S. Hemmelgarn" said: > >> Also, it's probably worth noting that BTRFS doesn't need to decompress >> the entire file to read or write blocks in the middle, it splits the >> file into 128k blocks and compresses each of those independent of the >> others, so it can just decompress the 128k block that holds the actual >> block that's needed. > > Presumably it does something sane with block allocation for the now-compressed > 128K that's presumably much smaller. Also, that limits the damage from writing to > the middle of a compression unit.... > > That *does* however increase the memory requirement - you can OOM or > deadlock if your read/write from the swap needs an additional 128K for the > compression buffer at an inconvenient time... > Indeed, and I can't really comment on how it might behave under those circumstances (the systems I did the testing on never saw memory pressure quite _that_ bad, and I had them set up to swap things out pretty early and really aggressively).