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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7195DC433EF for ; Mon, 25 Apr 2022 15:56:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243105AbiDYP7U (ORCPT ); Mon, 25 Apr 2022 11:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243103AbiDYP7S (ORCPT ); Mon, 25 Apr 2022 11:59:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0DA83FBE5 for ; Mon, 25 Apr 2022 08:56:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 45AAAB81864 for ; Mon, 25 Apr 2022 15:56:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0018C385A9; Mon, 25 Apr 2022 15:56:08 +0000 (UTC) Date: Mon, 25 Apr 2022 16:56:05 +0100 From: Catalin Marinas To: Peter Collingbourne Cc: Andrey Konovalov , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Andrew Morton , Linux ARM , Linux Memory Management List , Linux Kernel Mailing List , vbabka@suse.cz, penberg@kernel.org, roman.gushchin@linux.dev, iamjoonsoo.kim@lge.com, rientjes@google.com, Herbert Xu , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev , Eric Biederman , Kees Cook Subject: Re: [PATCH v3] mm: make minimum slab alignment a runtime property Message-ID: References: <20220422201830.288018-1-pcc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220422201830.288018-1-pcc@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 22, 2022 at 01:18:30PM -0700, Peter Collingbourne wrote: > When CONFIG_KASAN_HW_TAGS is enabled we currently increase the minimum > slab alignment to 16. This happens even if MTE is not supported in > hardware or disabled via kasan=off, which creates an unnecessary > memory overhead in those cases. Eliminate this overhead by making > the minimum slab alignment a runtime property and only aligning to > 16 if KASAN is enabled at runtime. > > On a DragonBoard 845c (non-MTE hardware) with a kernel built with > CONFIG_KASAN_HW_TAGS, waiting for quiescence after a full Android > boot I see the following Slab measurements in /proc/meminfo (median > of 3 reboots): > > Before: 169020 kB > After: 167304 kB > > Link: https://linux-review.googlesource.com/id/I752e725179b43b144153f4b6f584ceb646473ead > Signed-off-by: Peter Collingbourne > Reviewed-by: Andrey Konovalov Reviewed-by: Catalin Marinas