From: Chao Peng <chao.p.peng@linux.intel.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: wei.liu2@citrix.com, Ian.Campbell@citrix.com,
stefano.stabellini@eu.citrix.com,
Andrew Cooper <andrew.cooper3@citrix.com>,
xen-devel@lists.xen.org, JBeulich@suse.com, keir@xen.org
Subject: Re: [PATCH v2 2/5] tools: add routine to get CMT L3 event mask
Date: Thu, 8 Jan 2015 11:19:41 +0800 [thread overview]
Message-ID: <20150108031940.GF3279@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <21677.43152.114598.345965@mariner.uk.xensource.com>
On Wed, Jan 07, 2015 at 09:43:44PM +0000, Ian Jackson wrote:
> Andrew Cooper writes ("Re: [Xen-devel] [PATCH v2 2/5] tools: add routine to get CMT L3 event mask"):
> > Other culprits are xc_get_max_nodes(), xc_get_max_cpus(), 4 instances in
> > xc_psr.c and most things in xc_offline_page.c which appears to have
> > static structures for domain context. The "pluggable loader"
> > infrastructure in xc_dom.c also appears to be thread-unsafe.
> >
> > xc_dom_decompress_unsafe.c also uses static data, but "unsafe" in the
> > name might be a sufficient guard?
>
> I will look at these tomorrow.
>
> > No aggressively optimising compiler is going to perform partial writes
> > on a naturally aligned integer, so I stand by my comment when applied to
> > the common case.
>
> You misunderstand. An aggressively optimising compiler might be able
> to "prove" (perhaps through whole program analysis - we have link-time
> optimisation nowadays) various falsehoods about the way these
> variables are used.
>
> The resulting generated machine code might be arbitrarily bad, up to
> and including missing important parts of the whole program.
Does this really happen, as for this example?
>
> I'm not aware of any compilers which currently take "advantge" of
> thread safety "bugs" (really, just spec-violations) but I think this
> is just a matter of time.
I think this can be the issue. At least we should be very careful.
Or to build a common mechanism in libxc to cache something safely, using
that to replace all the static places current we have.
While I personally agree to make xc re-enterable. The cache
responsibility then can be move to top caller.
For this example, remove static in libxc and the caching for const
hypercall return value is then moved to xl. It can just 'cache' the value
in local variable. While this is not the most performance way as at least
one hypercall is needed for each xl command invocation.
Chao
>
> Ian.
next prev parent reply other threads:[~2015-01-08 3:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-07 11:12 [PATCH v2 0/5] enable Memory Bandwidth Monitoring (MBM) for VMs Chao Peng
2015-01-07 11:12 ` [PATCH v2 1/5] x86: expose CMT L3 event mask to user space Chao Peng
2015-01-07 11:12 ` [PATCH v2 2/5] tools: add routine to get CMT L3 event mask Chao Peng
2015-01-07 11:27 ` Andrew Cooper
2015-01-07 16:37 ` Ian Jackson
2015-01-07 16:54 ` Wei Liu
2015-01-07 17:04 ` Ian Campbell
2015-01-07 17:09 ` Andrew Cooper
2015-01-07 21:43 ` Ian Jackson
2015-01-08 3:19 ` Chao Peng [this message]
2015-01-07 11:12 ` [PATCH v2 3/5] tools: correct coding style for psr Chao Peng
2015-01-07 11:16 ` Wei Liu
2015-01-07 11:12 ` [PATCH v2 4/5] tools: code refactoring for MBM Chao Peng
2015-01-07 12:15 ` Wei Liu
2015-01-07 11:12 ` [PATCH v2 5/5] tools: add total/local memory bandwith monitoring Chao Peng
2015-01-07 12:23 ` Wei Liu
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=20150108031940.GF3279@pengc-linux.bj.intel.com \
--to=chao.p.peng@linux.intel.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=keir@xen.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.