Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp435030rwe; Thu, 1 Sep 2022 01:55:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR4hbd/4N6rMxrvgn6bajDOHv8sByzE2jdgp/W6oZGFk5QMuYqBFDcgypQEuzcWTU/3g4MSZ X-Received: by 2002:a17:907:a046:b0:730:9c7a:eab3 with SMTP id gz6-20020a170907a04600b007309c7aeab3mr23555388ejc.285.1662022518573; Thu, 01 Sep 2022 01:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662022518; cv=none; d=google.com; s=arc-20160816; b=A/ACZikBcE0Mf8fnVH2kuThbjC/ktfY26rY6pPyhmjMP6MCttl9P/svlZ78QXudMZL NQHOL3+5OJ4M4x+SMpuhcMABBfnV56IDsfP4trYy+VrWMvEyeAtIvU7AkAE0ebaRndB0 rPRZ4+RKAcokCdHvtd7u1JD2bFNryv3SpSQWZ/KnUeJvLZT+hMZ3pppaoeUAI5Y8l6GK tH90PWr6OvcTXY8vu4stq7NfqkVXP0k8v0/nikwVf7PEOchibS6RHOx2oWJIZG17Ar6u vcrJeiMfGd9lHgE3lOU58IE/L6jdtAJINoxLnr3njv2PXE/ztjGQ6jOX5lEP5Yh3RRw4 jv1w== 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=NrHpzMz41QmduVOHpV9GnZB1kYyiHKDCqktpestefcU=; b=pHTguzMN+koE2S6iXZ3w9/iJ9351QL+z6WneXcw1xqe67UMjkAO2xoqdBBoniF4sPY Q93EqPFsURwHE06nnkPNeo4gWr9Z1/X/LGlonMtrWSWcSBbReCmVaWtNsOR+j6wDoeOd 5Ml8WRy+pNWHCXlEclwLVFbykB7FnmQsixxYKhD+5+/pWWbxW8nUkdGRaj1MgTamc7vA Nhb8jbv+ohOc+bWc22cp19K3C2bok2X6wsg1m3zvnNo1TGJ2fHiNeoavmm82auUgsHx3 L1oR+RzqGbGsmdYmkaPmBJpTLUroFkkWfoVWAuOMXqVnlerfxX0JQhWQxzRLURVU30pM rDKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=tZeFnsBg; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc20-20020a1709078a1400b0072a72bb6f80si13464325ejc.744.2022.09.01.01.54.52; Thu, 01 Sep 2022 01:55:18 -0700 (PDT) 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=@suse.com header.s=susede1 header.b=tZeFnsBg; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233471AbiIAIiP (ORCPT + 99 others); Thu, 1 Sep 2022 04:38:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232934AbiIAIiL (ORCPT ); Thu, 1 Sep 2022 04:38:11 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A61FA126DE2 for ; Thu, 1 Sep 2022 01:38:10 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5E08B1FB58; Thu, 1 Sep 2022 08:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1662021489; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NrHpzMz41QmduVOHpV9GnZB1kYyiHKDCqktpestefcU=; b=tZeFnsBgvZN6JzMwErJ11ohD5yGPe2CJTezUP6foJPfV4OKUBAAU3RcJOFpSRn4MkMiJQc 8+7Hrgyh2hI/kyJ0UrL1nq0SjQtoKssxX57d+GfLKyXlmgqWx9iJ53yHizE/g3NBBrE9Cu tEuPLNok/zsJdO1eqZdb0nz3tVEor2c= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3C1D713A79; Thu, 1 Sep 2022 08:38:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KlFtDHFvEGPpNwAAMHmgww (envelope-from ); Thu, 01 Sep 2022 08:38:09 +0000 Date: Thu, 1 Sep 2022 10:38:08 +0200 From: Michal Hocko To: Marco Elver Cc: Oscar Salvador , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vlastimil Babka , Eric Dumazet , Waiman Long , Suren Baghdasaryan , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , kasan-dev@googlegroups.com Subject: Re: [PATCH 1/3] lib/stackdepot: Add a refcount field in stack_record Message-ID: References: <20220901044249.4624-1-osalvador@suse.de> <20220901044249.4624-2-osalvador@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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 Thu 01-09-22 10:24:58, Marco Elver wrote: > On Thu, Sep 01, 2022 at 06:42AM +0200, Oscar Salvador wrote: [...] > > diff --git a/lib/stackdepot.c b/lib/stackdepot.c > > index 5ca0d086ef4a..aeb59d3557e2 100644 > > --- a/lib/stackdepot.c > > +++ b/lib/stackdepot.c > > @@ -63,6 +63,7 @@ struct stack_record { > > u32 hash; /* Hash in the hastable */ > > u32 size; /* Number of frames in the stack */ > > union handle_parts handle; > > + refcount_t count; /* Number of the same repeated stacks */ > > This will increase stack_record size for every user, even if they don't > care about the count. Couldn't this be used for garbage collection? -- Michal Hocko SUSE Labs