From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v3 07/23] xsplice: Implement support for applying/reverting/replacing patches. (v5) Date: Tue, 23 Feb 2016 15:57:30 -0500 Message-ID: <20160223205730.GA17087@char.us.oracle.com> References: <1455300361-13092-1-git-send-email-konrad.wilk@oracle.com> <1455300361-13092-8-git-send-email-konrad.wilk@oracle.com> <56C3744E.8000702@citrix.com> <20160223204157.GB15838@char.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYK1j-0001vV-VD for xen-devel@lists.xenproject.org; Tue, 23 Feb 2016 20:57:48 +0000 Content-Disposition: inline In-Reply-To: <20160223204157.GB15838@char.us.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Kevin Tian , Keir Fraser , Ian Campbell , Jun Nakajima , jinsong.liu@alibaba-inc.com, xen-devel@lists.xen.org, mpohlack@amazon.de, ross.lagerwall@citrix.com, Stefano Stabellini , Aravind Gopalakrishnan , Jan Beulich , xen-devel@lists.xenproject.org, Boris Ostrovsky , Suravee Suthikulpanit , sasha.levin@citrix.com List-Id: xen-devel@lists.xenproject.org > > > +static void reschedule_fn(void *unused) > > > +{ > > > + smp_mb(); /* Synchronize with setting do_work */ > > > + raise_softirq(SCHEDULE_SOFTIRQ); > > > > As you have to IPI each processor to raise a schedule softirq, you can > > set a per-cpu "xsplice enter rendezvous" variable. This prevents the > > need for the return-to-guest path to poll one single byte. > > .. Not sure I follow. The IPI we send to the other CPU is 0xfb - which > makes the smp_call_function_interrupt run, which calls this function: > reschedule_fn(). Then raise_softirq sets the bit on softirq_pending. > > Great. Since we caused an IPI that means we ended up calling VMEXIT which > eventually ends calling process_pending_softirqs() which calls schedule(). > And after that it calls check_for_xsplice_work(). > > Are you suggesting to add new softirq that would call in check_for_xsplice_work()? > > Or are you suggesting to skip the softirq_pending check and all the > code around that and instead have each VMEXIT code path check this > per-cpu "xsplice enter" variable? If so, why not use the existing > softirq infrastructure? N/m. You were referring to the: > > > +void do_xsplice(void) .. > > > + /* Fast path: no work to do. */ > > > + if ( likely(!xsplice_work.do_work) ) > > > + return; which every CPU is going to do in when it calls idle_loop, svm_do_resume, and vmx_do_resume. Let me add that in!