Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbdIAGuK (ORCPT ); Fri, 1 Sep 2017 02:50:10 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:35941 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751000AbdIAGuI (ORCPT ); Fri, 1 Sep 2017 02:50:08 -0400 X-Google-Smtp-Source: ADKCNb58qJW8QupQM25cJLlexs5T5PkSQolKA8udm5+KVTs4MMs4g5bq9SQHCrjkVXBW8yPLdn95XQ== Subject: Re: [RFC PATCH v2 3/7] sched/idle: Add poll before enter real idle path To: Borislav Petkov , Yang Zhang Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, wanpeng.li@hotmail.com, mst@redhat.com, pbonzini@redhat.com, tglx@linutronix.de, rkrcmar@redhat.com, dmatlack@google.com, agraf@suse.de, peterz@infradead.org, linux-doc@vger.kernel.org, Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Kyle Huey , Andy Lutomirski , Len Brown References: <1504007201-12904-1-git-send-email-yang.zhang.wz@gmail.com> <1504007201-12904-4-git-send-email-yang.zhang.wz@gmail.com> <20170829143909.thgizi4myouyt3ch@pd.tnic> From: Quan Xu Message-ID: Date: Fri, 1 Sep 2017 14:49:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170829143909.thgizi4myouyt3ch@pd.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1651 Lines: 50 on 2017/8/29 22:39, Borislav Petkov wrote: > On Tue, Aug 29, 2017 at 11:46:37AM +0000, Yang Zhang wrote: >> Add poll in do_idle. For UP VM, if there are running task, it will not >> goes into idle path, so we only enable poll in SMP VM. >> >> Signed-off-by: Yang Zhang >> Signed-off-by: Quan Xu >> Cc: Thomas Gleixner >> Cc: Ingo Molnar >> Cc: "H. Peter Anvin" >> Cc: x86@kernel.org >> Cc: Peter Zijlstra >> Cc: Borislav Petkov >> Cc: Kyle Huey >> Cc: Andy Lutomirski >> Cc: Len Brown >> Cc: linux-kernel@vger.kernel.org >> --- >> arch/x86/kernel/process.c | 7 +++++++ >> kernel/sched/idle.c | 2 ++ >> 2 files changed, 9 insertions(+) >> >> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c >> index 3ca1980..def4113 100644 >> --- a/arch/x86/kernel/process.c >> +++ b/arch/x86/kernel/process.c >> @@ -332,6 +332,13 @@ void arch_cpu_idle(void) >> x86_idle(); >> } >> >> +#if defined(CONFIG_SMP) && defined(CONFIG_PARAVIRT) >> +void arch_cpu_idle_poll(void) >> +{ >> + paravirt_idle_poll(); >> +} >> +#endif > So this will get called on any system which has CONFIG_PARAVIRT enabled > *even* if they're not running any guests. > > Huh?    Borislav ,    yes,  this will get called on any system which has CONFIG_PARAVIRT enabled.    but if they are not running any guests,  the callback is paravirt_nop() ,    IIUC which is as similar as the other paravirt_*, such as paravirt_pgd_free()..  - Quan