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=-0.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, FSL_HELO_FAKE,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 B5BDCC2D0C1 for ; Fri, 20 Dec 2019 03:14:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5A4C0227BF for ; Fri, 20 Dec 2019 03:14:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W26zs5Rn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A4C0227BF 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 ADF418E0189; Thu, 19 Dec 2019 22:14:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A90228E0184; Thu, 19 Dec 2019 22:14:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97E588E0189; Thu, 19 Dec 2019 22:14:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id 7F2768E0184 for ; Thu, 19 Dec 2019 22:14:02 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 1A7544DC0 for ; Fri, 20 Dec 2019 03:14:02 +0000 (UTC) X-FDA: 76284050724.08.uncle02_5d5c18e6b272d X-HE-Tag: uncle02_5d5c18e6b272d X-Filterd-Recvd-Size: 6020 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Dec 2019 03:14:01 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id z124so4188262pgb.13 for ; Thu, 19 Dec 2019 19:14:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xfe06hEYKZV5y/CiX8O7PEEEa9kQzA4lJHanH76zMXo=; b=W26zs5Rnwxo4y8u+Pd3Kc/YUbwHL6fR88qDymio6uEF+z3/t71UDMsRcNGs2Ndh9vD vJvecuE/Bi/HQaRdI2PhAd5eED7HpU5otuPR/r+RnE8zAkWMzOQvwjABnsuIrWJjBJDt zaizYO1c5tQL9Vtt1yzOTeBGVTvzRU2X5vNUKPlr+jipWO/5ISFBH0P4GaBAOizunkOZ Sazj+0Erc0SuJQZ1QA1x/Eemqg1W1cNMmUQb7aDdlV7OhvJvsqGreMWa2hzyJunemUau bfuPsh6QPmaQxX/zcbSdNM5E9urhal/kJpq+loMqzqvKchpplN4Pl3FFxJdVl0rI7a3g n43Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=xfe06hEYKZV5y/CiX8O7PEEEa9kQzA4lJHanH76zMXo=; b=oTgbkHRtdbYamUoYv5/UvKM2aNbA5q3LyCFsVBmsIFG3k2N6F39l6OJQH9MvV4uIcO CZYURbCfSftrDLiM3eRAz4oGdOiw1zxVyrwH1aVSw3DTnYy2O8sV/6C7MhfTc+OhEwUl /66odpdgRWpHO7P0KCR3OZ5z/MpsT8yRyL7qd/n3frRfYEim/jEwCwltXqxlN7t2MTu1 hAv+9G226zzOP7midiDih2Tn3zfLOG3NivFdkveZwnDlbhJ3C08sZKMOgqinL0FzUDz2 DkDI9isVJa6/qwtfD9HhXfQ34jyJ8aXm9pgeShZbzmfFKhEqAsz037pQ5Ub0ISQ36qee DXpg== X-Gm-Message-State: APjAAAUfG2VBI1ju4a/xOV08K+k/gYdA4ulRKO3FcUyFBxqw/uMMgwdW cf+JtdvgMAeTjra+pyt/6As= X-Google-Smtp-Source: APXvYqwWyPJHxGvXLox8o543HskJF6C64WZzSS0rWOjZ9MgzjbFWG7TEigUTVHAiOwkl1C+ePJWbvQ== X-Received: by 2002:aa7:9633:: with SMTP id r19mr13939808pfg.90.1576811640281; Thu, 19 Dec 2019 19:14:00 -0800 (PST) Received: from google.com ([2620:15c:211:1:3e01:2939:5992:52da]) by smtp.gmail.com with ESMTPSA id t23sm11021116pfq.106.2019.12.19.19.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 19:13:59 -0800 (PST) Date: Thu, 19 Dec 2019 19:13:57 -0800 From: Minchan Kim To: Vitaly Wool Cc: Linux-MM , Andrew Morton , Dan Streetman , Sergey Senozhatsky , LKML , Vlastimil Babka , Shakeel Butt , Henry Burns , Theodore Ts'o Subject: Re: [PATCHv2 0/3] Allow ZRAM to use any zpool-compatible backend Message-ID: <20191220031357.GA39061@google.com> References: <20191219151928.ad4ccf732b64b7f8a26116db@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191219151928.ad4ccf732b64b7f8a26116db@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Thu, Dec 19, 2019 at 03:19:28PM +0100, Vitaly Wool wrote: > The coming patchset is a new take on the old issue: ZRAM can currently be > used only with zsmalloc even though this may not be the optimal > combination for some configurations. The previous (unsuccessful) attempt > dates back to 2015 [1] and is notable for the heated discussions it has > caused. > > This patchset addresses the increasing demand to deploy ZRAM in systems > where zsmalloc is not a perfect match or is not applicable at all. An > example of a system of the first type is an embedded system using ZRAM > block device as a swap where quick application launch is critical for > good user experience since z3fold is substantially faster on read than > zsmalloc [2]. Look https://lkml.org/lkml/2019/10/29/1169 z3fold read is 15% faster *only* when when compression ratio is bad below 50% since zsmalloc involves copy operation if the object is located in the boundary of discrete pages. It's never popular workload. Even, once write is involved(write-only, mixed read-write), z3fold is always slow. Think about that swap-in could cause swap out in the field because devices are usually under memory pressure. Also, look at the memory usage. zsmalloc saves bigger memory for all of compression ratios. You claims flexibility - some user want fast read. How do you guarantee it is always fast? It depends on compression ratio. How can admin estimate runtime data compression ratio in advance? Their workload is read-only if they use zram as swap? they are okay to lose write performance and memory efficiency? Considering that, it's niche. I don't think it's worth to add maintenance burden here for very limited usecase. Think about why we replaced xvmalloc with zsmalloc instead of creating wrapper to keep two allocators and why people push back so hard when we introduced even zsmalloc. Why zbud was born at the cost of sacrificing memory efficiency was concern about memory fragmenation of zsmalloc so freeing memory cannot make real free memory so wanted to manage fragmentation limit(However, we introduced object migration in zsmalloc afterward so the concern was gone now). > > A system of the second type would, for instance, be the one with > hardware on-the-fly RAM compression/decompression where the saved RAM > space could be used for ZRAM but would require a special allocator. I agree. For the special compressor, we would need other allocator, even huge zram changes in future for best performance. However, I'm not sure zpool is good fit for the case. We need discussion when that kinds of requirments comes up. Nacked-by: Minchan Kim