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 X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53486C11F66 for ; Tue, 13 Jul 2021 12:03:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CF01A61361 for ; Tue, 13 Jul 2021 12:03:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF01A61361 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E58866B008C; Tue, 13 Jul 2021 08:03:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E077E6B0095; Tue, 13 Jul 2021 08:03:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCF586B0096; Tue, 13 Jul 2021 08:03:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0113.hostedemail.com [216.40.44.113]) by kanga.kvack.org (Postfix) with ESMTP id 9B80E6B008C for ; Tue, 13 Jul 2021 08:03:54 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 222FB184163E9 for ; Tue, 13 Jul 2021 12:03:52 +0000 (UTC) X-FDA: 78357430704.26.DEE30C2 Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) by imf16.hostedemail.com (Postfix) with ESMTP id B9FADF0000A3 for ; Tue, 13 Jul 2021 12:03:51 +0000 (UTC) Received: by mail-vs1-f46.google.com with SMTP id a22so5546034vso.1 for ; Tue, 13 Jul 2021 05:03:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uJ/XATmEw2FOvWYcKuc48jTHeHh5xPl/7xffQRs+CgY=; b=eQdHgDlXXPjOp2VbJZvg4NnUKLBA/2ps+IaC1FV8bcT8p87cqPAOoHmVBKSEY6FmLT qlE/RHI3I92YNZqypPwGNNnDRk9oO9i93MGUqkx3Vq2yU90Vhtb/XU7wWtDY1ln8+ZVV ud+/VhTUIHODTP7BrG5x1GmiLCJrVwkNPgNU4Min7W5x3w91xOdxExoCtxj2Bmjh6Zeu 1cRnvYOIvSqUueke4BbgGtXzpP2qfpmsQ8ylyEh/n12X/RLkxfRJTWqQ35DKFxRSbKFB QwHCLjqFOUJ23vc2vtUOPUsD5rtUKQie+Cs98yFrVv0dMH6nKIdiG8QDSTUGOqgD02/D ZwNA== X-Gm-Message-State: AOAM530gA65Oi4IWBAaiNL2t/PKpjYCDnEWHPmhWEdWaTuCigL9nNfAO nK3QtxKfkOK1BwZlQp/hMh1HUNjI1ecVSW7zjic= X-Google-Smtp-Source: ABdhPJz/wYxiMEghMEpeCH26yZOIcHTipXqFk2MKx3dtSnvRcQq5ZNTfblEiJ56qKYYPOx6Lu73/EnheHrxuPN8B8CY= X-Received: by 2002:a67:8702:: with SMTP id j2mr5598475vsd.3.1626177831098; Tue, 13 Jul 2021 05:03:51 -0700 (PDT) MIME-Version: 1.0 References: <20210414163434.4376-1-glittao@gmail.com> In-Reply-To: <20210414163434.4376-1-glittao@gmail.com> From: Geert Uytterhoeven Date: Tue, 13 Jul 2021 14:03:39 +0200 Message-ID: Subject: Re: [PATCH] mm/slub: use stackdepot to save stack trace in objects To: glittao@gmail.com, Yogesh Lal Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Linux Kernel Mailing List , Linux MM Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B9FADF0000A3 X-Stat-Signature: oo33xf4tf3mfhzx793njrwirhanwoabe Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf16.hostedemail.com: domain of geertuytterhoeven@gmail.com designates 209.85.217.46 as permitted sender) smtp.mailfrom=geertuytterhoeven@gmail.com X-HE-Tag: 1626177831-386996 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: Hi Oliver, Yogesh, On Wed, Apr 14, 2021 at 8:08 PM wrote: > From: Oliver Glitta > > Many stack traces are similar so there are many similar arrays. > Stackdepot saves each unique stack only once. > > Replace field addrs in struct track with depot_stack_handle_t handle. > Use stackdepot to save stack trace. > > The benefits are smaller memory overhead and possibility to aggregate > per-cache statistics in the future using the stackdepot handle > instead of matching stacks manually. > > Signed-off-by: Oliver Glitta Thanks for your patch, which is now commit 788691464c294553 ("mm/slub: use stackdepot to save stack trace in objects") in v5.14-rc1. > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -1891,6 +1891,7 @@ config SLUB_DEBUG > default y > bool "Enable SLUB debugging support" if EXPERT > depends on SLUB && SYSFS > + select STACKDEPOT if STACKTRACE_SUPPORT > help > SLUB has extensive debug support features. Disabling these can > result in significant savings in code size. This also disables This change increases memory consumption by 4 MiB (or more, see below). Looking at lib/Kconfig: | config STACK_HASH_ORDER | int "stack depot hash size (12 => 4KB, 20 => 1024KB)" The sizes reported here are not correct, as the actual memory consumption is not STACK_HAS_ORDER bytes, but STACK_HAS_ORDER pointers. Hence they're off by a factor of 4 or 8. | range 12 20 | default 20 Does this really have to default to the maximum value? | depends on STACKDEPOT | help | Select the hash size as a power of 2 for the stackdepot hash table. | Choose a lower value to reduce the memory impact. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds