From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756345Ab3LSQCR (ORCPT ); Thu, 19 Dec 2013 11:02:17 -0500 Received: from mail-ee0-f43.google.com ([74.125.83.43]:33115 "EHLO mail-ee0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752038Ab3LSQCO (ORCPT ); Thu, 19 Dec 2013 11:02:14 -0500 Date: Thu, 19 Dec 2013 17:02:10 +0100 From: Ingo Molnar To: "H. Peter Anvin" Cc: Len Brown , x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown , stable@vger.kernel.org, Linus Torvalds , Thomas Gleixner , Peter Zijlstra , Mike Galbraith , Borislav Petkov Subject: Re: [PATCH] x86 idle: repair large-server 50-watt idle-power regression Message-ID: <20131219160210.GA28426@gmail.com> References: <20131219122257.GC11279@gmail.com> <52B316FF.50906@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52B316FF.50906@zytor.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * H. Peter Anvin wrote: > On 12/19/2013 04:22 AM, Ingo Molnar wrote: > >> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c > >> index 92d1206..f80b700 100644 > >> --- a/drivers/idle/intel_idle.c > >> +++ b/drivers/idle/intel_idle.c > >> @@ -377,6 +377,9 @@ static int intel_idle(struct cpuidle_device *dev, > >> > >> if (!current_set_polling_and_test()) { > >> > >> + if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR)) > >> + clflush((void *)¤t_thread_info()->flags); > >> + > >> __monitor((void *)¤t_thread_info()->flags, 0, 0); > > > > I don't think either of these casts to '(void *)' is needed, both the > > clflush() and __monitor() will take pointers. > > __monitor() currently doesn't, which is idiotic. Hm, __monitor() seems to take a void *: arch/x86/include/asm/processor.h:static inline void __monitor(const void *eax, unsigned long ecx, So writing: if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR)) clflush(¤t_thread_info()->flags); __monitor(¤t_thread_info()->flags, 0, 0); ought to work just fine. Thanks, Ingo