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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E65DC433FE for ; Mon, 28 Nov 2022 20:01:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9CB866B0071; Mon, 28 Nov 2022 15:01:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 97BA06B0072; Mon, 28 Nov 2022 15:01:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8431F6B0073; Mon, 28 Nov 2022 15:01:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 716086B0071 for ; Mon, 28 Nov 2022 15:01:12 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 465161A0BD2 for ; Mon, 28 Nov 2022 20:01:12 +0000 (UTC) X-FDA: 80183919984.01.A2D71A2 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by imf02.hostedemail.com (Postfix) with ESMTP id 7F09680014 for ; Mon, 28 Nov 2022 20:01:09 +0000 (UTC) Received: by mail-qk1-f170.google.com with SMTP id k2so8156058qkk.7 for ; Mon, 28 Nov 2022 12:01:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jjWQngrFwcQBuJ1TpKg6xJAmrqN7cK8e94CGrR6mI8g=; b=aunJ0k3ngee97R8Wf3wN40sqabDxQMoFF5vQ+n/j4BVp4Q6VwQrxl3MQW3Ee0ZvxlL U5GyNy2pXG8zIqyx3BHe7hRHTBivbbgH0SjGYHrVgvTn/OPJ9FqKiB/sDaGwS3UrWd5q dOP/CFVdGPHHQ3mx7Y1D/am3jTSxFFY5T+FCpZt3EK42hh2ZnhB9N8IyKb/Yo4TQUD7v XzN5XkbhG9i0rLqcX98HhUdEOV6Ym1bdXDdhJsQPR5vD6epHWD08QAgcihXkiIRBcys5 +0j+dwAw9aWGgJD9bpybW6BNLMOv7ZrIhN4mCvcojSQ4n0elRD6Joqjua58HCH6/vPOI jbNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jjWQngrFwcQBuJ1TpKg6xJAmrqN7cK8e94CGrR6mI8g=; b=XTvNsCg6E4QYbQCSaOUbUZ+jFOqt+PwLcpViLL8p/6qPifz4qoeJFOuwUInwZtgUHt fi/XyfL3zbanNm8Kvy2+CiBiexV7jJaIRBh2ElMcWtwp+oZN3D5RQxa9szxK7AxSIZXC /lR4uS1PQI9j0B/HiMjiRC/wCd580ya42cnLSGr0YUoS4bbh2ijwa+vlu6/rmgVxg4c0 uDjcn7zcAEcis8sbWsdHJfd8TBPZsB2SWo2hJQXoYDWeqQVNlRUOmeCBq9+1Hpva4QY5 ThbFd4R/nsKoYP5KERD8olxaxRpeLQYfizhKgSjLErncg0+n4Jc1oXER90+gXda7Hl3m ntxw== X-Gm-Message-State: ANoB5pmZ80nqzw8joLx5H/Qrt1sfsiMySXAgTU8Rg/P+N8UMmm7IqlYg /+ABRQNrbvE7NFEChCnbZGlPaA== X-Google-Smtp-Source: AA0mqf7NlVFSFrMN6qwtknN4kSpYIdDt3IsI+n3orRP1uA0O/dP0GUxrZsqxUhv4UHhqWus/HwBWbA== X-Received: by 2002:a37:ef09:0:b0:6fa:4014:3b38 with SMTP id j9-20020a37ef09000000b006fa40143b38mr46037752qkk.322.1669665668463; Mon, 28 Nov 2022 12:01:08 -0800 (PST) Received: from localhost (2603-7000-0c01-2716-9175-2920-760a-79fa.res6.spectrum.com. [2603:7000:c01:2716:9175:2920:760a:79fa]) by smtp.gmail.com with ESMTPSA id h4-20020a05620a400400b006f9e103260dsm9142508qko.91.2022.11.28.12.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 12:01:08 -0800 (PST) Date: Mon, 28 Nov 2022 15:01:07 -0500 From: Johannes Weiner To: ananda Cc: linux-mm@kvack.org, vitaly.wool@konsulko.com Subject: Re: [PATCH v6] mm: add zblock - new allocator for use via zpool API Message-ID: References: <20221104085856.18745-1-a.badmaev@clicknet.pro> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221104085856.18745-1-a.badmaev@clicknet.pro> ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=aunJ0k3n; spf=pass (imf02.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.170 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669665669; a=rsa-sha256; cv=none; b=U5im+zXHb+DCjLYYC6qxPrekvnlutpVaJDJbTqNMGXESRqiSdkNMssa3QHqCbqlKPxMn3L JtR7FUjPJygiy4gaiti3muLJ35/Msu5GZ4NTGUUKdmZYa6OvGXr5bxtAYCaLdiCP/luGn1 1TfSXVQHYnSixxMe9YZTzpURalpD5pE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669665669; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jjWQngrFwcQBuJ1TpKg6xJAmrqN7cK8e94CGrR6mI8g=; b=Wy6ewI6IRJYWYc6ICfqSsSWRlzbKhbggUwDcGLr0YRjAJTesGOAZ6CUeOxiOcEnCygCSjz Y/ghHdDTmucpCdNEaRXi0Vx9+PCjqtqRBDTWdC8tgQsWBI9pohOuLfK+iGWleHSElP9kCM 8EclA/YdYDVVX5AuEHx5mL7+E5+q7qw= Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=aunJ0k3n; spf=pass (imf02.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.170 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 7F09680014 X-Stat-Signature: k7n3iorqumjzoa96bwjsmfc5iekg91ji X-Rspam-User: X-HE-Tag: 1669665669-921919 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, Nov 04, 2022 at 11:58:56AM +0300, ananda wrote: > From: Ananda > > Zblock stores integer number of compressed objects per zblock block. What does that mean? > These blocks consist of several physical pages (1/2/4/8) and are arranged > in linked lists. > The range from 0 to PAGE_SIZE is divided into the number of intervals > corresponding to the number of lists and each list only operates objects > of size from its interval. Thus the block lists are isolated from each > other, which makes it possible to simultaneously perform actions with > several objects from different lists. This was benchmarked not long ago in the context of zsmalloc, and it didn't seem to matter too much in real world applications: https://lore.kernel.org/linux-mm/20221107213114.916231-1-nphamcs@gmail.com/ Do you have situations where this matters? > Blocks make it possible to densely arrange objects of various sizes > resulting in low internal fragmentation. Also this allocator tries to fill > incomplete blocks instead of adding new ones thus in many cases providing > a compression ratio substantially higher than z3fold and zbud. How does it compare to zsmalloc? > Zblock does not require MMU and also is superior to zsmalloc with > regard to the worst execution times, thus allowing for better response time > and real-time characteristics of the whole system. zsmalloc has depends on MMU, but which parts actually require it? It has its own handle indirection and can migrate objects around and replace backing pages without any virtual memory tricks. There is the kmap stuff of course, because it supports highmem backing pages, but that isn't relevant on NOMMU either. Also can you please elaborate on the worst execution time? My first impression is that this looks awfully close to zsmalloc, with a couple fewer features and somewhat more static design choices. It's in that sense reminiscent of the slob allocator, which we're in the process of removing, because 3 slab allocators is a pain to maintain. This would be the 4th zswap allocator, and it's not clear that it's drastically outperforming or doing something that isn't possible in one of the existing ones.