From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796552746; b=QW2tZr0pL+wYrURhWa4rTrsKtROt2BJRS/xzsQDBTzOGCqMm11pVgs15964yN6ZvRppA xDYKxq1fkWNT3mrqF2TCFe49Y/ufo3M6wI6xG/dNf8+Ag1p29IBKg6hsGvUAnWmoh7lzT A82naJ6VxNuEK55krBGE7FHFl9kIhTxMthv9TlwcBWB71lhaSE+h67QtPyL/bar3LLVNX cvgVX2gaXEyW2Ug1UM+6NENBOuxaMQBAgkmo20wZFEez+a00cLL2YkDilDy3rxTgH/FPp gTniKg35qZ7+6GD+qP3KwkjmUcU/MmlIsPA59R7Pn0T4VMwITaAtJICL8wMZRzDfYqg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796552746; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Rspamd-Queue-Id; bh=x9MK8B4uwtV1tNc/zVEwJCmWHIRurGr2gI6qDCA1pRk=; b=Pj3VYl+aLENZzvHSENlupuKOvSLCaHyU/FGh8HuGtPQHLhi2OWOyG3ZUC+mP5dRXvG2+ MrNognO+N/afqJXpUbWIWCxfDH/5WP4N8aLp0BTLtQBB0c9k4GTLrPFfATlJCgPJAlHJt gtbPqHsF60meJ2L0ckxAbx4ttz89e2h3JFuTU+YiwwRmZhM4et0OUF5DTIRrBafMf6fQt 49JWsyhLkmhNXERen4svpKc6PLq4zYQpyH8OlN68K+iedvZ+bJuYSz551zZznLV+aIEkj T4dv2TVZY0wxcGtS/wr/vLwhBHMWlX/hrvbUCqbvL8EKcA/lN1axrwVDpOH+asZvsoQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=mandelbit.com; spf=pass smtp.mailfrom=mandelbit.com; dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=ztPwG8kx; arc=none smtp.remote-ip=195.10.208.47 Received: from mout-b-107.mailbox.org (mout-b-107.mailbox.org [195.10.208.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55A0B606A31F; Sun, 6 Dec 2026 10:25:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 55A0B606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=ztPwG8kx Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-107.mailbox.org (Postfix) with ESMTPS id 4jj1bB5ZT2z3xTD; Sun, 06 Dec 2026 11:25:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1796552742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=x9MK8B4uwtV1tNc/zVEwJCmWHIRurGr2gI6qDCA1pRk=; b=ztPwG8kxoUplODqx8luv1BcgaWbh1+Fm0TJHlWy4cv2SpHU+V3CNH30K1xrrLrQ8xpCQ5U 1wqasA7nUj0Mep8DMIjK08K/nb4IKqjS+RmuoxX11BOxLbRxQidzV06WXDaAJmKfSc2MQ0 j5aJSE16n6P3DBhBrkpMQfzJflce1QsXJ3K0BVQRPR6ipFd62ACqDBu/lbweoPfEJCr1TY l2YiJKtbCtUVn6RFRKnN94ipKC52V/Dl8HKLr59nD+kULUAiXvOSThYxRjzod3yBUZTQKh DnF9HiBuLvjiW/FDen05jjNs/bmGCzjiEN3QENRx9LXIKgY/t6mSALaYhLbY2A== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of ralf@mandelbit.com designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=ralf@mandelbit.com From: Ralf Lici To: netdev-bot+sashiko@kernel.org Cc: netdev@vger.kernel.org, dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, linux-kernel@vger.kernel.org, antonio@mandelbit.com Subject: Re: [PATCH net-next 2/2] ipv6: allocate the flush serial under each table's lock Date: Sun, 6 Dec 2026 11:25:32 +0100 Message-ID: <20261206102533.195090-1-ralf@mandelbit.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <179647124393.3146.12155290401829441082@kernel.org> References: <97a514831d146250ac95222f55ee5a9334b624d1.1796382778.git.ralf@mandelbit.com> <179647124393.3146.12155290401829441082@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4jj1bB5ZT2z3xTD On Sat, 05 Dec 2026 11:47:23 +0000, netdev-bot+sashiko@kernel.org wrote: > > diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c > > --- a/net/ipv6/ip6_fib.c > > +++ b/net/ipv6/ip6_fib.c > > @@ -2344,8 +2347,10 @@ static void __fib6_clean_all(struct net *net, > > head = &net->ipv6.fib_table_hash[h]; > > hlist_for_each_entry_rcu(table, head, tb6_hlist) { > > spin_lock_bh(&table->tb6_lock); > > - fib6_clean_tree(net, &table->tb6_root, > > - func, sernum, arg, skip_notify); > > + if (sernum == FIB6_NEW_SERNUM) > > + table_sn = fib6_new_sernum(net); > > + fib6_clean_tree(net, &table->tb6_root, func, > > + table_sn, arg, skip_notify); > > spin_unlock_bh(&table->tb6_lock); > > } > > } > > [Severity: Medium] > This now advances net->ipv6.fib6_sernum once per table in > fib_table_hash, where before it advanced once per flush. That counter > is not only used for node stamps. rt_genid_ipv6() returns it directly, > and nexthop-backed routes (f6i->nh != NULL) record it in > pcpu_rt->sernum in ip6_rt_pcpu_alloc(). rt6_is_valid() then checks it > with exact equality. > > So a single fib6_flush_trees() call can now invalidate every > nexthop-backed dst up to T times, with a full fib6_clean_tree() walk > between each bump. > Only lookups that run while the walk is in progress see the extra advances. Holders check their dst lazily, so each one is invalidated once per flush, and a lookup after the flush builds a dst that stays valid. > Could the per-table allocation be skipped for tables that have nothing > to stamp? Alternatively, fib6_flush_trees() could keep a single serial > and have fib6_clean_node() leave alone nodes that already carry a > newer one, once the age comparison lands later in the series. Either > way, it would be good to mention the effect on nexthop dsts in the > changelog. Sashiko's second suggestion needs comparing serials by age, which the follow-up series using these serials introduces, so I can switch to that there if the per-table advance turns out to matter. -- Ralf Lici Mandelbit Srl