Hi everyone, I found in Xen, when synchronization between multiple threads is needed, Xen always uses busy wait or simple spin lock. In linux, the kernel can block a waiting thread and schedule other threads for execution. Why does Xen do not have this mechanism? I guess it is because the performance issue? A lot of appreciation for your answer !! Xinxin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
On mar, 2013-10-08 at 08:11 -0700, Xinxin Jin wrote:> Hi everyone, > > > I found in Xen, when synchronization between multiple threads is > needed, Xen always uses busy wait or simple spin lock. >Mmm... What exactly is a ''thread'' here? Are you talking about Xen internals? If yes, I don''t think there''s much multithreading involved there...> In linux, the kernel can block a waiting thread and schedule other > threads for execution. Why does Xen do not have this mechanism? >Well, Linux, as a general purpose kernel, does indeed schedule a lot of different stuff, yes, but I still don''t see where you think Xen could/should do something similar...> I guess it is because the performance issue? A lot of appreciation for > your answer !! >Perhaps you can: - show some example of what you mean - describe what is the issue that you are seeing/trying to solve Regards, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
On Tue, Oct 8, 2013 at 4:11 PM, Xinxin Jin <xinxinjin89@gmail.com> wrote:> Hi everyone, > > I found in Xen, when synchronization between multiple threads is needed, Xen > always uses busy wait or simple spin lock. In linux, the kernel can block a > waiting thread and schedule other threads for execution. Why does Xen do not > have this mechanism? I guess it is because the performance issue? A lot of > appreciation for your answer !!Linux keeps per-thread kernel stacks, so it can call schedule() and block in the middle of kernel code. Xen does not keep per-vcpu hypervisor stacks, so in general it cannot block in the middle of hypervisor code. -George
On Wed, 2013-10-09 at 12:15 +0100, George Dunlap wrote:> On Tue, Oct 8, 2013 at 4:11 PM, Xinxin Jin <xinxinjin89@gmail.com> wrote: > > Hi everyone, > > > > I found in Xen, when synchronization between multiple threads is needed, Xen > > always uses busy wait or simple spin lock. In linux, the kernel can block a > > waiting thread and schedule other threads for execution. Why does Xen do not > > have this mechanism? I guess it is because the performance issue? A lot of > > appreciation for your answer !! > > Linux keeps per-thread kernel stacks, so it can call schedule() and > block in the middle of kernel code. Xen does not keep per-vcpu > hypervisor stacks, so in general it cannot block in the middle of > hypervisor code.And since it does not deal with e.g. I/O which can take a long time there is typically no need for the hypervisor to block anyway. Ian.