From owner-freebsd-stable@FreeBSD.ORG Sat Jun 9 20:32:31 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 76B40106566C for ; Sat, 9 Jun 2012 20:32:31 +0000 (UTC) (envelope-from thciobanu@nth.ro) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx1.freebsd.org (Postfix) with ESMTP id E456C8FC1B for ; Sat, 9 Jun 2012 20:32:30 +0000 (UTC) Received: by wibhn6 with SMTP id hn6so1345683wib.13 for ; Sat, 09 Jun 2012 13:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nth.ro; s=ga; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=aKDGHDzsHqSGoc52/tLIxb6tI1SGtOC5A7R2HVzJN3I=; b=lIESaXaKO64zHjeWqdWGg76N9iQhQX/ty07xkxfkfXM/JG6PDCknI4HS9jn8TdTWx3 /VqwQiIUjaWs3OzZRfhcp/TSj4jbqEuGYR9LG3RaTMSzoN4a/kjtN8HiKfCRYrUeScXC sGvSLJtn4YnjwWCkYUdf9JyhNvgVIjhDhsV/g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=aKDGHDzsHqSGoc52/tLIxb6tI1SGtOC5A7R2HVzJN3I=; b=FQ25HkEdiUeobE30tibUEShfCSDkUgaF781JryW/ndG27M1rLAPUs9dmnaHqsYNM4r hDNmEvozw3HG6eApUnoEL2vpKM88mxtTjxCrHenFUBNjXiV5vp8IjCH/RrUsXlr5V6bC 2/w8WAyusJopHb4AxaeI7goq7eqj5MFQPcCtVLvqU5DOEeZz0aiWpDvR++2+67WzDhCq UOuYqDzvZjZEVvIyQ+tYBR5azKCNXz6QVqckbPur2pJZODz9eizCSk8UL2vWMl4ppds6 x4ANelPrPDedUTJkac7wnNawme+2iGnU7T7dDgwzqUXZJrgqHyoGhcuR4x3d74w7XaUd nXmA== Received: by 10.216.225.23 with SMTP id y23mr3515518wep.67.1339273943695; Sat, 09 Jun 2012 13:32:23 -0700 (PDT) Received: from unknown ([79.115.170.89]) by mx.google.com with ESMTPS id fo7sm11797312wib.9.2012.06.09.13.32.22 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 09 Jun 2012 13:32:23 -0700 (PDT) Date: Sat, 9 Jun 2012 23:31:34 +0300 From: Theodor-Iulian Ciobanu To: freebsd-stable@freebsd.org Message-ID: <20120609233134.0000711b@unknown> In-Reply-To: <4FCFE178.9080505@FreeBSD.org> References: <1337319129.2915.4.camel@powernoodle-l7> <4FB6765A.2050307@FreeBSD.org> <1337710214.2916.8.camel@powernoodle-l7.corp.yahoo.com> <20120525163653.b61a08e2.lists@yamagi.org> <4FBFA9A9.7020806@FreeBSD.org> <4FBFBD39.7000105@FreeBSD.org> <4FBFDFFB.9020501@FreeBSD.org> <4FBFE624.1020208@FreeBSD.org> <20120526090233.f638c1d2.lists@yamagi.org> <4FC0A3A1.80200@FreeBSD.org> <4FC7D464.20602@FreeBSD.org> <4FCFD2A1.60706@FreeBSD.org> <4FCFE178.9080505@FreeBSD.org> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.24.8; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnidEBASQIV+JBRrtRm/+u8g/N0oOG6BiDii+YRDPfc7HtcLJ+hhCqz7xYGgEvf9b8VjwAb Subject: Re: [stable 9] broken hwpstate calls X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 20:32:31 -0000 On Wed, 06 Jun 2012 19:02:16 -0400 Jung-uk Kim wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 2012-06-06 17:58:57 -0400, Andriy Gapon wrote: > > on 31/05/2012 23:28 Jung-uk Kim said the following: > >> It is simple but I don't like locking scheduler, binding CPU, and > >> writing the same MSR, multiple times for each core. > > > > Not sure if parse this. The MSR is _written_ /once/ for each > > core. (BTW, "locking scheduler" is not a completely accurate > > description of what thread_lock does) > > I apologize. I didn't see the whole picture and read your patch > wrong. > > Any way, hwpstate still isn't quite right even without your patch. > > sys/kern/kern_cpu.c > cpufreq_curr_sysctl() -> > CPUFREQ_SET() -> /* for all CPU devices */ > cf_set_method() -> /* thread_lock(), sched_bind(), ... > */ CPUFREQ_DRV_SET() -> > sys/x86/cpufreq/hwpstate.c > hwpstate_set() -> > hwpstate_goto_pstate() /* for each CPU unit */ > /* thread_lock(), sched_bind(), ... */ > > Therefore, "sysctl dev.cpu.0.cpufreq=" loops n^2 times (i.e., n > times per CPU) where n is number of CPUs. At least, it should check > unit == 0, e.g., > > hwpstate_goto_pstate(...) > { > ... > if (unit == 0) { > /* XXX Is this really necessary? */ > CPU_FOREACH(i) { > ... > wrmsr(MSR_AMD_10H_11H_CONTROL, id); > ... > } > } > /* Check the current P-state. */ > for (...) { > ... > msr = rdmsr(MSR_AMD_10H_11H_STATUS); > if (msr == id) > break; > ... > } > /* XXX Maybe your patch here? */ > ... > } > > >> Besides, it introduces more delay and you may be reading the > >> correct status because of that. :-P > > > > Having a separate reading pass does introduce more delay indeed. > > Reading the correct status is a good thing, OTOH. > > That's what I said. > > > Why would anyone want to read incorrect status? (just want to note > > that "correct" and "expected" are different things) > > Okay, okay. > > >> If people really think checking MSRC001_0071[18:16] is unworthy > >> for > > > > Well, "other people" hasn't demonstrated/proved/convinced yet that > > it is worthy > > > >> Bulldozer, I prefer skipping status check > > > > That's what I suggested from the very start. > > Buy me a Bulldozer and I'll fix it for you! :-P If it's of any help, I have an Opteron 6274 I'd be willing to test some patches on, to get Turbo Core working. > >> but I disagree with this patch. > > > > Since I am not invested in this issue (I am not affected by the > > problem and I do not have any personal attachment to the code in > > question), I will just defer any decision to those who do care > > about the problem. I hope that a fix will be provided in the end. > > Same here. > > Jung-uk Kim > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.19 (FreeBSD) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk/P4XgACgkQmlay1b9qnVP8cgCgl9sAzyE956YjB2B3bK0wvOHu > n64Anih7sdWYQgflQVHuUGstdk05Fs9i > =2dS0 > -----END PGP SIGNATURE----- > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to > "freebsd-stable-unsubscribe@freebsd.org" -- Theo