From owner-freebsd-arch@freebsd.org Mon Nov 2 22:18:16 2020 Return-Path: Delivered-To: freebsd-arch@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 9D06045C96A for ; Mon, 2 Nov 2020 22:18:16 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from s2gw.ddhf.dk (s2gw.ddhf.dk [130.226.214.244]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CQ6kH12nmz45N2 for ; Mon, 2 Nov 2020 22:18:14 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by s2gw.ddhf.dk (Postfix) with ESMTPS id C16ABC3F3A; Mon, 2 Nov 2020 22:17:57 +0000 (UTC) Received: (from phk@localhost) by critter.freebsd.dk (8.16.1/8.16.1/Submit) id 0A2MI3ki053480; Mon, 2 Nov 2020 22:18:03 GMT (envelope-from phk) To: John-Mark Gurney cc: "Alexander V. Chernikov" , freebsd-arch Subject: Re: Versioning support for kernel<>userland sysctl interface In-reply-to: <20201102221330.GS31099@funkthat.com> From: "Poul-Henning Kamp" References: <356181604233241@mail.yandex.ru> <20201102221330.GS31099@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <53478.1604355483.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Mon, 02 Nov 2020 22:18:03 +0000 Message-ID: <53479.1604355483@critter.freebsd.dk> X-Rspamd-Queue-Id: 4CQ6kH12nmz45N2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of phk@critter.freebsd.dk designates 130.226.214.244 as permitted sender) smtp.mailfrom=phk@critter.freebsd.dk X-Spamd-Result: default: False [-2.54 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[phk]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.04)[-1.044]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.dk]; NEURAL_HAM_MEDIUM(-1.05)[-1.055]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.45)[-0.445]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:1835, ipnet:130.226.0.0/16, country:EU]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; MAILMAN_DEST(0.00)[freebsd-arch]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2020 22:18:16 -0000 -------- John-Mark Gurney writes: > Alexander V. Chernikov wrote this message on Sun, Nov 01, 2020 at 12:47 = +0000 > : > > I would like to propose a change [1] that introduces versioning suppor= t for > the data structures exposed to userland by sysctl interface. > > = > > We have dozens of interfaces exposing various statistics and control d= ata b > y filling in and exporting structures. > > net.inet6.icmp6.stats or net.inet6.icmp6.nd6_prlist can be a good exam= ples = > of such interaction. > > We also need to decide the policy on dealing w/ support for these > data structures going forward... Because if we do the simple, default > policy of all userland apps can handle all structures, and kernel can > produce all structures, we now have an unbounded growth of complexity > and testing... Seriously... We should stop exporting binary structures precisely because they give us all this trouble to deal with in the first place. It is cheaper, in terms of source lines, developer effort, code, bugs, and= = documentation to marshal these data into a defined format in the kernel and export that same format on all archs & versions. For data which seldomly changes, I will argue the format should be ascii. See also: 18 year old kernl.geom.conf{txt|xml|dot} Statistics data and other high-frequency-change data, should be exported via mmap(2), so that frequency of interrogation does not cause more system calls on the system. See also: gstat(8), after pressing '<' a number of times. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .