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 C34F2C64EC4 for ; Tue, 28 Feb 2023 22:18:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BA576B0074; Tue, 28 Feb 2023 17:18:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 341016B0075; Tue, 28 Feb 2023 17:18:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E34D6B0078; Tue, 28 Feb 2023 17:18:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 06EDB6B0074 for ; Tue, 28 Feb 2023 17:18:01 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id CE34C120480 for ; Tue, 28 Feb 2023 22:18:00 +0000 (UTC) X-FDA: 80518114320.21.DB30D8E Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by imf26.hostedemail.com (Postfix) with ESMTP id F0EAC140004 for ; Tue, 28 Feb 2023 22:17:58 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OPbyvuAV; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (imf26.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.215.173 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677622679; h=from:from:sender: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=3TsJNEj+w0WsDhaHaz9OByZ+6JnTWJIfxuRnHUbFWs0=; b=hJs4uFURFJaV8XJ0upzN9ca7XjQq1OnNYNVeUT9UnZAq9KL8p6P3/CiuhbShBy9TYIF7qq DH20eOnq1ryXa2d2BJb5v7gx/oQVjHjKpuO+nDwFJ45xW/IoM1Dk0gi5InGSx0PKSkabjG QhZxGU87c7PWep7w3sbBUfyRPgfVswU= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OPbyvuAV; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (imf26.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.215.173 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677622679; a=rsa-sha256; cv=none; b=5q/ctL2u09ZsiQf6rzcdhuNNY9x8GUq9USAt0Ud43kRspZ2cKyN7FJFDlQLJCy7lM9N2XO hTlUSQaf6Z/uQhMJ7rpJLlnW22vF6VheKGplnuGbe4DQtcjygKqiFEsVCNuB3wrhHi7cb3 Zjw4ywQnJNICun1EPeIMyvFt6MO9XPI= Received: by mail-pg1-f173.google.com with SMTP id 132so6576884pgh.13 for ; Tue, 28 Feb 2023 14:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677622678; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=3TsJNEj+w0WsDhaHaz9OByZ+6JnTWJIfxuRnHUbFWs0=; b=OPbyvuAVTRMTCsj63D8xErzTFv0rlOI3wd5ikM2cxA7qPvoqQEHv+CXJfhAP/vhnFh cMasZIfQhweBi9Af5qam8hxAJvHBP9TKNa5ORC5CY2eh3F3RLBapTszQMY90+7vWHDh5 nbpJMcj28gCRI6xuEUBlDDPkDf32oHyIv/uWs7CDlp3bXXODLn4ljfjop2dvUQqEzfTn s5iBHudEOhn7dMK8fDnK1a57fu5hNXD16XkC1Qpgl42mD7MYm3HCw0+U8CvHuwOgpSKh /45n1SGAxzn/qNW42HyvRNOMlv8DYOcCDEuYK/e7l2vn1m5ZSBcjeEK524ONI+7DcS28 uY5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677622678; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3TsJNEj+w0WsDhaHaz9OByZ+6JnTWJIfxuRnHUbFWs0=; b=ZLhCOvhac4jMT4VE8B2JKqqAi8JCotIJSt1tb2ttXqMF2t10XPBroxh8YLHoXg4+8F 7SKbCEtSaSTrcASJ2QNHfM0kuLz7ch4W5V+uBIRFrZc3tNr+C7W4ks4MUoFQzThE82Cm JCAjjF0F+FlUMXSM3Xt2lrENpCb0KAlGsbjw2rSCq32wEfFxlMlj063oDYJqFlu8MxgN vDvh1gYpsqFBvFsch0nJ8DcKT/zXgzoOXMGSEkQCDpcWnO/5o/d3M1vGs+TrOp32tr3D e+jjQ1cfkZBWKO7kRTk50oXG9T/yurbu1KfCMX5PiUjwauiw0hS9J2J98fkUCNQZ5SVM qfOw== X-Gm-Message-State: AO0yUKWhO3wXUOQ9YZQBqKfzj6uea2xUYs7H0m2wKoBxZCRHS3SMDGAk 1CwvRNwpyibiLl8/SuoZFxI= X-Google-Smtp-Source: AK7set+2cLaqXQJw0ub7AUxXbSMsxiqYTB5BkABxLbWrjOq1H086A90IDf8WBiCSKu1anwANMC0xbw== X-Received: by 2002:aa7:981d:0:b0:5a9:c1f9:dc70 with SMTP id e29-20020aa7981d000000b005a9c1f9dc70mr3362094pfl.30.1677622677660; Tue, 28 Feb 2023 14:17:57 -0800 (PST) Received: from google.com ([2620:15c:211:201:639:82f5:b510:3494]) by smtp.gmail.com with ESMTPSA id i2-20020aa787c2000000b005abbfa874d9sm6483760pfo.88.2023.02.28.14.17.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 14:17:56 -0800 (PST) Date: Tue, 28 Feb 2023 14:17:55 -0800 From: Minchan Kim To: Sergey Senozhatsky Cc: Andrew Morton , Yosry Ahmed , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCHv2 0/6] zsmalloc: fine-grained fullness and new compaction algorithm Message-ID: References: <20230223030451.543162-1-senozhatsky@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: F0EAC140004 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: jx7s4cewrxex1fg879hrhnzuurye76t6 X-HE-Tag: 1677622678-803285 X-HE-Meta: U2FsdGVkX18ho2OaaGf1iLuYhBUzbk0khVhmYupr8jobi/70WdNvIH/rUP5z8GEnhuAAKZLycaIQpgNqltPotYfjoxafCtq7EBPBgLPELE+BdVqZJciw1sYzkN88OQlJlDC/dRDhZs4BFVUiasFRAGzn5ywSBLys6DMZ/wNpw05Ve3YekDkjoodtt73LqT6KoRSv334f/c8HsNMSQy0okkyqjVD/VQBe7N4jjmm1lE87LAsdXtk8eYiLDfeWuIqkbho9X9APIPh8xPo6DHaPWMNpJ5cTQ3Vv40uJf4Uu7i/AkkCFZ3SO3Uu0pBwro9Q8Wjy3pjqSTC0I3d8yiOpa1XZKLcM6An5DrJlgHcRzhwxpHpFL5Me+dhkpZisNDi6SMzBwEStDOJzJSD1pqOHNtJHkq1osHfinynxln2QvuCeP4Vq22poY0do91QGXIQ1+0kXgILt5wxlEkhhjP9LuxkXqGX2moFDINbTohwhzgYLmx+mXi+dl132ycg9xNA7y1Uxrw1Chb6m1vDMe7RvlmV+MOIte5lYvY9vrYDfjMl7uvvdHzlR3bENXP5IVBfm/C5d9jNufMe4fyz/r6GYk5rfHenG0+9+fwwrtrEKEuqebGnNQcv1r3Txdq0Gq1e4UgoTYSHQ6TPwasxTBqrbKk7njR4bv8vjYq7vfxZLLg3/O53Qty0qGQccVdKVxJZcsPyBLd/zgouYQbeVjUR02fss/6qQpIObVetz1ekC28u+tnzfd6IOOXsWEsoPXCmSOteDzJgfIsSlU7KFOGJzxNRzNoYuG0nPAR7rRE7YwyT4+2FYMMZoqXQFCQRSOQek/cHXhbEQLOBQ51F4ggvHErXd6EpkzIiBJQvGVCtVLLSTFf667Nj8zXPQKhg+LOIgDBpLAOFXEjC6+dkUu4SkkyKUXr6Ti85dA5+JyMDuWxrN/QYEPStla6wcVVtH+Bbm18V6tg/+4Z1J7HX4YvKP 6Dfo27WJ k60xDeMHnWu+jkbuOvCL/Fjg13vqPp8N0zcB3FDeYgHzV2aRH3rZ+zFIUZrUg3bIULa4YrqK34iYi0S/n8zeFP6lBZo/V8QBo7/Q5NLK01SFxeASumlvH7r9S85d16Xej+05/1E9qkJasmceI4Xe51rgiCGXthm5fmN9H6z7Yb/uIEPpyLzrvwgyx21qyVtL0YHI5YYlHa2PcVigtITctO3n2QOXwe/nX1vgMs5PWKnl50pa/20grIQlVgKEddfCkhNvXf8O8LLj3CAP56TDPUe2F6MqnMF/k2m56kickXzvmkEei2OFL8ljGvG+ffd6mVzNt5EtNHPsY8MahIyn/dvUQIpHaCEfGsnF58Eqf0J2FHssD82K57aViTpl/FtWC1NbtDU5N7hec3E0296xIXdWm8oGbWxO+lzdQF3vYidLjMqVA5QMBgStYr+NetXFZAarI3UUxHN73AnewpEInN5bk3PaSjCRPZzO+Di9GqStIa02b3JpsB/8AamvfIwHrG2gtImqVwqFgJM1Dbyc7f46cUq7xL+4cvMdMfRDgVoFvRQk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000116, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sun, Feb 26, 2023 at 12:50:45PM +0900, Sergey Senozhatsky wrote: > On (23/02/23 15:53), Minchan Kim wrote: > > > TEST > > > ==== > > > > > > It's very challenging to reliably test this series. I ended up > > > developing my own synthetic test that has 100% reproducibility. > > > The test generates significan fragmentation (for each size class) > > > and then performs compaction for each class individually and tracks > > > the number of memcpy() in zs_object_copy(), so that we can compare > > > the amount work compaction does on per-class basis. > > > > > > Total amount of work (zram mm_stat objs_moved) > > > ---------------------------------------------- > > > > > > Old fullness grouping, old compaction algorithm: > > > 323977 memcpy() in zs_object_copy(). > > > > > > Old fullness grouping, new compaction algorithm: > > > 262944 memcpy() in zs_object_copy(). > > > > > > New fullness grouping, new compaction algorithm: > > > 213978 memcpy() in zs_object_copy(). > > > > > > > > > Per-class compaction memcpy() comparison (T-test) > > > > Just curiosity: What's the T-test? > > T-test is a statistical method used to compare the means > of two independent groups or samples and determine if the > difference between them is statistically significant. > > > > x Old fullness grouping, old compaction algorithm > > > + Old fullness grouping, new compaction algorithm > > > > > > N Min Max Median Avg Stddev > > > x 140 349 3513 2461 2314.1214 806.03271 > > > + 140 289 2778 2006 1878.1714 641.02073 > > > Difference at 95.0% confidence > > > -435.95 +/- 170.595 > > > -18.8387% +/- 7.37193% > > > (Student's t, pooled s = 728.216) > > > > > > > > > x Old fullness grouping, old compaction algorithm > > > + New fullness grouping, new compaction algorithm > > > > > > N Min Max Median Avg Stddev > > > x 140 349 3513 2461 2314.1214 806.03271 > > > + 140 226 2279 1644 1528.4143 524.85268 > > > Difference at 95.0% confidence > > > -785.707 +/- 159.331 > > > -33.9527% +/- 6.88516% > > > (Student's t, pooled s = 680.132) > > > > What's the different with result above? Did you just run two times and > > shows they are consistent or this is new result based on different > > testing? > > The test is exactly the same, it is designed to have 0 variability, it > creates exactly same fragmentation during each run, so we always compare > apples to apples. What is being changed (and hence tested) are fullness > grouping and compaction algorithm. > > The first one tests the effect of new compaction algorithm alone: > old fullness grouping and old compaction algorithm VS old fullness > grouping and new compaction algorithm. The data show that with > sufficient level of confidence (95%) we can claim that new compaction > does make a statstically significant improvement and reduce the number > of memcpy() calls (by 18.3% in this particular case). > > The second one tests the effect of new fullness grouping and new > compaction algorithm. The data show that with sufficient level of > confidence we can claim that new fullness grouping and new compaction > do make a statstically significant improvement and reduce the number > of memcpy() calls (by 33.9% in this particular case). Thanks for the explanation, Sergey. Please include the testing result data in the description of the patch you made significant change to achieve it as well as cover letter. Otherwise, zsmalloc-remove-insert_zspage-inuse-optimization.patch has every data now but that patch didn't make such an improvement.