aboutsummaryrefslogtreecommitdiffstats
path: root/tools/memshr
Commit message (Collapse)AuthorAgeFilesLines
* tools: memshr: arm64 supportIan Campbell2013-04-111-12/+36
| | | | | | | | | | | | | | | | | | | | I'm not mad keen on propagating these sorts of asm atomic operations throughout our code base. Other options would be: - use libatomic-ops, http://www.hpl.hp.com/research/linux/atomic_ops/, although this doesn't seem to be as widespread as I would like (not in RHEL5 for example) - use a pthread lock. This is probably the simplest/best option but I wasn't able to figure out the locking hierarchy of this code So I've copped out and just copied the appropriate inlines here. I also nuked some stray ia64 support and fixed a coment in the arm32 version while I was here. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* arm: compile memshrStefano Stabellini2012-05-301-0/+31
| | | | | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <Ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* Use memops for mem paging, sharing, and access, instead of domctlsAndres Lagar-Cavilla2012-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Per page operations in the paging, sharing, and access tracking subsystems are all implemented with domctls (e.g. a domctl to evict one page, or to share one page). Under heavy load, the domctl path reveals a lack of scalability. The domctl lock serializes dom0's vcpus in the hypervisor. When performing thousands of per-page operations on dozens of domains, these vcpus will spin in the hypervisor. Beyond the aggressive locking, an added inefficiency of blocking vcpus in the domctl lock is that dom0 is prevented from re-scheduling any of its other work-starved processes. We retain the domctl interface for setting up and tearing down paging/sharing/mem access for a domain. But we migrate all the per page operations to use the memory_op hypercalls (e.g XENMEM_*). Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla> Signed-off-by: Adin Scannell <adin@scannell.ca> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* Update memshr API and toolsAndres Lagar-Cavilla2012-01-264-29/+58
| | | | | | | | | | | | | | | | | | | | | | | This patch is the folded version of API updates, along with the associated tool changes to ensure that the build is always consistent. API updates: - The source domain in the sharing calls is no longer assumed to be dom0. - Previously, the mem sharing code would return an opaque handle to index shared pages (and nominees) in its global hash table. By removing the hash table, the handle becomes a version, to avoid sharing a stale version of a page. Thus, libxc wrappers and tools need to be updated to recall the share functions with the information needed to fetch the page (which they readily have). Tool updates: The only (in-tree, that we know of) consumer of the mem sharing API is the memshr tool. This is updated to use the new API. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Adin Scannell <adin@scannell.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* Add correct const-ness to memshr tool functionsAndres Lagar-Cavilla2012-01-104-4/+4
| | | | | | | | | | This patch addresses some of the compile and link issues with the memshr module. Signed-off-by: Adin Scannell <adin@scannell.ca> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: drop further uses of -Wp,-MD,.$(@F).d to generate dependencies.Ian Campbell2011-03-231-4/+0
| | | | | | | | | | 19025:bd78714b8594 switched to "-MMD -MF" in preference, adding the correct runes to tools/Rules.mk but appears to have missed some other uses of -Wp,... Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: consistently use $(CFLAGS_xeninclude) instead of open coding.Ian Campbell2011-03-211-1/+1
| | | | | | | | Renamed from the slightly ambiguous CFLAGS_include. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* build: Make XEN_ROOT an absolute path.Keir Fraser2011-03-171-1/+1
| | | | | | | | Otherwise make can search the path relative to certain standard paths such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in Config.mk suffers from this). Signed-off-by: Keir Fraser <keir@xen.org>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-3/+3
| | | | | | | | | | | | | | | | | | | | This patch eliminate the global variables in libxenctrl (used for logging and error reporting). Instead the information which was in the global variables is now in a new xc_interface* opaque structure, which xc_interface open returns instead of the raw file descriptor; furthermore, logging is done via xentoollog. There are three new parameters to xc_interface_open to control the logging, but existing callers can just pass "0" for all three to get the old behaviour. All libxc callers have been adjusted accordingly. Also update QEMU_TAG for corresponding qemu change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* memshr: Must be built on ia64 as well as x86, as blktap depends on it.Keir Fraser2009-12-281-12/+22
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* memshr: Build fixesKeir Fraser2009-12-281-5/+21
| | | | | | | | * Build memshr/xenpaging on x86/Linux only * Remove dependency on GCC 4.1+ __sync_*() intrinsics. Signed-off-by: Keir Fraser <keir.fraser@citrix.com> Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
* Make Citrix copyright strinsg consistent.Keir Fraser2009-12-1810-10/+10
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* memshr: Include unistd.h for sleep().Keir Fraser2009-12-181-0/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Maintains/cleans-up the sharing map. At the moment a simple FIFO policy isKeir Fraser2009-12-174-0/+120
| | | | | | applied. Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* Reads from read only parent disk images are intercepted, and are used to detectKeir Fraser2009-12-172-0/+100
| | | | | | potentially sharable memory pages. Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* Multiple tapdisk2 processes may use the same parent disk images (later used toKeir Fraser2009-12-174-6/+124
| | | | | | | | detect sharable memory pages). This patch establishes unique id for each disk image opened by tapdisk2, and stores it in shared memory region, thus making it available to the remaining tapdisk2s. Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* Adds 'memory_sharing' option to domain config scripts. It passes domain id toKeir Fraser2009-12-172-0/+17
| | | | | | | the tapdisk2 process if sharing is enabled (tapdisk2 is not normally aware what domain it is working for). Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* Generic bi-directional map, and related initialisation functions. At the momentKeir Fraser2009-12-179-0/+1887
a single map is used to store mappings between sharing handles and disk blocks. This is used to share pages which store data read of the same blocks on (virtual) disk. Note that the map is stored in a shared memory region, as it needs to be accessed by multiple tapdisk processes. This complicates memory allocation (malloc cannot be used), prevents poniters to be stored directly (as the shared memory region might and is mapped at different base address) and finally pthread locks need to be multi-process aware. Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>