From owner-freebsd-current@FreeBSD.ORG Sat Nov 20 09:54:07 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A163106566B; Sat, 20 Nov 2010 09:54:07 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 468148FC12; Sat, 20 Nov 2010 09:54:05 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA26809; Sat, 20 Nov 2010 11:54:02 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PJk8v-0000hl-V6; Sat, 20 Nov 2010 11:54:01 +0200 Message-ID: <4CE79AB9.1020303@freebsd.org> Date: Sat, 20 Nov 2010 11:54:01 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Nate Lawson References: <4CE29718.2050508@freebsd.org> <4CE51CDA.6010202@freebsd.org> <4CE533DE.7010401@freebsd.org> <4CE68C0B.1080007@freebsd.org> <4CE6CB3E.70009@root.org> In-Reply-To: <4CE6CB3E.70009@root.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@freebsd.org, freebsd-current@freebsd.org Subject: Re: aperf/mperf X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 20 Nov 2010 09:54:07 -0000 on 19/11/2010 21:08 Nate Lawson said the following: > On 11/19/2010 6:39 AM, Andriy Gapon wrote: >> >> I am thinking about providing two APIs for this. >> >> 1. KPI >> void cpu_get_a_m_perf(u_int cpu, uint64_t *aperf, uint64_t *mperf); >> >> 2. Userland >> sysctl dev.cpu.N.aperf_mperf that returns two UQUAD values. >> >> But I am not sure where to put the code for both APIs. >> Adding another device under cpu seems like an overkill. > > These can be exported as a common interface from cpufreq > (dev,cpu.X.perf_stats) and supplied by the child acpi_perf driver on > each cpu. This suggestion sounds quite appealing. But I have some concerns. What if hardware has the capability, but there is no cpufreq - could these MSRs be still useful? Or are they useful only with cpufreq? Probably the latter... Then, another exotic case - if a driver like est or hwpstate is attached "directly", i.e. there is no acpi_perf/_PSS - would the MSRs be still useful? Not sure. -- Andriy Gapon