Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5333115rdb; Wed, 13 Dec 2023 06:02:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IETo07RmRTla7qrwNFfWLuW2r3bIRewdwkDKGPyQXccnGYh8LciOp1i9M3Ae21oa/AN08Ri X-Received: by 2002:a05:6e02:1a63:b0:35f:717e:c960 with SMTP id w3-20020a056e021a6300b0035f717ec960mr1294638ilv.26.1702476157623; Wed, 13 Dec 2023 06:02:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702476157; cv=none; d=google.com; s=arc-20160816; b=YEm6qpsR6UL10UCdKd52tUBsuuP8EkPAstr1q3mZtuS4r7yWRKF/hsOwxDLoQrg2Uj 1zcvBmJUWheYVbl+GkfplpYoeiwn5kQ58crOMPz9hTd6kVqfAlQcYPnU85Ri90/iKhlI Y1O5xSSxslJUTPpLnssYvc3CcjfpHCXb7FLQBTP8WSs8LzMrMc94g5GyLjOKS3fAhDGi V0h3zXj7QfPgrT4mBwYeTEH98G9DL3jxFYHzSNXKxC6xNF1X31se1VKpzP1Ko0eS4gTc 9Rk3fxCAz3TSg7/H3SR29BKDPKEQPyaR+ubFBc/vdTQAugCA7IOnuGH+CBMNjFrNUOvZ x74Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=t+EwRk4ihEWZ1GfrXn6PM8sUev4WliEA8COuJ0yCh2I=; fh=AlquilITVaK/2MUWzqdywI6hHy4+ahyWNPVVINvl6JM=; b=uspLlQzS0Qh6mTYXfR/Tcnd0oEdV29u69BdQQXubtIf9sCCioESTzCdewQHQTsgflX DqVlFln49TA2XmHng9RgzEWhhxX9Kkjmk3MUWHqncbesfc+LMhd/rKHIxX77HHjgR8f2 kddq75sD9KovGIQ3BpkScfWz6yPmYvKtuWZNrGuZPhXrPvCrceQaxwBd1Im+onkNL5Mx yrvL2d9Fn0snx9GYqEYHHIC6I1gfSsRcQvqo/jb/IKplFXR7xqHLwl79QgKKiN4yhfEM 9PxtcDeSIpDGlOeTQMt/OaU3j2Oxcsh2Gr7o0f3xsmJek++GTMPUmptUpSeRDGr+gB7f tApg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=UlMJ6ciA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id c17-20020a631c11000000b005c62adcc87csi9718410pgc.882.2023.12.13.06.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 06:02:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=UlMJ6ciA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5B3A8822012B; Wed, 13 Dec 2023 06:02:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235426AbjLMOCJ (ORCPT + 99 others); Wed, 13 Dec 2023 09:02:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235430AbjLMOB6 (ORCPT ); Wed, 13 Dec 2023 09:01:58 -0500 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DD5D1B1 for ; Wed, 13 Dec 2023 06:02:00 -0800 (PST) Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-67a91751ba8so41727196d6.3 for ; Wed, 13 Dec 2023 06:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702476119; x=1703080919; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=t+EwRk4ihEWZ1GfrXn6PM8sUev4WliEA8COuJ0yCh2I=; b=UlMJ6ciAmEVKyoI5W1wnEbde2KHVfh6SCyiXVVF7eadkr0CqrvjxMS9hInua1hSjx9 RgOYln1hi7i7JiwzknvJYtdPzGWfIv20ckQOj1igaVKkFpqp/Iuy+rlqMwD/IG7jT4VB 4gbNHw7hf3Ou2/T6sAQnaOAbFOaM4T70JuKs3GJ70+EZWD01DkKWYJ+QsG7vuGKogWJ1 PJNbsQWU9plUiGiAhFkJV51WIrgqKn9bGThNmtqRFDAdgliSfE7kAfZ1nHYoqYZEH/dq H5iKdDNlwnohzgopYZfCRepYtM3OyAamuu4ZyMQGujagSxM3Qiu6K1iLE5HnLUX28cPT H0vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702476119; x=1703080919; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t+EwRk4ihEWZ1GfrXn6PM8sUev4WliEA8COuJ0yCh2I=; b=vYLH2JdPGykQnpfmzbn/WTieHo0Ve3G6q+y7jVkUSyfs0/x6q4/6AZiGF++kA6qG8Z cs8gaTEtfQKhgcR1OXgmoxVOKuM4Q3DohuGRqAZgNK/l5LSyT/2owPSxumv+5EapjxQ0 QDa3/2GCzOUpu+Gtn5lSGN5W8yUaYk8L93/LnyVX2BIVCJF0bNURMswSwvWGSS2xdvR6 GESrrnfe9NtlwpwfxF2HNrXUmev6BWwkV9CZr+MbpSnWNcagnZ5Mv4nCh3pLPYwZ0LTN 1hvN2W2fStyizG0XgbQAoSNNXdmfWAdF5DngbcC42y7/34jk6s8y7+K8DDwVL0MiztCM fX0g== X-Gm-Message-State: AOJu0YzZAkQ2TPgsAvPYWG3R3ry3SBi1AMEVGGSsnDdEQ/BuxcCaxFyA r7qBCmXvuyarlBMq1UskljJG1lbmWEA151Dwy/03vA== X-Received: by 2002:ad4:45b1:0:b0:67e:dbf3:a4ba with SMTP id y17-20020ad445b1000000b0067edbf3a4bamr4342070qvu.89.1702476119250; Wed, 13 Dec 2023 06:01:59 -0800 (PST) MIME-Version: 1.0 References: <20231113105234.32058-1-glider@google.com> <20231213123130.GC31326@willie-the-truck> In-Reply-To: <20231213123130.GC31326@willie-the-truck> From: Alexander Potapenko Date: Wed, 13 Dec 2023 15:01:17 +0100 Message-ID: Subject: Re: [PATCH v9 0/4] Implement MTE tag compression for swapped pages To: Will Deacon 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Wed, 13 Dec 2023 06:02:24 -0800 (PST) On Wed, Dec 13, 2023 at 1:31=E2=80=AFPM Will Deacon wrote= : > > 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 i= n > > this patch series is able to efficiently compress fixed-size tag buffer= s, > > resulting in practical compression ratio of 2x. In many cases it is > > possible to store the compressed data in 63-bit Xarray values, resultin= g > > 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-glide= r@google.com/T/) > > that is mailed separately. > > That's a shame, because it means I can't apply the series as-is: > Uh-oh, sorry about that. There was another series depending on the bitmap_read/bitmap_write API, and I thought mailing those patches separately would speed things up. But in fact Yury requested them to have at least one user, so now that the MTE series is also acked I'd better bring everything back together. Let me send out another version. > > arch/arm64/mm/mtecomp.c: In function =E2=80=98mte_bitmap_write=E2=80=99: > arch/arm64/mm/mtecomp.c:105:2: error: implicit declaration of function = =E2=80=98bitmap_write=E2=80=99; did you mean =E2=80=98bitmap_free=E2=80=99?= [-Werror=3Dimplicit-function-declaration] > 105 | bitmap_write(bitmap, value, *pos, bits); > | ^~~~~~~~~~~~ > | bitmap_free > arch/arm64/mm/mtecomp.c: In function =E2=80=98mte_bitmap_read=E2=80=99: > arch/arm64/mm/mtecomp.c:198:9: error: implicit declaration of function = =E2=80=98bitmap_read=E2=80=99; did you mean =E2=80=98bitmap_remap=E2=80=99?= [-Werror=3Dimplicit-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? Having them in bitmap.h seems natural - this way they can be reused by other people.