From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756279AbcCUOVS (ORCPT ); Mon, 21 Mar 2016 10:21:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:57370 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755376AbcCUOVR (ORCPT ); Mon, 21 Mar 2016 10:21:17 -0400 Subject: Re: [Xen-devel] [PATCH v2 5/6] virt, sched: add cpu pinning to smp_call_sync_on_phys_cpu() To: Jan Beulich References: <1458563075-30298-1-git-send-email-jgross@suse.com> <1458563075-30298-6-git-send-email-jgross@suse.com> <56F0087202000078000DED9F@suse.com> Cc: Jean Delvare , david.vrabel@citrix.com, Douglas_Warzecha@dell.com, pali.rohar@gmail.com, jeremy@goop.org, peterz@infradead.org, x86@kernel.org, tglx@linutronix.de, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, mingo@redhat.com, linux@roeck-us.net, rusty@rustcorp.com.au, chrisw@sous-sol.org, linux-kernel@vger.kernel.org, akataria@vmware.com, hpa@zytor.com From: Juergen Gross Message-ID: <56F00350.4000700@suse.com> Date: Mon, 21 Mar 2016 15:21:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56F0087202000078000DED9F@suse.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/03/16 14:42, Jan Beulich wrote: >>>> On 21.03.16 at 13:24, wrote: >> @@ -758,9 +759,14 @@ struct smp_sync_call_struct { >> static void smp_call_sync_callback(struct work_struct *work) >> { >> struct smp_sync_call_struct *sscs; >> + unsigned int cpu = smp_processor_id(); > > So this obtains the vCPU number, yet ... > >> sscs = container_of(work, struct smp_sync_call_struct, work); >> + preempt_disable(); >> + hypervisor_pin_vcpu(cpu); > > ... here you're supposed to pass a pCPU number. > > Also don't you need to call smp_processor_id() after preempt_disable()? No, I'm running on the workqueue bound to the specific (v)cpu and I'm expecting this vcpu to be pinned to the same numbered pcpu. preempt_disable() is just called to avoid scheduling of another thread while the override pinning is active. Juergen