[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Question about the usage of spinlock



On Thu, 2016-05-26 at 10:30 +0900, 조현권 wrote:
> Hi
>
Hi,

> I am studying xen 4.6.0 version now and wonder the usage of spinlock
> which is located in free_heap_pages(xen/common/page_alloc. c)
> As its memory setup is ahead of multicore initialization, spinlock
> seems to be unnecessary during booting because it uses only single
> core
> spinlock looks required after multicore initialization finished and
> when xen needs to free memory space during work
>
I'm not sure I understand the point you're trying to make.

It's probably true that using spinlock is pointless before we actually
have more than 1 CPU up and running.

However, free_heap_pages() is called by other fucntions that are not
necessarily only used during boot. For instance, it's called
by free_domheap_pages(), which in its turn is called from functions
that are used outside from the init path, when we are already SMP.

> However i experimented not to use spin lock in free_heap_pages and
> dom0(linux-kernel) was booted well. It does not cause any error using
> internet or application program even reboot
>
That does not prove much, especially if you haven't actually tried
using multiple guest or, in general, causing an actual concurrent
execution of free_heap_pages().

However, even if you manage to construct a scenario where that happens,
and things works, that also won't mean much, as the fact that in one
particular case inconsistency due to races does not happen (or does not
manifest), does not mean it can't happen, or it's not there already.

All this, of course, provided I understood your question, which is
something I'm not sure about.

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)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.