From patchwork Wed Jun 16 20:42:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 106558 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5GKiXS5010422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 16 Jun 2010 20:45:09 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OOzSB-0007RP-7M; Wed, 16 Jun 2010 20:43:19 +0000 Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.123] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OOzS9-0007RA-1D for dri-devel@lists.sourceforge.net; Wed, 16 Jun 2010 20:43:17 +0000 Received-SPF: pass (sfi-mx-3.v28.ch3.sourceforge.com: domain of linux-foundation.org designates 140.211.169.13 as permitted sender) client-ip=140.211.169.13; envelope-from=akpm@linux-foundation.org; helo=smtp1.linux-foundation.org; Received: from smtp1.linux-foundation.org ([140.211.169.13]) by sfi-mx-3.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1OOzS2-0000Zl-Rp for dri-devel@lists.sourceforge.net; Wed, 16 Jun 2010 20:43:16 +0000 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id o5GKgV09002895 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jun 2010 13:42:32 -0700 Received: from akpm.mtv.corp.google.com (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id o5GKgV1j026789; Wed, 16 Jun 2010 13:42:31 -0700 Date: Wed, 16 Jun 2010 13:42:31 -0700 From: Andrew Morton To: "Rafael J. Wysocki" Subject: Re: 2.6.35-rc2-git2: Reported regressions from 2.6.34 Message-Id: <20100616134231.23ff30da.akpm@linux-foundation.org> In-Reply-To: <201006091122.35304.rjw@sisk.pl> References: <201006091122.35304.rjw@sisk.pl> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.9; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Spam-Status: No, hits=-2.996 required=5 tests=AWL,BAYES_00 X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Spam-Score: -0.8 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record 0.7 AWL AWL: From: address is in the auto white-list X-Headers-End: 1OOzS2-0000Zl-Rp Cc: DRI , Linux SCSI List , Network Development , Linux Wireless List , Linux Kernel Mailing List , Linux ACPI , dmonakhov@openvz.org, Linux@demeter.kernel.org, sedat.dilek@gmail.com, List , Kernel Testers List , Linus Torvalds , Maciej Rutecki X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 16 Jun 2010 20:45:10 +0000 (UTC) diff -puN drivers/cpuidle/governors/menu.c~cpuidle-avoid-using-smp_processor_id-in-preemptible-code-nr_iowait_cpu drivers/cpuidle/governors/menu.c --- a/drivers/cpuidle/governors/menu.c~cpuidle-avoid-using-smp_processor_id-in-preemptible-code-nr_iowait_cpu +++ a/drivers/cpuidle/governors/menu.c @@ -137,15 +137,18 @@ static inline int which_bucket(unsigned { int bucket = 0; + int cpu = get_cpu(); /* * We keep two groups of stats; one with no * IO pending, one without. * This allows us to calculate * E(duration)|iowait */ - if (nr_iowait_cpu()) + if (nr_iowait_cpu(cpu)) bucket = BUCKETS/2; + put_cpu(); + if (duration < 10) return bucket; if (duration < 100) @@ -169,13 +172,16 @@ static inline int which_bucket(unsigned static inline int performance_multiplier(void) { int mult = 1; + int cpu = get_cpu(); /* for higher loadavg, we are more reluctant */ mult += 2 * get_loadavg(); /* for IO wait tasks (per cpu!) we add 5x each */ - mult += 10 * nr_iowait_cpu(); + mult += 10 * nr_iowait_cpu(cpu); + + put_cpu(); return mult; } diff -puN include/linux/sched.h~cpuidle-avoid-using-smp_processor_id-in-preemptible-code-nr_iowait_cpu include/linux/sched.h --- a/include/linux/sched.h~cpuidle-avoid-using-smp_processor_id-in-preemptible-code-nr_iowait_cpu +++ a/include/linux/sched.h @@ -139,7 +139,7 @@ extern int nr_processes(void); extern unsigned long nr_running(void); extern unsigned long nr_uninterruptible(void); extern unsigned long nr_iowait(void); -extern unsigned long nr_iowait_cpu(void); +extern unsigned long nr_iowait_cpu(int cpu); extern unsigned long this_cpu_load(void); diff -puN kernel/sched.c~cpuidle-avoid-using-smp_processor_id-in-preemptible-code-nr_iowait_cpu kernel/sched.c --- a/kernel/sched.c~cpuidle-avoid-using-smp_processor_id-in-preemptible-code-nr_iowait_cpu +++ a/kernel/sched.c @@ -2864,9 +2864,9 @@ unsigned long nr_iowait(void) return sum; } -unsigned long nr_iowait_cpu(void) +unsigned long nr_iowait_cpu(int cpu) { - struct rq *this = this_rq(); + struct rq *this = cpu_rq(cpu); return atomic_read(&this->nr_iowait); } diff -puN kernel/time/tick-sched.c~cpuidle-avoid-using-smp_processor_id-in-preemptible-code-nr_iowait_cpu kernel/time/tick-sched.c --- a/kernel/time/tick-sched.c~cpuidle-avoid-using-smp_processor_id-in-preemptible-code-nr_iowait_cpu +++ a/kernel/time/tick-sched.c @@ -159,10 +159,12 @@ update_ts_time_stats(struct tick_sched * ktime_t delta; if (ts->idle_active) { + int cpu = get_cpu(); delta = ktime_sub(now, ts->idle_entrytime); ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); - if (nr_iowait_cpu() > 0) + if (nr_iowait_cpu(cpu) > 0) ts->iowait_sleeptime = ktime_add(ts->iowait_sleeptime, delta); + put_cpu(); ts->idle_entrytime = now; }