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 5BA1EC4332F for ; Fri, 4 Nov 2022 03:58:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD87F6B0071; Thu, 3 Nov 2022 23:58:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C889A6B0073; Thu, 3 Nov 2022 23:58:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B506B6B0074; Thu, 3 Nov 2022 23:58:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A6DB96B0071 for ; Thu, 3 Nov 2022 23:58:37 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 7ED59ABE80 for ; Fri, 4 Nov 2022 03:58:37 +0000 (UTC) X-FDA: 80094403074.16.8702F72 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by imf15.hostedemail.com (Postfix) with ESMTP id 22871A0004 for ; Fri, 4 Nov 2022 03:58:36 +0000 (UTC) Received: by mail-pf1-f170.google.com with SMTP id b29so3427266pfp.13 for ; Thu, 03 Nov 2022 20:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; 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=vHL1xFrbNHnWDyb+sE00zVoxKUK+JI+O6GLJxn6wij8=; b=N2RqmlDsYfsvjfdHNzzjMFZSQWHzsiWcFngBJWUdvjQGUcSCJv8cpYZN/FDuG/vUcC 1G05GIYrxXjoFjtJRoR24SI0/VRtvS++O72hDuBDCqmws7kb9hyXgzQb2WmSzMEEOlfF ueZw3JKUdlm4PUjGU65zu6T3U46wpja3IeQX4= 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=vHL1xFrbNHnWDyb+sE00zVoxKUK+JI+O6GLJxn6wij8=; b=dGJ7X9dZ2T3dpl4K3vJGWw1klMsUoVwMYkysm36ew2EusC9bC8fkLlpOjXM6DtUGC6 zMpEWqDZNsi3svrXOMduiuVg75AunaHGEhvRKcM4yPdNbaITdDOS0bcnjsUJYMmbFQT2 3M2yY366xRsf5tFLPi/cZJ0Uc6mHVJC8huR1Z0rbH/PJ5bkNQqqkNkHSexmjb27s6tSg z+t3O7LAfD1uFPkxWcr1zCGLeifc4wvWB++BVtQo4oxO01RFtgfalJXcfCvhw+e9eIeN X+CdjcpRDMjI1Ij3NDHvbQzB9m/l9Oqw+hILBXW/TOG8vreRlxZMNjVyLovD1TgGJY9h vmhA== X-Gm-Message-State: ACrzQf3R/6TWPYQRpG0LGeEtNvHrir29ciWP7cuWiBQDg5FOMx0Cg0G2 D0I7yyRdZBipx/NI428UbNI1vA== X-Google-Smtp-Source: AMsMyM4D+HSyRRPySEiDj2be671NufwvYKpaDdLtGciiyAawWoHzYmmb5rs3RBfYL0a5S+0xgcBeTA== X-Received: by 2002:a05:6a00:2402:b0:52c:81cf:8df8 with SMTP id z2-20020a056a00240200b0052c81cf8df8mr34238451pfh.60.1667534315977; Thu, 03 Nov 2022 20:58:35 -0700 (PDT) Received: from google.com ([240f:75:7537:3187:f2f6:8f5:87c8:3aeb]) by smtp.gmail.com with ESMTPSA id s9-20020a656449000000b0041ae78c3493sm1467952pgv.52.2022.11.03.20.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 20:58:35 -0700 (PDT) Date: Fri, 4 Nov 2022 12:58:30 +0900 From: Sergey Senozhatsky To: Johannes Weiner Cc: Minchan Kim , Sergey Senozhatsky , Nhat Pham , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ngupta@vflare.org, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com Subject: Re: [PATCH 2/5] zsmalloc: Consolidate zs_pool's migrate_lock and size_class's locks Message-ID: References: <20221026200613.1031261-1-nphamcs@gmail.com> <20221026200613.1031261-3-nphamcs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667534317; 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=vHL1xFrbNHnWDyb+sE00zVoxKUK+JI+O6GLJxn6wij8=; b=zH9jcyOKTOBlPqfog5gXFMaGJ0XzxDM2VUgvw6j66xkW/rPpMilzF7ksZ+b8jtNC66j8qO EnsAS0plpCgwCEukSxvNI/IQHwLmuUzkfvXWTz90cpYqYH5XDvXvEgMWXDYL5EdD/nLgLc qivB1LIP8M1VOfesokfv1SkTpB0xv58= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=N2RqmlDs; spf=pass (imf15.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.210.170 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667534317; a=rsa-sha256; cv=none; b=1PNqWZ9bMV1wFmjFE56SuTk9DO2Ymv43bcaHSNGZSY4WglIffa+v8i8hRcFovtp4tPuAs+ 4Ad0jqHicamoEHRgoLttAz0NcV9YKbtCC/qD6G0Ata/5Q6cPIt1f5QTLg3kwVYzXMInNsy GK0mOP8EX9Q1vsmGU2+NUsxsOZu96Vs= X-Stat-Signature: kqtoi4j7c6h3tip8giydsw6tdmo8yhfe X-Rspamd-Queue-Id: 22871A0004 X-Rspamd-Server: rspam06 X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=N2RqmlDs; spf=pass (imf15.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.210.170 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-HE-Tag: 1667534316-744841 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 (22/11/03 11:18), Johannes Weiner wrote: > > > I'm not in love with this, to be honest. One big pool lock instead > > > of 255 per-class locks doesn't look attractive, as one big pool lock > > > is going to be hammered quite a lot when zram is used, e.g. as a regular > > > block device with a file system and is under heavy parallel writes/reads. > > TBH the class always struck me as an odd scope to split the lock. Lock > contention depends on how variable the compression rate is of the > hottest incoming data, which is unpredictable from a user POV. > > My understanding is that the primary usecase for zram is swapping, and > the pool lock is the same granularity as the swap locking. That's what we thought until a couple of merge windows ago we figured (the hard way) that SUSE uses ZRAM as a normal block device with a real file-system on it. And they use it often enough to immediately spot the regression which we landed. > Do you have a particular one in mind? (I'm thinking journaled ones are > not of much interest, since their IO tends to be fairly serialized.) > > btrfs? Probably some parallel fio workloads? Seq, random reads/writes from numerous workers. I personally sometimes use ZRAM when I want to compile something and I care only about the package, I don't need .o for recomplilation or something, just the final package.