From owner-svn-src-all@freebsd.org Tue Sep 8 21:50:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F01213D9589; Tue, 8 Sep 2020 21:50:40 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward501j.mail.yandex.net (forward501j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmJjr4314z4WG3; Tue, 8 Sep 2020 21:50:40 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback27j.mail.yandex.net (mxback27j.mail.yandex.net [IPv6:2a02:6b8:0:1619::227]) by forward501j.mail.yandex.net (Yandex) with ESMTP id D15AB33809BD; Wed, 9 Sep 2020 00:50:35 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback27j.mail.yandex.net (mxback/Yandex) with ESMTP id Llu186fslX-oZiWSO7e; Wed, 09 Sep 2020 00:50:35 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1599601835; bh=BKHwrlVKrCu96HS+5btyCR1X7NYYjjdlN5lJ0m/Fl9g=; h=Message-Id:Subject:In-Reply-To:Date:References:To:From; b=i+3OqUN2vaXQBBPxQrMCLpcHpYdpz8tuV2Oom7kt56MWlXOUQ4yawH2FvMUpdF8AC SVZleqBEP9cZ+PdgJ/Nd/jkrDUuAVzyeIJplwzjbJah2od/88fjb+5uH2X9DvwyK5m vTU04A88vgEwun0JGNero3vQz+/C34FdzzF3unQg= Received: by sas8-75f070ddfcf3.qloud-c.yandex.net with HTTP; Wed, 09 Sep 2020 00:50:34 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <69399f59-4eca-ee29-7230-678a02cf6eff@FreeBSD.org> References: <202008212134.07LLYq3K071532@repo.freebsd.org> <69399f59-4eca-ee29-7230-678a02cf6eff@FreeBSD.org> Subject: Re: svn commit: r364465 - in head/sys: conf net net/route MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 08 Sep 2020 22:50:34 +0100 Message-Id: <93541599601730@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 4BmJjr4314z4WG3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2020 21:50:41 -0000 08.09.2020, 21:03, "Andriy Gapon" : > 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 :-( > 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