Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751336AbdFEQOs (ORCPT ); Mon, 5 Jun 2017 12:14:48 -0400 Received: from smtp.ctxuk.citrix.com ([185.25.65.24]:23780 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751162AbdFEQOr (ORCPT ); Mon, 5 Jun 2017 12:14:47 -0400 X-IronPort-AV: E=Sophos;i="5.39,302,1493683200"; d="scan'208";a="47234207" Subject: Re: [Xen-devel] [PATCH] xen-evtchn: Bind dyn evtchn:qemu-dm interrupt to next online VCPU To: Boris Ostrovsky , , CC: References: <1496414988-12878-1-git-send-email-anoob.soman@citrix.com> <363cb97a-7dc1-ae4f-da93-30e7658cef00@oracle.com> <5a5d9355-34fc-57aa-825c-81123f6bb74e@citrix.com> <0c2a3a4b-e442-8c8c-6a71-6f9972ff29fc@citrix.com> From: Anoob Soman Message-ID: Date: Mon, 5 Jun 2017 17:14:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ClientProxiedBy: FTLPEX02CAS04.citrite.net (10.13.99.237) To AMSPEX02CL02.citrite.net (10.69.22.126) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 997 Lines: 29 On 05/06/17 16:32, Boris Ostrovsky wrote: > I believe we do need to take affinity into consideration even if the > chance that it is non-default is small. Agreed. > I am not opposed to having bind_last_selected_cpu percpu, I just wanted > to understand the reason better. Additional locking would be a downside > with a global so if you feel that percpu is worth it then I won't object. If affinity == cpu_online_mask, then percpu will give a better spread. atomic set/get can be used, if we want to use a global variable, but I think it will be more random than percpu. > >> Yes, you are correct. .irq_set_affinity pretty much does the same thing. >> >> The code will now looks like this. >> raw_spin_lock_irqsave(lock, flags); >> percpu read >> select_cpu >> percpu write >> xen_rebind_evtchn_to_cpu(evtchn, selected_cpu) >> raw_spin_unlock_irqsave(lock, flags); > (BTW, I just noticed --- you don't need to initialize desc) Sorry, I didn't get it. Which desc doesn't need init ? -Anoob