Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5279969rdb; Wed, 13 Dec 2023 04:32:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6msAODFSmsjYVgVWxthlBsTRN0AATTs06NL9Fs+k+eo5sMlrzHIE91manfwvNeRZiLca+ X-Received: by 2002:a05:6871:106:b0:203:3636:247 with SMTP id y6-20020a056871010600b0020336360247mr97164oab.66.1702470748707; Wed, 13 Dec 2023 04:32:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702470748; cv=none; d=google.com; s=arc-20160816; b=oVsn/uMIdHyhLxsd5c2kXQ7WhaYbBH5/gP+EFZh6EAvfjpXOO1KKsld44XhNpctZic UuNai7sjQFBGIeG6tHhRBu1N4/VVhWRNNsINe5xD55KupqyIrWeYvKVX7p22bGysn8Dw j4w76GKVEgJSasWWvOCxSs/RKD5DvORzIT/KA9KtStHEkT7K7soA8EBkTQ3lLu1JFQVA Wn0fgd1eZ4DQy0uIunh9NFgEsOey36RIpzWxG3dxqGrRYfD9FXGNZ8ClJVccRdMnuewA 3tNjGh4KGB2HvZOOTi+RPXsg4pN1hG8ogXleXHKrvD3ILKdXN4vYUTxi+/JVdIbTbzSG za+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=n9bBXWgjTujyFCkEBU5hXJ41GW+8jJcX8SMl86Ah16E=; fh=ztiXsPosnCEog+QftwHHLg0R/lLaPeHzuc8PbsgtiY0=; b=03U1dvmdpfKK4bys2dCUhBzJ8aLPr3G9RWBm5Xp4hATrcaZmkHSsrcSsMqBRjw0I4g HJuiRQbjzXIGUoqcU8lBN807B9cOtHgv5TEYTGQ9jahC0bUwd9QwaN9op1IWVkXUOV16 JzgNW++FwzO4FKjXCjJC4Hesnq2fJM44C7cMAh8lTSsmNN/739KtMjE+q5TZNy6+hAUw 174aWLM9n7otX4yWIAfsKpmoPvK/BhbW7Um+Cmzg3qn7mH7BY1SEZF9ky5NfqmZUSlIG v3Q38ti4NPGXIRbJ1Kt4J3nmUYUji8EfociZOh4JyAVd1ENdJ39Uc9WisB+dmKhFtJhN Kiig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="SYLq/Mzr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s24-20020aa78298000000b006cbd24bf0b7si3902714pfm.52.2023.12.13.04.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:32:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="SYLq/Mzr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 059DB8087E0A; Wed, 13 Dec 2023 04:32:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233376AbjLMMbd (ORCPT + 99 others); Wed, 13 Dec 2023 07:31:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233407AbjLMMba (ORCPT ); Wed, 13 Dec 2023 07:31:30 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A45BA4 for ; Wed, 13 Dec 2023 04:31:37 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CA3EC433C8; Wed, 13 Dec 2023 12:31:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702470696; bh=AYrI7SLk86MHABNGX/QodrHC6xXs3xbeF0g+zgtdlks=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SYLq/MzrCIXIJOMx7Iam0o8x2A2PWGEe8WO2O6+C3rYM1GiaFmXdop7KEplIkfnP6 qw7t7K8+lO9qHpp0V+0Tl+0pnSY7jU+1YqbaQ8fnRYJzmtw5zHsZskIjuvO8iGeZp9 StgPNxSVW4Yc2Jme6QpLJtuP0uas3PvhKlfI9j+prdNaD4ZQEaRBfIp2fuwQlrikBg o7k94L0B5dxMH74otpF5J1MaYLFBarSDaX2Fz2S7ycnM8gaDsKmKInnl4kviQq691P JsHQF9XKlHN4FPkUonBcHTCHfP5zIxBaj37Y4+t5B3XRmE0zrKynPQ7Tz8I2V1eEHf JvC7lK/V1Xx/Q== Date: Wed, 13 Dec 2023 12:31:30 +0000 From: Will Deacon To: Alexander Potapenko Cc: catalin.marinas@arm.com, pcc@google.com, andreyknvl@gmail.com, andriy.shevchenko@linux.intel.com, aleksander.lobakin@intel.com, linux@rasmusvillemoes.dk, yury.norov@gmail.com, alexandru.elisei@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, eugenis@google.com, syednwaris@gmail.com, william.gray@linaro.org Subject: Re: [PATCH v9 0/4] Implement MTE tag compression for swapped pages Message-ID: <20231213123130.GC31326@willie-the-truck> References: <20231113105234.32058-1-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231113105234.32058-1-glider@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Dec 2023 04:32:26 -0800 (PST) On Mon, Nov 13, 2023 at 11:52:29AM +0100, Alexander Potapenko wrote: > Currently, when MTE pages are swapped out, the tags are kept in the > memory, occupying PAGE_SIZE/32 bytes per page. This is especially > problematic for devices that use zram-backed in-memory swap, because > tags stored uncompressed in the heap effectively reduce the available > amount of swap memory. > > The RLE-based algorithm suggested by Evgenii Stepanov and implemented in > this patch series is able to efficiently compress fixed-size tag buffers, > resulting in practical compression ratio of 2x. In many cases it is > possible to store the compressed data in 63-bit Xarray values, resulting > in no extra memory allocations. > > This patch series depends on "lib/bitmap: add bitmap_{read,write}()" > (https://lore.kernel.org/linux-arm-kernel/20231030153210.139512-1-glider@google.com/T/) > that is mailed separately. That's a shame, because it means I can't apply the series as-is: arch/arm64/mm/mtecomp.c: In function ‘mte_bitmap_write’: arch/arm64/mm/mtecomp.c:105:2: error: implicit declaration of function ‘bitmap_write’; did you mean ‘bitmap_free’? [-Werror=implicit-function-declaration] 105 | bitmap_write(bitmap, value, *pos, bits); | ^~~~~~~~~~~~ | bitmap_free arch/arm64/mm/mtecomp.c: In function ‘mte_bitmap_read’: arch/arm64/mm/mtecomp.c:198:9: error: implicit declaration of function ‘bitmap_read’; did you mean ‘bitmap_remap’? [-Werror=implicit-function-declaration] 198 | return bitmap_read(bitmap, start, bits); | ^~~~~~~~~~~ | bitmap_remap cc1: some warnings being treated as errors make[5]: *** [scripts/Makefile.build:243: arch/arm64/mm/mtecomp.o] Error 1 Do you really have such a hard dependency on those new bitmap ops? Will