From owner-freebsd-current@freebsd.org Wed Jan 3 22:23:09 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15626EB2A71 for ; Wed, 3 Jan 2018 22:23:09 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F32F269A53 for ; Wed, 3 Jan 2018 22:23:08 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from helicon.physics.ucla.edu (helicon.physics.ucla.edu [169.232.156.253]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w03MC1aq015857 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Wed, 3 Jan 2018 14:12:01 -0800 Subject: Re: Programmatically cache line To: freebsd-current@freebsd.org References: <20171230082812.GL1684@kib.kiev.ua> <08038E36-9679-4286-9083-FCEDD637ADCC@FreeBSD.org> <20180101103655.GF1684@kib.kiev.ua> From: Nathan Whitehorn Message-ID: <35d2d373-92f1-499f-f470-e4528b08b937@freebsd.org> Date: Wed, 3 Jan 2018 14:12:00 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVYa2bLoqrZ8FeaCaolfaddV2aKU8xyWiNOmaPGl9PjKbfMyZ3jh1TbpNDPmm1cbj41jSYmgCcv7GZbBf+yJUkMFxrnaQHnXdMo= X-Sonic-ID: C;DrNnH9Pw5xGmNUdJEUQrEw== M;4CeoH9Pw5xGmNUdJEUQrEw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jan 2018 22:23:09 -0000 On 01/03/18 13:37, Ed Schouten wrote: > 2018-01-01 11:36 GMT+01:00 Konstantin Belousov : >>>>> On x86, the CPUID instruction leaf 0x1 returns the information in >>>>> %ebx register. >>>> Hm, weird. Why don't we extend sysctl to include this info? >> For the same reason we do not provide a sysctl to add two integers. > I strongly agree with Kostik on this one. Why add stuff to the kernel, > if userspace is already capable of extracting this? Adding that stuff > to sysctl has the downside that it will effectively introduce yet > another FreeBSDism, whereas something generic already exists. > Well, kind of. The userspace version is platform-dependent and not always available: for example, on PPC, you can't do this from userland and we provide a sysctl machdep.cacheline_size to userland. It would be nice to have an MI API. -Nathan