Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7585692ybi; Mon, 22 Jul 2019 16:15:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJrQYtHVHsVIe58oFS1wNPDJCcqB4+UgIsIsAeOV9sy8t4+/VdlnYmIcTUfuWc+dbnUCz8 X-Received: by 2002:a17:902:112a:: with SMTP id d39mr78554442pla.254.1563837322774; Mon, 22 Jul 2019 16:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563837322; cv=none; d=google.com; s=arc-20160816; b=LJD03FR46vbfOxH4H2u8u2inMu+5R7V1QKEjBZb4e0PB0w3YfogOtCAYuwEcFe2o0X qJOqbVKja9pO2VxO57F0Hx4avxd5UaNu6LxNDCupIcBBgC1UnbMgSMFLUaXNxzmnqy4m RPmWte0W1PeBAw0sJuMRb5rH8L0w5o6Tzg/4NvFXahBNfoK8liW7kUBRlrVOFRecfWSw gQSmdYzNHlN2QwUztfgqUv84EjLKGldDlD+boKGxh0X9+NJm7wWhGov/hCIoBzZUeHfm fS/zfa7YrBXExB4ypiRqYv8cwshQG775BpQIacbkUlgyFj8tVFGM3DW+ii/1D5qS++30 FXRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=keKKeydik4bS+64TTpgAMtBX2rjNWqKMPt/hZd7gMIY=; b=j12Dm/Lc+FMnSTIUykZCa+McFZoYjur4iPp70XdfiGBl99Yij788pwXxcpVIMEt9G7 Pc4PcjLaW8dPlBMxogkN99WFpnJutXsDGpc2vNzovHVaFopMlOsr8NklOJLPt8tOEieQ 3M9yf73ehncMyXimps/0x+uXdrM1gFKo0+Vvl5z361O1prQLpIgNYgqaDkkosks9AlsI N68Wi/k1s9KFxtDOMCKTF8J9DGE7I7MdCSpGdjVm200cstGMZTWx/SsC8yBcyebTRxvN jgnt8OJjZ04lnCgCkU7Ind6BB8feGXV3Qmc1zbVurXIFYDv1BoK900uw8ibnG1BHEbjP U+vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=3Jj7gG+H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si11887802pfq.187.2019.07.22.16.15.07; Mon, 22 Jul 2019 16:15:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=3Jj7gG+H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731278AbfGVSRU (ORCPT + 99 others); Mon, 22 Jul 2019 14:17:20 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36564 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730013AbfGVSRU (ORCPT ); Mon, 22 Jul 2019 14:17:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=keKKeydik4bS+64TTpgAMtBX2rjNWqKMPt/hZd7gMIY=; b=3Jj7gG+Hb4FIjHDviO3i+DrFh A0gM4s5VsEj0u/byh4R+8ttqnd1FeXKAiVhNXZC3AvShhDQ+Yc78Oygio2hEnct+/IqcP2YLucqYU C7iQ/1Tud84LYi5tZxrw+x7rS84gb0nBBPb70rpEufvTBZElG144wh34V35St2tuCFYBZjCJdSIiW 4TCHh3LVX1Z3ftOI2uwFQNNeQHZS5ws3d4c+Quwi8slujv/wj6QyfnbULQq7zUltF9fy65D8lyXdL D7fQns8qhCHDbQMUPYNNI8oNJIBvySpyF2o1LOTH+p3EesyKlWINJf2m6d2znhPP3ce9q0VgGWx2s fi/X7ricw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hpcrt-0005ZB-VH; Mon, 22 Jul 2019 18:17:02 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 6736E980D20; Mon, 22 Jul 2019 20:16:58 +0200 (CEST) Date: Mon, 22 Jul 2019 20:16:58 +0200 From: Peter Zijlstra To: Dave Hansen Cc: Nadav Amit , Andy Lutomirski , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Rik van Riel , Josh Poimboeuf Subject: Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many() Message-ID: <20190722181658.GA6698@worktop.programming.kicks-ass.net> References: <20190719005837.4150-1-namit@vmware.com> <20190719005837.4150-2-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 19, 2019 at 11:23:06AM -0700, Dave Hansen wrote: > On 7/18/19 5:58 PM, Nadav Amit wrote: > > @@ -624,16 +622,11 @@ EXPORT_SYMBOL(on_each_cpu); > > void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func, > > void *info, bool wait) > > { > > - int cpu = get_cpu(); > > + preempt_disable(); > > > > - smp_call_function_many(mask, func, info, wait); > > - if (cpumask_test_cpu(cpu, mask)) { > > - unsigned long flags; > > - local_irq_save(flags); > > - func(info); > > - local_irq_restore(flags); > > - } > > - put_cpu(); > > + __smp_call_function_many(mask, func, func, info, wait); > > + > > + preempt_enable(); > > } > > The get_cpu() was missing it too, but it would be nice to add some > comments about why preempt needs to be off. I was also thinking it > might make sense to do: > > cfd = get_cpu_var(cfd_data); > __smp_call_function_many(cfd, ...); > put_cpu_var(cfd_data); > > instead of the explicit preempt_enable/disable(), but I don't feel too > strongly about it. It is also required for cpu hotplug.