Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4788783rdb; Tue, 12 Dec 2023 09:17:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCmsfx1meoQXIBqYVo1tZ4Elf7N8PhTQ7y7VItSToBIB9ZAv0dqo3CjXt20aujX0f8zJa8 X-Received: by 2002:a05:6a20:1445:b0:18b:5b7e:6b9 with SMTP id a5-20020a056a20144500b0018b5b7e06b9mr7324423pzi.2.1702401472520; Tue, 12 Dec 2023 09:17:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702401472; cv=none; d=google.com; s=arc-20160816; b=xmBSAMvheS3vJvgwON5rUb54At2G9s4y3crIHwa77cUcYxnNpTPePL2RR/C8mY/v1A 2r+bor8SBnPR97AAkzPakP5mh/GOwdPsMUaY0gI8phiTcmP5VT+Lq8fiRey0Se4AygaS IBI21IF9HK4XVB1hdT2KKcDUyYYyMRw++l/3kXOHzHilD0pEYw1KAP+3hxE9zMVac0v9 ebN1JREY2luKO5ykWuxYSmXti5UXNR2lLvd1CyMOqwMY/6xHhSXBNKVtLRIp9n2X1MSF TXq1GYRRRQ+Sq+LYFgG9vAE7csFzvldDDYI4Lco2UkqbyKW5blTf/AKWdHuORk/+NX2m v6JQ== 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; bh=X2aODs1uc3uHBfXayWdicJeqIVKLISDvL3scDcVESlw=; fh=0JQmW7xdAE/XjsRtMti+IKQwjHH3yd/qowBnwzDBl7U=; b=md6QSZToOZlYTqbNZkKMbKmCyF4zJ+cX3GmzuzONh1W3p97VxJx/pGUq4Y5nSQHBhu BHSQqFwHUoTKue+LWwviQ21djMRQECt7tyVCIQYBHlU51372VryJyWTw1AM+HZnm5d6b VUbn1Nvru2OEHqiHxRZuWnSmYzZkmb1gTNRp5YrZ46BMnorB4krhJJf+9Il8exuN4qXY vCKbHTdzwvrEZKSQPP0h77iYnRy/XpeYZJMjO3LqQkFe2fWULn5Zf+7zER7lQbN8V0sk moV6d/LvuE7B0yoh31Ki/DIXDo2bOReC387DGsbC1PvNh9uIS0zzqM05TA1VssS12306 4RGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id 19-20020a631253000000b005859c81f1f0si7909600pgs.137.2023.12.12.09.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 09:17:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4845E80B0252; Tue, 12 Dec 2023 09:17:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232981AbjLLRRi (ORCPT + 99 others); Tue, 12 Dec 2023 12:17:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232978AbjLLRRg (ORCPT ); Tue, 12 Dec 2023 12:17:36 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91F7099 for ; Tue, 12 Dec 2023 09:17:43 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D36EFC433C8; Tue, 12 Dec 2023 17:17:40 +0000 (UTC) Date: Tue, 12 Dec 2023 17:17:38 +0000 From: Catalin Marinas To: Alexander Potapenko Cc: will@kernel.org, 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 3/4] arm64: mte: add compression support to mteswap.c Message-ID: References: <20231113105234.32058-1-glider@google.com> <20231113105234.32058-4-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231113105234.32058-4-glider@google.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 12 Dec 2023 09:17:50 -0800 (PST) On Mon, Nov 13, 2023 at 11:52:32AM +0100, Alexander Potapenko wrote: > Update mteswap.c to perform inline compression of memory tags when > possible. > > If CONFIG_ARM64_MTE_COMP is enabled, mteswap.c will attempt to compress > saved tags for a struct page and store them directly in Xarray entry > instead of wasting heap space. > > Soon after booting Android, tag compression saves ~2x memory previously > spent by mteswap.c on tag allocations. On a moderately loaded device with > ~20% tagged pages, this leads to saving several megabytes of kernel heap: > > # cat /sys/kernel/debug/mteswap/stats > 8 bytes: 102496 allocations, 67302 deallocations > 128 bytes: 212234 allocations, 178278 deallocations > uncompressed tag storage size: 8851200 > compressed tag storage size: 4346368 > > (statistics collection is introduced in the following patch) > > Signed-off-by: Alexander Potapenko Reviewed-by: Catalin Marinas