From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753443AbdESLJ6 (ORCPT ); Fri, 19 May 2017 07:09:58 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49452 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbdESLJ4 (ORCPT ); Fri, 19 May 2017 07:09:56 -0400 Date: Fri, 19 May 2017 13:09:51 +0200 From: Peter Zijlstra To: Aaron Lu Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner , Tim Chen , Dave Hansen , Huang Ying Subject: Re: [PATCH resend] smp: avoid sending needless IPI in smp_call_function_many() Message-ID: <20170519110951.afpvoewwmszdnob5@hirez.programming.kicks-ass.net> References: <20170428131944.11928-1-aaron.lu@intel.com> <20170519075331.GE2084@aaronlu.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170519075331.GE2084@aaronlu.sh.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 19, 2017 at 03:53:31PM +0800, Aaron Lu wrote: > @@ -434,6 +442,7 @@ void smp_call_function_many(const struct cpumask *mask, > if (unlikely(!cpumask_weight(cfd->cpumask))) > return; Another thing that occurred to me while staring at that function, is that we could move: cpumask_and(cfd->cpumask, mask, cpu_online_mask); to the very begin of that function, that would then obviate the need for that cpumask_weight() test afaict. I'm not sure its worth the trouble, but it would make the function slightly easier to look at.