From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland Dreier Subject: Re: [PATCH 4/7] SMP: Implement on_one_cpu() Date: Thu, 24 May 2007 06:43:32 -0700 Message-ID: References: <1180008615579-git-send-email-avi@qumranet.com> <11800086152009-git-send-email-avi@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, shaohua.li@intel.com, lhcs-devel@lists.sourceforge.net To: Avi Kivity Return-path: In-Reply-To: <11800086152009-git-send-email-avi@qumranet.com> (Avi Kivity's message of "Thu, 24 May 2007 15:10:12 +0300") Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org I don't see any documented restrictions about preemption being disabled when this function is called, but... > +int on_one_cpu(int cpu, void (*func) (void *info), void *info, > + int retry, int wait) > +{ > + int ret; > + int this_cpu; > + > + this_cpu = get_cpu(); what if a preempt and reschedule to a different CPU happens right here, after this_cpu is set? > + if (this_cpu == cpu) {