From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Rostedt Subject: Re: [RFC v4 2/2] x86/xen: allow privcmd hypercalls to be preempted Date: Thu, 22 Jan 2015 20:57:17 -0500 Message-ID: <20150122205717.57615751@grimm.local.home> References: <1421972951-3940-1-git-send-email-mcgrof@do-not-panic.com> <1421972951-3940-3-git-send-email-mcgrof@do-not-panic.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "Luis R. Rodriguez" , David Vrabel , Konrad Rzeszutek Wilk , Boris Ostrovsky , "xen-devel@lists.xenproject.org" , "linux-kernel@vger.kernel.org" , X86 ML , kvm list , Paul McKenney , "Luis R. Rodriguez" , Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Masami Hiramatsu , Jan Beulich To: Andy Lutomirski Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Thu, 22 Jan 2015 17:40:27 -0800 Andy Lutomirski wrote: > > > > +/* > > + * CONFIG_PREEMPT=n kernels can end up triggering the softlock > > + * TASK_UNINTERRUPTIBLE hanger check (default 120 seconds) > > + * when certain multicalls are used [0] on large systems, in > > + * that case we need a way to voluntarily preempt. This is > > + * only an issue on CONFIG_PREEMPT=n kernels. > > + * > > + * [0] https://bugzilla.novell.com/show_bug.cgi?id=861093 > > + */ > > +void xen_end_upcall(struct pt_regs *regs) > > +{ > > + if (xen_is_preemptible_hypercall(regs)) { > > + int cpuid = smp_processor_id(); > > + if (_cond_resched()) > > + trace_xen_hypercall_preemption(cpuid); > > If you want to speed this up a bit, I think you could move the > smp_processor_id() into the TP_fast_assign. But don't tracepoints > report the cpu number even without any action? Yes, but if you scheduled here, the tracepoint could happen on a different CPU. Thus, cpuid will not equal smp_processor_id(). -- Steve