Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1833721pxm; Sun, 27 Feb 2022 04:27:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeWCoeKelQ2iytcck1ePMufyAf38dEQXuZyhbsprNcHBMTi8nYIHB58JmPNBU1gUCuzZ1N X-Received: by 2002:a17:902:9682:b0:14e:fe33:64af with SMTP id n2-20020a170902968200b0014efe3364afmr15783406plp.160.1645964823143; Sun, 27 Feb 2022 04:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645964823; cv=none; d=google.com; s=arc-20160816; b=Iz09HFCa02FpuVar70alWGbjJ95Xz3pQygdpilVc4aCfY+rP1qIHiMQ6XEKCx67FAP 4kdz3BPhjE7sBUKl1Zkq+JwnsUs8ea9KKl+WYCVM11djsqojiKUOwV9X+PhhQ/0+qSHh msqvFhkELkTvI8Bb8ABp6A/QAFbGxhQ3k+SEZNdUHIumn0qchJigVabx7jweBsgtPq+U d28RysEjHPDeZ0TE/3ktu69irOeKXFKq71Twlzat6Z9HxuEsbv9WrAWBhubNbYRjLHWg 78COVOltn1gdWY+7LWVjTTxlbdVpgpaM08t8ob/Hg0iQb8JRTf7KNUIgjXm/hsM0zWDr Q+jA== 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:dkim-signature; bh=kcVCh7MZ2s0H7mQ8KjsOc+AnnXv/uz5a9s+gE8EpkdI=; b=R15CYH9kDm4XIiEIUeOeEKmAmGoY7BUCS8RUCSd4chYMnbtDaPOg3P7HGDw4FskFN1 dQsUqbI0K8aivhtYnrTkqWuWpY70j8Lj3/NeA+8L/ujPakEWhOJG31r8wdtYyPnDHc9C PX0+wj8UPDXngTNAdV7itnvKc8VO99UQUPojaaobmGW+EYscYezN5sumhykbRGajZs3B MzVswBqCdbPJjVZL+ptlPAeG0ZSV13WlDNrc64pza2kXxwnS+oxVW64A/72l8COmQMLI VPkI6UMTNzrUDjdVrK7wmMQ8R9C+45Kb13odu70QzsZNnnj5eByJu667xEWZ9ZAvf+FE QISA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="WA+WWfj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a1709028d8a00b0015004fd9070si7185073plo.149.2022.02.27.04.26.49; Sun, 27 Feb 2022 04:27:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="WA+WWfj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229666AbiB0Jov (ORCPT + 99 others); Sun, 27 Feb 2022 04:44:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbiB0Jot (ORCPT ); Sun, 27 Feb 2022 04:44:49 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4A9D4551E for ; Sun, 27 Feb 2022 01:44:12 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id bx9-20020a17090af48900b001bc64ee7d3cso8739409pjb.4 for ; Sun, 27 Feb 2022 01:44:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=kcVCh7MZ2s0H7mQ8KjsOc+AnnXv/uz5a9s+gE8EpkdI=; b=WA+WWfj/mtf8DGK2jeKBXYh6JG+I6OdvQ6eKzyMr/JSQRhci2o+TLMHSAoGVU1CJuq 7c1eFHqUGJqg7mkcR/+ig6pjF+VciV/7klL/a1Yitwo63XKd4Pc42m+ubgf7ZbxTIQaS aPTLbpTpcF0CVUb12lPWrG/oVd7RXpHc9An/+UxjmbCbgxbb5W49SemR/g/v6Pp6tzST yoVaur7lE/sXhc72ssoofszXvrchtHI3E8vZymOHy65hZvKGAVeolf8IKVcANGWnJPfI I9FxPHeaSXFWcd/bASynaaDI1wCB7uEFfCekXTsOsHg0zc66Aka+As8RK0QvnFbp8wHL sIUw== 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=kcVCh7MZ2s0H7mQ8KjsOc+AnnXv/uz5a9s+gE8EpkdI=; b=xMON4qfrH0Agq3RSCgrn7ZinJeiQiITJn2oVkgyyL6uxXArfOhtP5M6OEQ2G6wREJx yUMtHfgMuF+6vEInHzjhvcYx0Poe+oKGiBdjnfCy9yoATnxLO6F0KE9Wp5ylJk9cwTIn pYbVGvreVvp59bZGicUhYXxD5NfgobhflICFq6xl9KjxIa+zeE49GviyDYlWT+awRrT6 H/nCqUP0EUKwfQEZqNnbVnOdJIvv4bN1R4GB62dyJ99SCP1mMEMBNiz6NoIoDwDB69OZ O1/03e3Gw4u1/rfPseTZhDu1VD/tyrOrAOvPjyFG26D5RkZJsIQOkXnUbYtV190JaNTZ tR/Q== X-Gm-Message-State: AOAM530fbTwyK3yMAGSSAAYAfQlYgsiKmkToBGoAE4PT9+dvQ43YZywg xiND7vcIrrifAgZ08JmzqmQ= X-Received: by 2002:a17:902:a3c6:b0:14f:b4bd:a1d7 with SMTP id q6-20020a170902a3c600b0014fb4bda1d7mr15292728plb.173.1645955052286; Sun, 27 Feb 2022 01:44:12 -0800 (PST) Received: from ip-172-31-19-208.ap-northeast-1.compute.internal (ec2-18-181-137-102.ap-northeast-1.compute.amazonaws.com. [18.181.137.102]) by smtp.gmail.com with ESMTPSA id b3-20020a056a00114300b004e099ec2871sm9314294pfm.154.2022.02.27.01.44.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 01:44:11 -0800 (PST) Date: Sun, 27 Feb 2022 09:44:06 +0000 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka Cc: David Rientjes , Christoph Lameter , Joonsoo Kim , Pekka Enberg , Roman Gushchin , Andrew Morton , linux-mm@kvack.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org, Oliver Glitta , Faiyaz Mohammed Subject: Re: [PATCH 2/5] mm/slub: use stackdepot to save stack trace in objects Message-ID: References: <20220225180318.20594-1-vbabka@suse.cz> <20220225180318.20594-3-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220225180318.20594-3-vbabka@suse.cz> X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FROM_FMBLA_NEWDOM, HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 25, 2022 at 07:03:15PM +0100, Vlastimil Babka 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. > I think it's not a replacement? > The benefits are smaller memory overhead and possibility to aggregate > per-cache statistics in the following patch using the stackdepot handle > instead of matching stacks manually. > > [ vbabka@suse.cz: rebase to 5.17-rc1 and adjust accordingly ] > > This was initially merged as commit 788691464c29 and reverted by commit > ae14c63a9f20 due to several issues, that should now be fixed. > The problem of unconditional memory overhead by stackdepot has been > addressed by commit 2dba5eb1c73b ("lib/stackdepot: allow optional init > and stack_table allocation by kvmalloc()"), so the dependency on > stackdepot will result in extra memory usage only when a slab cache > tracking is actually enabled, and not for all CONFIG_SLUB_DEBUG builds. > The build failures on some architectures were also addressed, and the > reported issue with xfs/433 test did not reproduce on 5.17-rc1 with this > patch. This is just an idea and beyond this patch. After this patch, now we have external storage that records stack traces. It's possible that some rare stack traces are in stack depot, but not reachable because track is overwritten. I think it's worth implementing a way to iterate through stacks in stack depot? > > Signed-off-by: Oliver Glitta > Signed-off-by: Vlastimil Babka > Cc: David Rientjes > Cc: Christoph Lameter > Cc: Pekka Enberg > Cc: Joonsoo Kim -- Thank you, You are awesome! Hyeonggon :-)