From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753719AbdDJL0f (ORCPT ); Mon, 10 Apr 2017 07:26:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59410 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753675AbdDJL0d (ORCPT ); Mon, 10 Apr 2017 07:26:33 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6310E3B755 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=prarit@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6310E3B755 Message-ID: <58EB6BE7.6020802@redhat.com> Date: Mon, 10 Apr 2017 07:26:31 -0400 From: Prarit Bhargava User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Chen Yu CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "Rafael J. Wysocki" , Len Brown , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/irq: Do not check available vectors if current CPU has no irq to migrate References: <1491746031-31107-1-git-send-email-yu.c.chen@intel.com> In-Reply-To: <1491746031-31107-1-git-send-email-yu.c.chen@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 10 Apr 2017 11:26:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/09/2017 09:53 AM, Chen Yu wrote: > This is an optimization to bypass the free vector checking if the current > CPU has no irq to migrate. This can especially speed up the CPU offline > process when there are many CPUs in the system. Chen, OOC how much time does this save? P. > > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: Prarit Bhargava > Cc: "Rafael J. Wysocki" > Cc: Len Brown > Cc: x86@kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Chen Yu > --- > arch/x86/kernel/irq.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c > index 4d8183b..b9bdc1e 100644 > --- a/arch/x86/kernel/irq.c > +++ b/arch/x86/kernel/irq.c > @@ -394,6 +394,9 @@ int check_irq_vectors_for_cpu_disable(void) > !cpumask_subset(&affinity_new, &online_new)) > this_count++; > } > + /* No need to check any further. */ > + if (!this_count) > + return 0; > > count = 0; > for_each_online_cpu(cpu) { >