xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: 조현권 <chkwon91@gmail.com>, xen-devel@lists.xen.org
Subject: Re: Question about the usage of spinlock
Date: Thu, 26 May 2016 18:11:14 +0200	[thread overview]
Message-ID: <1464279074.21930.136.camel@citrix.com> (raw)
In-Reply-To: <CA+CgW8e=XSJuZqfj2b-O-cC5XPXaVnNty0dj9c=v0k-uHAsO6A@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1946 bytes --]

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 #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

      parent reply	other threads:[~2016-05-26 16:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+CgW8eeCG2DZv6s_Ozs3OsJpzVwkVOQP-NB+Yn8O7RT5beByw@mail.gmail.com>
     [not found] ` <CA+CgW8dadfhqptZMmMmb196tbA3z52OJS52ZRsX2P8Pjrmz=pA@mail.gmail.com>
     [not found]   ` <CA+CgW8d1UOSR2EK3Fe_y9BGhe3vTe4vaAqt8Rhcw+qKth3XCbw@mail.gmail.com>
     [not found]     ` <CA+CgW8dD9A+pMHhHKvieunTk6T4cH5X8DObcgjTruBM2bW+v9A@mail.gmail.com>
     [not found]       ` <CA+CgW8dic4RLoW2-S5QQHNKYO_y=7_=Dw+hbGX2myOnSeXbapA@mail.gmail.com>
     [not found]         ` <CA+CgW8cJpBV4owXg51rsDOX_XoJjtMDtvgDn19-Mhs096MMJdA@mail.gmail.com>
     [not found]           ` <CA+CgW8e2qMULD=GiiwONumwV4UMUh6hha3MXESuPhHZ_RGyzrQ@mail.gmail.com>
     [not found]             ` <CA+CgW8cqN4W93h8Y3XNEq5oVynq7gYosTqQz5Kt6Pdfp=Cu2xg@mail.gmail.com>
     [not found]               ` <CA+CgW8d+u4KzOR=PDqKfSwztKGh-By6eiCremVLKMEv6tWMQOw@mail.gmail.com>
     [not found]                 ` <CA+CgW8dOzcuGLyCd6EZv4hDB5ArPKSBdrLcSTpXgUuZ_R65-PA@mail.gmail.com>
2016-05-26  1:30                   ` Question about the usage of spinlock 조현권
2016-05-26 11:07                     ` Xu, Quan
2016-05-26 14:50                       ` Julien Grall
2016-05-26 16:11                     ` Dario Faggioli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464279074.21930.136.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=chkwon91@gmail.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).