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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C340C433F5 for ; Sun, 24 Apr 2022 19:15:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 837AE6B0074; Sun, 24 Apr 2022 15:15:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E6986B0075; Sun, 24 Apr 2022 15:15:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6870A6B0078; Sun, 24 Apr 2022 15:15:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 5902F6B0074 for ; Sun, 24 Apr 2022 15:15:22 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 25B3921A75 for ; Sun, 24 Apr 2022 19:15:22 +0000 (UTC) X-FDA: 79392726084.09.CC5F2D8 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf25.hostedemail.com (Postfix) with ESMTP id 14BAFA003B for ; Sun, 24 Apr 2022 19:15:15 +0000 (UTC) Received: by mail-pl1-f178.google.com with SMTP id n8so22509084plh.1 for ; Sun, 24 Apr 2022 12:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=jsx4mhumyN262gUb7FrEPxMNx1chS7GsJEszWuM5D/A=; b=Wo51Oxn2QBu17Kg6Ckcp5bmLU8e+B4E8VD8j14crRBfjC86gG/U1y40DNw22nLBdRX hV0rVVJD+P/GTrAmldnks0n0noeDYEERzQ3zwbYMJ6rRnXHfqLFcvKYAWyDZw3DwyXi9 BkPFym80fDvv61vi+J+CuqFvcB8Udk0iGnFEQRTHn8tNCu6/+8r8dJ4YYR/5y+SM1PV/ cJvPrj+seMmvsTSESZQxqCh6r8Ycz6Yal/aiqAE0z0T1okFQwoGINm6SwcmDqLGt2mQn 8nouGyPlhLb08BxvHN70GpQsLelVKBZ3RChs1GvrmCELqRdyxPuFb08t1LCRzEG7/Qr6 6Hmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=jsx4mhumyN262gUb7FrEPxMNx1chS7GsJEszWuM5D/A=; b=aMK8d1/bGr6UpL00YQ4Ymlei+KrD+T8oRq5xkqXiE/bh22mrvEO05ymtimXSUY30b4 5x2OOX5E8Sb+1v+XMPe4DbQ0Xy3nWDCxlpvjVTbgbzOyh87ch+0OK+fXrZN59Flsp7jz TBvZ6hTkKgnMR+95bEd1E2d/Ecn6v5zcaGN9ovFidcDsI1Jn8nmcFEWB5vRY5gDQwwSd KRVDH7zsVqlhSEGyB8zQ2by33zsIsaxjaUIyosI1YOEA3Juwqmjjqa+3BJaY6y6YFVDw dUdPxcipK1oVasaURRW39fXlLV3fDq41ILiwh0wd8jTPXZWFGMZwxEf/3WnQ42Dxcb+O qpcA== X-Gm-Message-State: AOAM533V1QiFUGB0WMI34bPaGojXDYvALEMpvrdSk+ZgF3QkRtSRl+GT G49X4LdvTLylNc7UTnsqbQU7ow== X-Google-Smtp-Source: ABdhPJxErEZvneHieQ1EqeKHlqIJ3de1/bJPxlpbuZEV4KrBg6XGSmnIkPJFh+dSRl0AfqymrzMBow== X-Received: by 2002:a17:90b:1e49:b0:1d2:9d82:8bb1 with SMTP id pi9-20020a17090b1e4900b001d29d828bb1mr27937373pjb.226.1650827720436; Sun, 24 Apr 2022 12:15:20 -0700 (PDT) Received: from [2620:15c:29:204:d4fc:f95c:4d79:861f] ([2620:15c:29:204:d4fc:f95c:4d79:861f]) by smtp.gmail.com with ESMTPSA id c9-20020a63a409000000b0039912d50806sm7313352pgf.87.2022.04.24.12.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Apr 2022 12:15:20 -0700 (PDT) Date: Sun, 24 Apr 2022 12:15:19 -0700 (PDT) From: David Rientjes To: Peter Collingbourne cc: Andrey Konovalov , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Andrew Morton , Catalin Marinas , Linux ARM , Linux Memory Management List , Linux Kernel Mailing List , vbabka@suse.cz, penberg@kernel.org, roman.gushchin@linux.dev, iamjoonsoo.kim@lge.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 In-Reply-To: <20220422201830.288018-1-pcc@google.com> Message-ID: <5cb2b96c-4f5e-d278-534a-d9e1ea989cf@google.com> References: <20220422201830.288018-1-pcc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 14BAFA003B X-Stat-Signature: urtu9hbidwn5hf9xecqh6qqpozmk9dff Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Wo51Oxn2; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf25.hostedemail.com: domain of rientjes@google.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=rientjes@google.com X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1650827715-783687 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 22 Apr 2022, 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 Acked-by: David Rientjes The command line options are described by Documentation/dev-tools/kasan.rst but it doesn't look like a update is necessary. I think the assumption today is that if we're using kasan=off then we aren't doing the alignment. I do wonder why kasan=off is not at least mentioned in Documentation/admin-guide/kernel-parameters.txt and perhaps for all other kasan options point the reader to Documentation/dev-tools/kasan.rst.