Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Sep 2020 09:13:45 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        "Alexander V. Chernikov" <melifaro@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r364465 - in head/sys: conf net net/route
Message-ID:  <05bfa3f4-8c95-3ad4-80b5-c5e48cd6370d@FreeBSD.org>
In-Reply-To: <93541599601730@mail.yandex.ru>
References:  <202008212134.07LLYq3K071532@repo.freebsd.org> <69399f59-4eca-ee29-7230-678a02cf6eff@FreeBSD.org> <93541599601730@mail.yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On 09/09/2020 00:50, Alexander V. Chernikov wrote:
> 08.09.2020, 21:03, "Andriy Gapon" <avg@freebsd.org>:
>> 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?
> Hi Andriy,
> 
> Does r365475 fix the problem for you?
> CTLFLAG_RWTUN flag got slipped through the cracks somewhere :-(

I am not sure that it does, I haven't tried it, but I agree with Ryan's comment.
In general, I would keep CTLFLAG_RWTUN as the knob is a tunable indeed and some
tools query that flag.
So, I would like to re-iterate my earlier suggestion to use CTLFLAG_NOFETCH
paired with explicit TUNABLE_INT_FETCH (which seems to be there already).

>> 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


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?05bfa3f4-8c95-3ad4-80b5-c5e48cd6370d>