From owner-freebsd-arch@FreeBSD.ORG Sun Jun 30 19:20:40 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) by hub.freebsd.org (Postfix) with ESMTP id D92E39F4 for ; Sun, 30 Jun 2013 19:20:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 249F320CE; Sun, 30 Jun 2013 19:20:39 +0000 (UTC) Message-ID: <51D0845C.7060508@FreeBSD.org> Date: Sun, 30 Jun 2013 23:17:48 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: [RFC] Migrate network statistics to PCPU counters References: <51CFFE71.9080802@FreeBSD.org> <20130630175357.GJ91021@kib.kiev.ua> In-Reply-To: <20130630175357.GJ91021@kib.kiev.ua> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 19:20:40 -0000 On 30.06.2013 21:53, Konstantin Belousov wrote: >> The second part of patches adds several helper macros to sys/counter.h >> and net/vnet.h. The main idea is that we declare array of counter_u64_t >> with number of elements equal to number of uint64_t elements in the >> stats structure and use offsetof() to get access to needed counter. In >> the same time, the stats structure used as interface with userland. > Only reacting to the last sentence. > > I think this is notoriously bad, the in-kernel interfaces and usermode ABI > should be split. The reuse of the structures for kernel and for interfacing > to usermode is the reason why we cannot ensure the stability of the > management ABI even on stable. > > I suggest to not doing this, instead having the dedicated definitions for > user mode, and also to add padding to the usermode interface for future > extensions. Actually each structure described above only used in the userland. In the kernel we use arrays of counters and do fetch values for each PCPU counter, then copy them into userland via stats structures. -- WBR, Andrey V. Elsukov