Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Sep 2020 23:03:36 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        "Alexander V. Chernikov" <melifaro@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r364465 - in head/sys: conf net net/route
Message-ID:  <69399f59-4eca-ee29-7230-678a02cf6eff@FreeBSD.org>
In-Reply-To: <202008212134.07LLYq3K071532@repo.freebsd.org>
References:  <202008212134.07LLYq3K071532@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 22/08/2020 00:34, Alexander V. Chernikov wrote:
> Author: melifaro
> Date: Fri Aug 21 21:34:52 2020
> New Revision: 364465
> URL: https://svnweb.freebsd.org/changeset/base/364465
> 
> Log:
>   Make net.fibs growable.
>   
>   Allow to dynamically grow the amount of fibs in each vnet.
>   
>   This change alters current behavior. Currently, if one defines
>    ROUTETABLES > 1 in the kernel config, each vnet will be created
>    with the number of fibs defined in the kernel config.
>    After this commit vnets will be created with fibs=1.
>   
>   Dynamic net.fibs is not compatible with net.add_addr_allfibs.
>    The plan is to deprecate the latter and make
>    net.add_addr_allfibs=0 default behaviour.
>   
>   Reviewed by:	glebius
>   Relnotes:	yes
>   Differential Revision:	https://reviews.freebsd.org/D26062

I wonder why no one reported a problem that I am seeing after upgrading past
this revision.  Maybe because I do have net.fibs=2 in my loader.conf?

The problem -- unfortunately I only have a screenshot -- but it's a page fault
trap in this call chain:
sysctl_register_all -> sysctl_load_tunable_by_oid_locked -> sysctl_fibs ->
_sx_xlock.

The crash is on the RTABLES_LOCK() line.
And it's kind of obvious why.

The tunables, including net.fibs which is declared as RWTUN, are set at
SI_SUB_TUNABLES stage, but RTABLES_LOCK_INIT() is not called until
SI_SUB_PROTO_DOMAIN much later.  In other words, sysctal_fibs can be called
earlier than vnet_rtables_init.

I think that the best way to handle the problem would be to add CTLFLAG_NOFETCH
to the sysctl declaration and then to add -- if necessary at all -- an explicit
query of the kenv.


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69399f59-4eca-ee29-7230-678a02cf6eff>