From owner-svn-src-head@freebsd.org Wed Sep 9 21:47:40 2020 Return-Path: Delivered-To: svn-src-head@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 3E9B63DDE53; Wed, 9 Sep 2020 21:47: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 4Bmwbv4s5Xz3fXK; Wed, 9 Sep 2020 21:47:39 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward501j.mail.yandex.net (Yandex) with ESMTP id 37F113380EA6; Thu, 10 Sep 2020 00:47:35 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback9o.mail.yandex.net (mxback/Yandex) with ESMTP id nGAiy4Tsmb-lYomNl7C; Thu, 10 Sep 2020 00:47:34 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1599688054; bh=BmVqQBEvR+5oLo+X6GlbVigmqQqsEpuroDSDEw+r3z8=; h=Message-Id:Subject:In-Reply-To:Date:References:To:From; b=syK3GVKQ/b+kxhbrCIfEtJliqPL64D4Ytii7IcEGGNhYqvlV0kF8Fs/vVeUVFw2Er WMk1K23U3CKWXAP8WFjTi0YcA3e8fL6J2Kn67u+BpDyudjnAKyMG9ANZOjK8utV/pf HqtdqKeVlLj3xoSexkt4zQS4NntWOWZbZJF4D+ow= Received: by sas8-75f070ddfcf3.qloud-c.yandex.net with HTTP; Thu, 10 Sep 2020 00:47: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: <05bfa3f4-8c95-3ad4-80b5-c5e48cd6370d@FreeBSD.org> References: <202008212134.07LLYq3K071532@repo.freebsd.org> <69399f59-4eca-ee29-7230-678a02cf6eff@FreeBSD.org> <93541599601730@mail.yandex.ru> <05bfa3f4-8c95-3ad4-80b5-c5e48cd6370d@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: Wed, 09 Sep 2020 22:47:34 +0100 Message-Id: <74621599687936@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 4Bmwbv4s5Xz3fXK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 21:47:40 -0000 09.09.2020, 07:13, "Andriy Gapon" : > On 09/09/2020 00:50, Alexander V. Chernikov wrote: >>  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 :-( > > I am not sure that it does, I haven't tried it, but I agree with Ryan's comment. It should. > In general, I would keep CTLFLAG_RWTUN as the knob is a tunable indeed and some > tools query that flag. Thanks for the suggestion, I've updated the params to include CTLFLAG_NOFETCH in r365517. > 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