[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131219160210.GA28426@gmail.com>
Date: Thu, 19 Dec 2013 17:02:10 +0100
From: Ingo Molnar <mingo@...nel.org>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Len Brown <lenb@...nel.org>, x86@...nel.org,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
Len Brown <len.brown@...el.com>, stable@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Mike Galbraith <efault@....de>, Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH] x86 idle: repair large-server 50-watt idle-power
regression
* H. Peter Anvin <hpa@...or.com> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists