Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2616290rwb; Sun, 6 Aug 2023 23:55:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0T7Y6TpFuzVeivkZeO+TQHr2OCoVH3ghovR2IRD73zjajngmyU6XFTtkphOp9YY06U+80 X-Received: by 2002:a05:6512:44b:b0:4fb:8a0a:31f2 with SMTP id y11-20020a056512044b00b004fb8a0a31f2mr4816842lfk.69.1691391350673; Sun, 06 Aug 2023 23:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691391350; cv=none; d=google.com; s=arc-20160816; b=wwkta5AQ3ubCHuZzrQJGx9yXP3Rm58iS1++QWzO6HBLFNYlk4Rq3FzZhorZTZmDyag Pct9wl+NmF2n3Ow8Xqi/aElEtofHIPLLpmKXLHm2ATLWgATtRkNf3QjiIJ4uXWN/5rsV KETTxra1nAm83FuxQZHdfet+nOUQksPbfFmBaP7fnqSelQvtv0WhJ65S9rgY2gGFN+R1 R5JwMVLXm7FNuZONVr6FMrsdLqRxmOQWxtU0wjxzYqsWK7k+OQbK5++FliAz2K01rtit jnY7j1T1XS4btxn9KAPSP+DpTtkjOdFvVj2yglp5VWOXwC9aNJEv5+Q8JXwaLKM3XDhJ sWew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TFnplcIQrufgoEeVnD1iXcx2sLuZX9r5b+/X2IXHNf8=; fh=CgNiAkI1NwVZAJr76Wgkfr0iG8JdyiU96tFJE914LRw=; b=SOQpoUgBQXigrRMFfFWsf+gX4WCXsvu+L99mlfDn/zjR2LAp8EUFeSltfHp5qfghSj Wkg9zi5htj3lSpphwLxtmDnkhXsbEyT5tk1kDBZSBXoWIcjvoig7EC+loGgpoR8oi3OZ 4IKz8ELluYwF5crc+W3zWT2OB46hjh0nKlamrZMfUExRW0WRrHx0988GAsqswvZCX1cN pZbwVULA87wqW5kmyNbqKSUGZR6E6Stps+SDvNOWA0hVDHQzyinmEjs1Cm7jLaDs2dCC eNYI2nNh/n4+lxQb9uPolGGFqg9SAFr/K7yG/Bsf5piBnJ0qih7Ye50OKHP3N0aPSspW NqMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Q7DxxIhg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n5-20020a05640206c500b005223a9be03bsi4405705edy.117.2023.08.06.23.55.26; Sun, 06 Aug 2023 23:55:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Q7DxxIhg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229866AbjHGFT1 (ORCPT + 99 others); Mon, 7 Aug 2023 01:19:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjHGFTZ (ORCPT ); Mon, 7 Aug 2023 01:19:25 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 123C8170B for ; Sun, 6 Aug 2023 22:19:24 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1bbc64f9a91so36079305ad.0 for ; Sun, 06 Aug 2023 22:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691385563; x=1691990363; 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=TFnplcIQrufgoEeVnD1iXcx2sLuZX9r5b+/X2IXHNf8=; b=Q7DxxIhgMo46QGY0MrbuPuKxRUCe4gavGP6YsLFndAQqK9FPDABdLLnQqnYB8H9ebW EkXHpkiFK7lecutNCxsohpe1hIPHd1HAxLXofeko7lWPAYlEUbYG/HWYA7VO6Ppji+L8 KPFb4h8H+3yOU6595s5gH4QBLiOWkMRAnxZU0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691385563; x=1691990363; 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=TFnplcIQrufgoEeVnD1iXcx2sLuZX9r5b+/X2IXHNf8=; b=E2nsTK9eRwqER0Sl/pGCs28YtwQPOSaEsEDsaUTIiwjSzdhyZruHgOPuPvPNMWkhbo B8QLsZxyc5IvoMVGO094gZbeCFgrJPXQU4LcT3jkVeBjL32LtMOrbHo+ST+QveMAdbLF dT9ajFL5pSib1w46y+w9NZ0xi6XybURcGUPbYx+Tg399IrhLuc6k0l5sR+3LhMAsNAu0 zOLskwDHw1r0CUvB6LMzGeLkRLOXcM+qV8W1ihOkj6xgr71rJLLxSJn9AhQp9ScjTOgG nzLZwtBTDV7qbp4ldw67pmKLxky+VSFuVRb57/IR79IuspTmYskP5JKOjs8ztf5+8/u9 +24Q== X-Gm-Message-State: AOJu0YwK0Ovv7ju5BckzsvPG+RmJ8ImJSyfFSOMCsWkbmPcOACXZqUou PlSyntsb6awrQIieR8qx+AluwA== X-Received: by 2002:a17:902:d512:b0:1bb:59da:77f8 with SMTP id b18-20020a170902d51200b001bb59da77f8mr11480833plg.48.1691385563411; Sun, 06 Aug 2023 22:19:23 -0700 (PDT) Received: from google.com (KD124209188001.ppp-bb.dion.ne.jp. [124.209.188.1]) by smtp.gmail.com with ESMTPSA id e12-20020a170902ed8c00b001bba7aab826sm5793688plj.163.2023.08.06.22.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Aug 2023 22:19:22 -0700 (PDT) Date: Mon, 7 Aug 2023 14:19:17 +0900 From: Sergey Senozhatsky To: Ian Wienand Cc: Minchan Kim , Petr Vorel , ltp@lists.linux.it, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Nitin Gupta , Sergey Senozhatsky , Jens Axboe , OGAWA Hirofumi , Martin Doucha , Yang Xu Subject: Re: [PATCH 0/1] Possible bug in zram on ppc64le on vfat Message-ID: <20230807051917.GC907732@google.com> References: <20221107191136.18048-1-pvorel@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FSL_HELO_FAKE, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (23/08/07 14:44), Ian Wienand wrote: [..] > > At this point, because this test fills from /dev/zero, the zsmalloc > pool doesn't actually have anything in it. The filesystem metadata is > in-use from the writes, and is not written out as compressed data. > The zram page de-duplication has kicked in, and instead of handles to > zsmalloc areas for data we just have "this is a page of zeros" > recorded. So this is correctly reflecting that fact that we don't > actually have anything compressed stored at this time. > > > >> If we do a "sync" then redisply the mm_stat after, we get > > >> 26214400 2842 65536 26214400 196608 399 0 0 > > Now we've finished writing all our zeros and have synced, we would > have finished updating vfat allocations, etc. So this gets compressed > and written, and we're back to have some small FS metadata compressed > in our 1 page of zsmalloc allocations. > > I think what is probably "special" about this reproducer system is > that it is slow enough to allow the zero allocation to persist between > the end of the test writes and examining the stats. > > I'd be happy for any thoughts on the likelyhood of this! Thanks for looking into this. Yes, the fact that /dev/urandom shows non-zero values in mm_stat means that we don't have any fishy going on in zram but instead very likely have ZRAM_SAME pages, which don't reach zsmalloc pool and don't use any physical pages. And this is what 145 is in mm_stat that was posted earlier. We have 145 pages that are filled with the same bytes pattern: > > >> however, /sys/block/zram1/mm_stat shows > > >> 9502720 0 0 26214400 196608 145 0 0 > If we think this is right; then the point of the end of this test [1] > is ensure a high reported compression ratio on the device, presumably > to ensure the compression is working. Filling it with urandom would > be unreliable in this regard. I think what we want to do is something > highly compressable like alternate lengths of 0x00 and 0xFF. So var-lengths 0x00/0xff should work, just make sure that you don't have a pattern of sizeof(unsigned long) length. I think fio had an option to generate bin data with a certain level of compress-ability. If that option works then maybe you can just use fio with some static buffer_compress_percentage configuration.