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 691C4C433F5 for ; Wed, 15 Dec 2021 10:57:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D36126B0071; Wed, 15 Dec 2021 05:57:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CE6236B0073; Wed, 15 Dec 2021 05:57:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAD216B0074; Wed, 15 Dec 2021 05:57:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id AE3846B0071 for ; Wed, 15 Dec 2021 05:57:35 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 7C14274CFB for ; Wed, 15 Dec 2021 10:57:25 +0000 (UTC) X-FDA: 78919727250.23.923E059 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf02.hostedemail.com (Postfix) with ESMTP id CCCB780013 for ; Wed, 15 Dec 2021 10:57:22 +0000 (UTC) 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-out1.suse.de (Postfix) with ESMTPS id A86A2212BD; Wed, 15 Dec 2021 10:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1639565843; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=71KLsGFyTfHQmtWPtJva/8POSdqz59E3zDHvaoF0bPs=; b=s8379Nmjjoz5PcoEikeXUuWJGPh2bkhTRK5B3RBLYyazCCjPqTd49BJKTooAF3UDIZIQAF 2TIQP+P0+YL9og5NXAKSglGy53fGfEpiSb7mrLkwY4g2TkLrVAWd8NIHLfrLCmX/eLtIRP gy+wUXGeCXri1shkoWX8v7bcc0m8fp0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1639565843; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=71KLsGFyTfHQmtWPtJva/8POSdqz59E3zDHvaoF0bPs=; b=5RgxaosdupGJrj/duuEL79qM0V97LnqnfjHwVa5MKkfs3pakxxk9IOFrMDn/xPyJfz8PB7 cJOH6XeV0szWqIBQ== 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 857F813B1C; Wed, 15 Dec 2021 10:57:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id R2HWHxPKuWEDAgAAMHmgww (envelope-from ); Wed, 15 Dec 2021 10:57:23 +0000 Message-ID: <45c1b738-1a2f-5b5f-2f6d-86fab206d01c@suse.cz> Date: Wed, 15 Dec 2021 11:57:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v3 net-next 01/23] lib: add reference counting tracking infrastructure Content-Language: en-US To: Eric Dumazet , Jiri Slaby , Andrew Morton Cc: Eric Dumazet , "David S . Miller" , Jakub Kicinski , netdev , Dmitry Vyukov , "linux-mm@kvack.org" References: <20211205042217.982127-1-eric.dumazet@gmail.com> <20211205042217.982127-2-eric.dumazet@gmail.com> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: CCCB780013 X-Stat-Signature: ma6ou9qwqxmbmiutm4wckjxuoo68bxpb Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=s8379Nmj; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=5Rgxaosd; dmarc=none; spf=pass (imf02.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-HE-Tag: 1639565842-555101 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 12/15/21 11:41, Eric Dumazet wrote: > On Wed, Dec 15, 2021 at 2:38 AM Eric Dumazet wrote: >> >> On Wed, Dec 15, 2021 at 2:18 AM Jiri Slaby wrote: >> > >> > On 05. 12. 21, 5:21, Eric Dumazet wrote: >> > > From: Eric Dumazet >> > > >> > > It can be hard to track where references are taken and released. >> > > >> > > In networking, we have annoying issues at device or netns dismantles, >> > > and we had various proposals to ease root causing them. >> > ... >> > > --- a/lib/Kconfig >> > > +++ b/lib/Kconfig >> > > @@ -680,6 +680,11 @@ config STACK_HASH_ORDER >> > > Select the hash size as a power of 2 for the stackdepot hash table. >> > > Choose a lower value to reduce the memory impact. >> > > >> > > +config REF_TRACKER >> > > + bool >> > > + depends on STACKTRACE_SUPPORT >> > > + select STACKDEPOT >> > >> > Hi, >> > >> > I have to: >> > + select STACKDEPOT_ALWAYS_INIT >> > here. Otherwise I see this during boot: >> > >> >> Thanks, I am adding Vlastimil Babka to the CC >> >> This stuff has been added in >> commit e88cc9f5e2e7a5d28a1adf12615840fab4cbebfd >> Author: Vlastimil Babka >> Date: Tue Dec 14 21:50:42 2021 +0000 >> >> lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() >> >> > > (This is a problem because this patch is not yet in net-next, so I really do > not know how this issue should be handled) Looks like multiple new users of stackdepot start appearing as soon as I touch it :) The way we solved this with a new DRM user was Andrew adding a fixup to my patch referenced above, in his "after-next" section of mm tree. Should work here as well. ----8<---- >From 0fa1f25925c05f8c5c4f776913d84904fb4c03a1 Mon Sep 17 00:00:00 2001 From: Vlastimil Babka Date: Wed, 15 Dec 2021 11:52:10 +0100 Subject: [PATCH] lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() - fixup4 Due to 4e66934eaadc ("lib: add reference counting tracking infrastructure") landing recently to net-next adding a new stack depot user in lib/ref_tracker.c we need to add an appropriate call to stack_depot_init() there as well. Signed-off-by: Vlastimil Babka --- include/linux/ref_tracker.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/ref_tracker.h b/include/linux/ref_tracker.h index c11c9db5825c..60f3453be23e 100644 --- a/include/linux/ref_tracker.h +++ b/include/linux/ref_tracker.h @@ -4,6 +4,7 @@ #include #include #include +#include struct ref_tracker; @@ -26,6 +27,7 @@ static inline void ref_tracker_dir_init(struct ref_tracker_dir *dir, spin_lock_init(&dir->lock); dir->quarantine_avail = quarantine_count; refcount_set(&dir->untracked, 1); + stack_depot_init(); } void ref_tracker_dir_exit(struct ref_tracker_dir *dir); -- 2.34.1