From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.43.24 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796566674; b=a/TF8ShbQ90j+//puEogh+bHfFWHgpfJLRhGHrmWGx68OcQOuJ87ZZxBVEII5YpJHGqe CpRqI27cG9LoFh3KRahYV+dhENpMjehhXu4MAw/tnWJ5A7x+oiqwCzCGVbHKlktSr4Po2 ZhbbPcgjqaVVCD5KLzyJnT6v60hggHdW5XgRf6vi4GY4XUourW21BDCZKRo6QhxjHfiFw WeL1BkTw5d4wd9rEDdCp2h4QyK4LCcHRarY5RkgrW4L6hSAJim458L4+zxUshoj+GHSbE B+7xAJZORZHfDRE8qVJQI+3JYkE5vhREw4/TUFZlqqUnB8akNppejiZXBdZ93e0D1xQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796566674; h=DMARC-Filter:DKIM-Signature:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:Content-Type:Content-Disposition: In-Reply-To:X-ClientProxiedBy:MIME-Version:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=NF16mD9eSM8F9WImMPGxjgI766DuwLiHVz5Vw2XAGRA=; b=pKBPwNbxgDDQhesC3wDU8wAx83KOmZ52Elz9Wy8wcWXc//ANpJH6SBmrYVRX+XGshpq7 k5yhm4stqDq8yzFTp1NQI46/KuvfClRYO7BsMw/N8Op/S+gxHCqwsforA6nBLXr+mxjUY iPEaysq523YFBcIOLQ3KjVFo+56Ladysfb9nb41Eq3fcSG0qqfGxLFakGyCd87q+d5B1v T4tldn/EfkbllitWuqHRs8ftF/ML0uLmr2A19uCT+4Ue3cufApqWF66w9HEiUOT/QPW32 f5839+UrbKRRW5/NPeMdcMyaUrSP2rAEtLheqYRGG+4JrzCYmRqop0RUuW7NJrAmVqg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b="tYxs2vQ/"; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.43.24 Received: from SJ2PR03CU001.outbound.protection.outlook.com (mail-westusazon11012024.outbound.protection.outlook.com [52.101.43.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C2AE606A31F for ; Sun, 6 Dec 2026 14:17:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4C2AE606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=tYxs2vQ/ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=E4q/RzvQKb7Hc6AHACEvutY/xaM1CMXIvgvxdgar5EtItMN/5Sg0Kmh67Xbwxze9TdXhQThZKR2BHlPebg0wWhuWJCgJgUMvV4GHmjkPzw2qUH42rczX/JNrQmIfBAsgfHgXMFtuSTY4b77AmMv44KE83s04JkGVLzz9DvF9o84WlsxXU5L+zDj1Vl2XAZf5ENJl/ZJEQqm4uxhrNULmMavbz97dQ473RuuI/juYzretlmPfctr3VKhmt/hDZQ3wrJHgsjEMhfP0dyKHiwldeM76+zjQgvL4zgyhf0BLSodHUNscnCRMa62DSzAICgUiZFmN/tX7nalwNJkrxxph0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NF16mD9eSM8F9WImMPGxjgI766DuwLiHVz5Vw2XAGRA=; b=gtqwGw4m17aHejPZqyOdtyZ7v1/bKB3+Kc0J/TrxNeBcD4POVU4MmB8dGGzUBl4RpIvNj/O4C69Ik80akLzDnAxVyFHum6K6OZf7uoZAkZvUm5BNn71p11FI+1A2hTICS7AiKqNoxEzkjoSJOHC6YGERIr0WAiuWZYAgboHIhzd2kasitrAPhBSZVw+avSr2Arq3yr9HUuPHlNiwO0MnFLEgYEmKulom/O8vPXDwkVtZJ2v3aaNglBLRp8/OrwhKfvZUI2CMAXZ2DIzFJZZ8tmJsD3Vp5BL/aZNqksGdGcEfG9cgHU/skia17Ht2th79B0wvT+RrPYOwJfPz0mf0aA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NF16mD9eSM8F9WImMPGxjgI766DuwLiHVz5Vw2XAGRA=; b=tYxs2vQ/ai1VLebw6QaT2LHZuNl71+oWqEzIPu5RrLKh2nSvmXnw9FGkdPPun1wrEF+NH1jBWycg2+JE/vf/0a5uNbBD+NdPyhxycnpxjCA9b/Fu4/dQXHJ2fjejWczI2GU5x7HWvTMH3pjfvjNbQo9S4BARepXfzwNcHqTrKski0xFZG8zJHdKDPLvNq6oH9yIa5y0Oyu86P4qIAmPEcW9lLEQKBFQSnOZyO+M5N6/jYoWpRpMHYZ8dkrf438EPcnNajlSgySCmC0Pb76FRQbae5Y1qW7B89RHhc4c5PykE+e2Ux1Fw404DfIysDWk1NH+Hr/sX+zuIEholJGJsmQ== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV8PR12MB9407.namprd12.prod.outlook.com (2603:10b6:408:1f9::13) by SJ5PPFEB07C8E34.namprd12.prod.outlook.com (2603:10b6:a0f:fc02::9a8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.639.12; Sun, 6 Dec 2026 14:17:47 +0000 Received: from LV8PR12MB9407.namprd12.prod.outlook.com ([fe80::208b:424e:47e9:8a96]) by LV8PR12MB9407.namprd12.prod.outlook.com ([fe80::208b:424e:47e9:8a96%4]) with mapi id 15.21.0688.013; Sun, 6 Dec 2026 14:17:46 +0000 Date: Sun, 6 Dec 2026 16:17:38 +0200 From: Ido Schimmel To: Ren Wei Cc: netdev@vger.kernel.org, dsahern@kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, vega@nebusec.ai, caoruide123@gmail.com Subject: Re: [PATCH net 1/1] inetpeer: bound the peer cache across network namespaces Message-ID: <20261206141738.GA106118@shredder> References: <56dff40001dac2b78e4d53ff9cdf5991751823bf.1795767225.git.caoruide123@gmail.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56dff40001dac2b78e4d53ff9cdf5991751823bf.1795767225.git.caoruide123@gmail.com> X-ClientProxiedBy: TL0P290CA0015.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:5::7) To LV8PR12MB9407.namprd12.prod.outlook.com (2603:10b6:408:1f9::13) X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV8PR12MB9407:EE_|SJ5PPFEB07C8E34:EE_ X-MS-Office365-Filtering-Correlation-Id: 93fe230a-fea3-4b7d-5420-08df53a3b378 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|23010399003|366016|260925022911599003|261026121527099003|261028144727099003|56012099006|261022105027099003|260925021911599003|4143699003|261021123027099003|260925021311599003|261021135927099003|10067099003|261026140227099003|11063799006|261021121427099003|18002099003|261022075727099003|22082099003|261102123227099003|3023799007|261009223027099003; X-Microsoft-Antispam-Message-Info: lF8wgjqm2WcRMFt2ZSi2TN8+ZNxOwfjugX1CkEKPAN3zPxfcoxX4uVjlWHQhDSPx1tOFTvzY6niMFgaAO7E1RubzCVwLvIWcT1eXrgmzCDQehMpE0QMP5aUrbmFzDgf8uJZkf5NQzMKCDHBlb96gEOLKhgYl5AQUCY2q1KT3oBoxVaAwp8KrjJ/8FuOnD/R1pm0gPJDwr7ZMdhKCtk4W70SQWc+46ZrlTx6NVTIx6wVUl/du5Ro4RRn15Q8rCBOSVxQyCpK9NisS7YZSgDzhuhnLevA9OLDonR/wNf7N/JrSb7PQ4Vf41q6ZJEbyqJLf+/2arsnCb7nkNwNXMZgCqygePbr2No8Hux4hkRDKM5OemtsFUDrT/QOZZTJbf+V9+ERYVK3+JRWmVKi3gapt4oo5pqYqMs/CTuvLqd2igERLTVFRy3fOEtEVXIg5IyXdxfuSdt7WHZAGBy8oUdUiZU5FYvjss8FPqqsbP52IYmUTg0+MVr/oIDM973sumGnwee7PD2LEKKWv0y8zqqYPW75uUxGr/BOhCsl4P6Yjn2ehtQX38oRSVeGa2Cz/1KyKdjtLu4HwPvxHlRWSnN4twlBYzsPt13j4fd4EkntWuYleKtVu+Bg/mgpfJ8stpuUOXY+in5q+U55WsV3HBCIMq5OHZ4gTJSSPbZTkQ/0X7Yo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV8PR12MB9407.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(376014)(23010399003)(366016)(260925022911599003)(261026121527099003)(261028144727099003)(56012099006)(261022105027099003)(260925021911599003)(4143699003)(261021123027099003)(260925021311599003)(261021135927099003)(10067099003)(261026140227099003)(11063799006)(261021121427099003)(18002099003)(261022075727099003)(22082099003)(261102123227099003)(3023799007)(261009223027099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?PJyFIACpNsTvuJ/F/J2YqOTpzHmlJ6XogEiTZR5xwPIl1jN/x4l5pgYDtCYT?= =?us-ascii?Q?4Vrl4dQB/VOMgCYgFtOjL8gJCKpVFtzWnKfQsbgdyWKDVykR/jlQ5lexP5ND?= =?us-ascii?Q?ScD7u0MaFPdJRR6ZP5vK7IUE60AT3VO07aGP6qoHXO/ZBpY/8QKIWz+x/OKJ?= =?us-ascii?Q?OsPBNhDp4xtQ8stK8NLNiVj02xKaQla9IriTRdbTQ/1amUlaxrchxzpaWKVz?= =?us-ascii?Q?JrQJFE9npKcaeH3QxlHE0/vTelYZcbJdGqB+i3K2/td155nE5AxalOLQM2V6?= =?us-ascii?Q?+MOHEjR9S7RxYxphhVmiYO6KqpK0UNdqWffeVck7rcK77ID03yi9E8H49/+D?= =?us-ascii?Q?GneogTuzhu+OrocAkZG++j1MHelrOr0VPofrPkvm2fMGJMOVVsijvDcnN6Br?= =?us-ascii?Q?ppLkFacF3X76cxU+XJCKrsyfLzS7h/fjLnTB3+k6eiH4if6J8RtvNaKSo5L5?= =?us-ascii?Q?jwtopJLg2kwDSGe555Pwnh+2nM5/AiKt1anhrT3TCOOgHQ/eJUuyPYXoV8pP?= =?us-ascii?Q?cGssClP0DUVXLSvLDC8VBcJlMV0ziaKXM3agX8OUodBIEiDL+3Qoe1Lkjgh5?= =?us-ascii?Q?ZibildWvvqsfUpqMpZilii64Ptbzp4wrBNsD7Nfcr02sZIrkc7N3ITKyQlE+?= =?us-ascii?Q?mWi/n24zW9fCNPjLYvBMS5qtL/hj2/r7gBcQsrgvAGOFz8CR4iP6WNHN0JfQ?= =?us-ascii?Q?rrKDRKY71kHxBxhkXpI2/Mz42fWfrJyQsp0xsn/OD9gE1uU3Uhh0/egSqthF?= =?us-ascii?Q?w1F5OElA4GbR+OZ93UPnyjJheavsclIx5/wr5ZriPDTWG4XV0WK/hPMuIIs3?= =?us-ascii?Q?YwEf7xQzlgAUB8jbluol4SMj1Qx1oZIXTyt5HvKq8CMXXSIEZn35yzITkHD6?= =?us-ascii?Q?DfJfoHs5RFoQrDyuKpldZYmtfqcvzgfzO7+OcYpZ6eFfEQHynX2+MjoM3cCY?= =?us-ascii?Q?Yy3fdEY57WsRbImyX/OiO0lVo6YOo3pRfmINhpKUU4+TGzAPCRWuF+uQx5o/?= =?us-ascii?Q?uYT1hS/Vmm/7ImacG20/pu3t39scm/pc1YJ/Jc76Sd9DE4ztbIyvSPm1Y6jb?= =?us-ascii?Q?DZMgNbWLwDvUmFhaYw4r48GOMhGiLmopQ3qsFywx12LOMF7ws0ZM8WN0esLN?= =?us-ascii?Q?rzgNnlG+Ixv+5XTQLdqZKdsdCrUnXiBLihdHhchYw6x6J55wnAiQoFFWKfOY?= =?us-ascii?Q?feI/yHqazdkganxFCLukNmvOgZkI6T2CcMPGZD0vVsGCDPxg2ZgYPWkNcC8l?= =?us-ascii?Q?EpfLX6mq27wRCTzEx9S/0Yhkr3e3IzMp7+CNq/JhmehJRdDzlauAiX/KBoM2?= =?us-ascii?Q?swRwu6EkARd2R4mztegqCM/AFixN+3ctMIGT+9wnS5V2svHy7kWUH+qjT/9Q?= =?us-ascii?Q?AmzK+1RLlxLfh0rjPT9bZ3efVGMAgY9kerJHy9zWvj9gQj+vIHXJfk9GAJ6/?= =?us-ascii?Q?udNKubRhYwKDC7LuCODmq6j37/hllN+ZumelZZJJLAFt1HntjrtMfk6aSMQ1?= =?us-ascii?Q?KKYjVjPWf3Q5ql2CHYrubK3We5ZIuGixFrFqW8yMatOjgUL5ofqIB2ANSz/y?= =?us-ascii?Q?qISPXmP9tPg6p3CyXPS0pyJnl5076G3QQ8dqJmd/i65lPSTZAQrySe6GOo+F?= =?us-ascii?Q?LCjwRR25zz1FEFKf2ZgD447hWscq8l5nzQ9HTCTCMdFZwesG+cLXJ7nio2mW?= =?us-ascii?Q?oHu7YACB7QsiWTvy6dGQohm3MINJLerd7MwkKP3xQ4WNXxgq?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93fe230a-fea3-4b7d-5420-08df53a3b378 X-MS-Exchange-CrossTenant-AuthSource: LV8PR12MB9407.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2026 14:17:46.8250 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: E1YbkWgRsvg1vEUkOt/rUPCW5Dsk8AoTpscRCFurDYAb8SJ+vzThF+zB7vNWyVjjB/DiNH0tMm6/wVYErpnaqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ5PPFEB07C8E34 On Wed, Dec 02, 2026 at 02:08:59PM +0800, Ren Wei wrote: > net/ipv4/inetpeer.c | 26 +++++++++++++++++++++++--- > 1 file changed, 23 insertions(+), 3 deletions(-) > > diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c > index adf6dc8a95b4..06c26dc3ff04 100644 > --- a/net/ipv4/inetpeer.c > +++ b/net/ipv4/inetpeer.c > @@ -44,7 +44,7 @@ > * 1. Nodes may appear in the tree only with the pool lock held. > * 2. Nodes may disappear from the tree only with the pool lock held > * AND reference count being 0. > - * 3. Global variable peer_total is modified under the pool lock. > + * 3. Global variable peer_total is modified atomically. > * 4. struct inet_peer fields modification: > * rb_node: pool lock > * refcnt: atomically against modifications on other CPU; > @@ -53,6 +53,7 @@ > */ > > static struct kmem_cache *peer_cachep __ro_after_init; > +static atomic_t peer_total; > static siphash_aligned_key_t inetpeer_hash_key __read_mostly; > > static u64 inetpeer_addr_hash(const struct inetpeer_addr *a) > @@ -97,6 +98,20 @@ int inet_peer_threshold __read_mostly; /* start to throw entries more > int inet_peer_minttl __read_mostly = 120 * HZ; /* TTL under high load: 120 sec */ > int inet_peer_maxttl __read_mostly = 10 * 60 * HZ; /* usual time to live: 10 min */ > > +static bool inet_peer_try_alloc(void) > +{ > + int threshold, total; > + > + threshold = READ_ONCE(inet_peer_threshold); > + total = atomic_read(&peer_total); > + do { > + if (total >= threshold) > + return false; > + } while (!atomic_try_cmpxchg(&peer_total, &total, total + 1)); > + > + return true; > +} > + > /* Called from ip_output.c:ip_init */ > void __init inet_initpeers(void) > { > @@ -108,7 +123,8 @@ void __init inet_initpeers(void) > > inet_peer_threshold = clamp_val(nr_entries, 4096, 65536 + 128); > > - peer_cachep = KMEM_CACHE(inet_peer, SLAB_HWCACHE_ALIGN | SLAB_PANIC); > + peer_cachep = KMEM_CACHE(inet_peer, > + SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT); Allocations are from softirq context, so I'm quite sure they are not charged correctly. > } > > /* Called with rcu_read_lock() or base->lock held */ > @@ -190,6 +206,7 @@ static void inet_peer_gc(struct inet_peer_base *base, > if (p) { > rb_erase(&p->rb_node, &base->rb_root); > base->total--; > + atomic_dec(&peer_total); > kfree_rcu(p, rcu); > } > } > @@ -222,7 +239,7 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base, > > gc_cnt = 0; > p = lookup(daddr, dhash, base, seq, gc_stack, &gc_cnt, &parent, &pp); > - if (!p) { > + if (!p && inet_peer_try_alloc()) { I believe that Sashiko is correct and this can lead to one netns starving others: " Can one network namespace permanently starve all other namespaces of inet_peer entries once it fills peer_total to inet_peer_threshold and goes idle? Garbage collection only runs on the caller's own base tree during a cache miss in inet_getpeer(), or when a namespace is destroyed. If one namespace fills the global peer_total budget and then stops experiencing lookup misses, its entries are never reclaimed even after inet_peer_maxttl expires. Lookup misses in other namespaces (including init_net) will fail inet_peer_try_alloc() and can only run inet_peer_gc() on their own trees, causing inet_getpeer() to return NULL indefinitely and disabling per-peer ICMP rate limiting, IPv4 fragment max_dist checks, and ICMP redirects in those namespaces. In addition, calling inet_peer_try_alloc() before inet_peer_gc() means a miss when peer_total == inet_peer_threshold fails immediately even when lookup() collected expired entries in gc_stack that inet_peer_gc() is about to free. " https://sashiko.dev/#/patchset/cover.1795767225.git.caoruide123%40gmail.com > p = kmem_cache_alloc(peer_cachep, GFP_ATOMIC); A better approach would be to charge the peer allocations to the cgroup the netns is charged to by passing __GFP_ACCOUNT, preceded by set_active_memcg(). I suggest targeting this at net-next, similar to other GFP_ACCOUNT annotations, such as commit 6126891c6d4f ("memcg: enable accounting for IP address and routing-related objects"). pw-bot: cr > if (p) { > p->daddr = *daddr; > @@ -241,6 +258,8 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base, > rb_link_node(&p->rb_node, parent, pp); > rb_insert_color(&p->rb_node, &base->rb_root); > base->total++; > + } else { > + atomic_dec(&peer_total); > } > } > if (gc_cnt) > @@ -309,6 +328,7 @@ void inetpeer_invalidate_tree(struct inet_peer_base *base) > > p = rb_next(p); > rb_erase(&peer->rb_node, &base->rb_root); > + atomic_dec(&peer_total); > inet_putpeer(peer); > cond_resched(); > } > -- > 2.47.3 >