Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755587AbdC1Set (ORCPT ); Tue, 28 Mar 2017 14:34:49 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53348 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755155AbdC1Ser (ORCPT ); Tue, 28 Mar 2017 14:34:47 -0400 Date: Tue, 28 Mar 2017 20:34:14 +0200 (CEST) From: Thomas Gleixner To: "Liang, Kan" cc: "peterz@infradead.org" , "mingo@redhat.com" , "linux-kernel@vger.kernel.org" , "bp@alien8.de" , "acme@kernel.org" , "eranian@google.com" , "jolsa@kernel.org" , "ak@linux.intel.com" Subject: RE: [PATCH V3 1/2] x86/msr: add msr_set/clear_bit_on_cpu/cpus access functions In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F077536C63BB@SHSMSX103.ccr.corp.intel.com> Message-ID: References: <1490639448-4147-1-git-send-email-kan.liang@intel.com> <1490639448-4147-2-git-send-email-kan.liang@intel.com> <37D7C6CF3E00A74B8858931C1DB2F077536C63BB@SHSMSX103.ccr.corp.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 342 Lines: 16 On Tue, 28 Mar 2017, Liang, Kan wrote: > Thanks. It simplify the code very much. > I think we still need to protect the smp_call_function in the driver, right? Yes. > Would be the following code enough? > > get_online_cpus(); > preempt_disable(); Only get_online_cpus(). smp_call_function() disables preemption internaly. Thanks, tglx