Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3836175pxv; Tue, 13 Jul 2021 05:05:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVcVdoMP+4VKQobXGYsIzkd0Cao1CcbpiUN9jdPnarGWTmKiyzdl5Um1EoVOhOyoirUutO X-Received: by 2002:a92:360b:: with SMTP id d11mr2626628ila.111.1626177935789; Tue, 13 Jul 2021 05:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626177935; cv=none; d=google.com; s=arc-20160816; b=eqYRh8kxlIzzhsn6aSCki4gOVj2RLfqzKW2MwP0XWrU9NF3vIOmYYBQGwI8BsRlm51 x39yzK/cGnwVWX7nbGYBbRONtMqTtL4Ngtwosy2mHgxmJblO4ooo5HITIILHVCcO5AIA 9X+lUF4+LFlSGUrgJYE0rTHieI52JSXmDfQWsZ7fgxdt4y7mOv40ALLIw/xJQTGhZ1wN miG7jaDATi6qrYqWJFgVHUpoK7wzirkpRPGPE3QGlc/cpxz7fSObukIPJ5/0PJlqwOzl MeA8ZUDimFFlrWG29BMUSWzAVKqFsoD9aQxYJoIIBIl4H+sWQsNM9mS5KJF3nv+Awfga Fnsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=uJ/XATmEw2FOvWYcKuc48jTHeHh5xPl/7xffQRs+CgY=; b=0ifHSI618TxPhnJhb4wO9ISxhJBkcV8ZPbgXmNf/QGD0VluTUPR9HElyTkyeegzyxF SNGXPHLzP8gbtLNfUao1hBZr7sXV/aXpA/vIH5YfZs27MzNYSn673gIjPMj3n4CShD8A WN6sM7mkqIpVWI/pX8kMGirJaseHBqgkGi9hJeZ27PMdDWmXs1iiYzFMbkArJs91ljzQ 48kfxIELFGNgDSFsTzGoTsZvJkgNJZJVvrS+QPf3BOJoNSzidad2oZRiEjvNDYwsgGFS CHUtfKLzg0W2C2ZklNIlIYKJ4R+/tQnTwcv4VSUxiTxSTBeJ5pWaGIwAVNGkRRL1csBf RUDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si10945138ils.118.2021.07.13.05.05.23; Tue, 13 Jul 2021 05:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235968AbhGMMGm (ORCPT + 99 others); Tue, 13 Jul 2021 08:06:42 -0400 Received: from mail-vs1-f48.google.com ([209.85.217.48]:47088 "EHLO mail-vs1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235919AbhGMMGm (ORCPT ); Tue, 13 Jul 2021 08:06:42 -0400 Received: by mail-vs1-f48.google.com with SMTP id e9so10608942vsk.13 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=HFp3djgKOtqg6+QwjeSqXSUzCWX3ljs+otnqiIIVb1SskOhVUBFdD0opGC+Q7ECT51 svIvT7fSQdeoFjy+Bk5xOtWAxVeEoScSknwLH//TAM314BO++1iKHy5n2NbzgDINidXf QpOfVFoIkngvmbyWi2I4XgHZPcOw4BCzWzH1aKzmDBvjk8OJF1blV7NzJP32ppWXlJkQ 7MxDp5sOStIaFrWv4wgrbL2K1mcaFahSpSExgOlji7Or1veBcSSBu6oCsD+e1zqg1SrW p3XvX1dU9fpkIR3l/t9n48mqIXo20Bqt0hfvjkUZF73Qc4l6eki2lb/zxxuSSa+OADaF J9iw== X-Gm-Message-State: AOAM531qcJ+Vf3zSKm1p5hcLO1/C/dYQMTdJv4He4awA3va1fFbdk5Cj g1E6ET1Itum3E+aM2rugIqva1Tpyv8YB8W+MdNE= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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