50 Commits
Author SHA1 Message Date
Juergen Gross bac6334b51 move domain to cpupool0 before destroying it
Currently when a domain is destroyed it is removed from the domain_list
before all of it's resources, including the cpupool membership, are freed.
This can lead to a situation where the domain is still member of a cpupool
without for_each_domain_in_cpupool() (or even for_each_domain()) being
able to find it any more. This in turn can result in rejection of removing
the last cpu from a cpupool, because there seems to be still a domain in
the cpupool, even if it can't be found by scanning through all domains.

This situation can be avoided by moving the domain to be destroyed to
cpupool0 first and then remove it from this cpupool BEFORE deleting it from
the domain_list. As cpupool0 is always active and a domain without any cpupool
membership is implicitly regarded as belonging to cpupool0, this poses no
problem.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2014-05-20 15:55:42 +02:00
Juergen Gross 6af4342276 credit2: use unique names
Avoid name duplicated with the credit scheduler. This makes live easier when
debugging with tools like cscope or crash.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
2014-05-07 16:35:24 +02:00
Juergen Gross b4fdb6da1e add cap value to credit scheduler debug info
Currently only the weight is the only scheduling parameter printed for
domains in the credit scheduler key handler. Add the cap value to be
printed as well.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2013-10-16 12:28:04 +02:00
Juergen Gross d38a668b6e credit: unpause parked vcpu before destroying it
A capped out vcpu must be unpaused in case of moving it to another cpupool,
otherwise it will be paused forever.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2013-10-16 12:26:48 +02:00
Juergen Gross 69962e19ed Correct X2-APIC HVM emulation
commit 6859874b61 ("x86/HVM: fix x2APIC
APIC_ID read emulation") introduced an error for the hvm emulation of
x2apic. Any try to write to APIC_ICR MSR will result in a GP fault.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2013-08-22 11:24:00 +02:00
Juergen Gross 482300def7 Avoid stale pointer when moving domain to another cpupool
When a domain is moved to another cpupool the scheduler private data pointers
in vcpu and domain structures must never point to an already freed memory
area.

While at it, simplify sched_init_vcpu() by using DOM2OP instead VCPU2OP.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2013-02-28 14:56:45 +00:00
Juergen Gross 3ba9b5c6ad build: Correct typo introduced by c/s:25334
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-06-08 16:39:24 +01:00
Juergen Gross 3a8a0f0e10 Add xlcpupool.cfg man page
Add a man page describing the configuration file for creating cpupools
via xl cpupool-create.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-20 18:26:44 +00:00
Juergen Gross b3b15b7611 reflect cpupool in numa node affinity
In order to prefer node local memory for a domain the numa node
locality info must be built according to the cpus belonging to the
cpupool of the domain.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
2012-01-24 14:21:12 +00:00
Juergen Gross 79cf2c4c4f switch to dynamically allocated cpumask in domain_update_node_affinity()
cpumasks should rather be allocated dynamically.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
2012-01-24 14:20:40 +00:00
Juergen Gross 9b80635f9d introduce and use common macros for selecting cpupool based cpumasks
There are several instances of the same construct finding the cpumask
for a cpupool. Use macros instead.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Keir Fraser <keir@xen.org>
2012-01-24 14:19:58 +00:00
Juergen Gross 696f3581a2 x86/hvm: Allow wake up of offline vcpu via nmi-ipi
On a real machine a cpu disabled via hlt with interrupts disabled can
be reactivated via a nmi ipi. Enable the hypervisor to do this for
hvm, too.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
2012-01-20 10:17:12 +00:00
Juergen Gross d166bd34e8 Support of xl sched-sedf
Supports the xl subcommand sched-sedf.
The man page is only a minimal version (copy from xm man page without
examples). BTW: the xm man page seems not to be in sync with xm sched-sedf -h
regarding the time units. I used milliseconds in the xl implementation.
Only minimal semantical checks of parameters.

Signed-off-by: juergen.gross@ts.fujitsu.com
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-11-28 13:37:17 +01:00
Juergen Gross 5f3713211c Correct error message in libxl_sched_credit_domain_get()
Just a typo...

Signed-off-by: juergen.gross@ts.fujitsu.com
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-11-28 13:31:37 +01:00
Juergen Gross aea984916c Support of xl sched-credit2
Supports the xl subcommand sched-credit2.

Signed-off-by: juergen.gross@ts.fujitsu.com
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-11-28 13:31:27 +01:00
Juergen Gross 31c2ace79d Support cpupools in xl sched-credit
Adds cpupool awareness to output of xl sched-credit. Output can now be
restricted to a specific cpupool. The domains are printed for each cpupool
seperately.

The loop over cpupools and domains is seperated from the main command
implementation to be able to support other schedulers as well.

Signed-off-by: juergen.gross@ts.fujitsu.com
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-11-28 13:27:15 +01:00
Juergen Gross 25097df017 xl sched-credit: support long options
The help text of xl sched-credit supported long options. Neither the man page
nor the implementation did.

Signed-off-by: juergen.gross@ts.fujitsu.com
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-11-28 13:23:31 +01:00
Juergen Gross f42d7a66bf sched_sedf: Avoid panic when adjusting sedf parameters
When using sedf scheduler in a cpupool the system might panic when
setting sedf scheduling parameters for a domain.  Introduces
for_each_domain_in_cpupool macro as it is usable 4 times now.  Add
appropriate locking in cpupool_unassign_cpu().

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-18 13:34:43 +00:00
Juergen Gross c3ffb81943 avoid hypervisor panic when printing lock profiling information
When printing lock profiling information via keyhandler in the
hypervisor the system will panic. This patch corrects the problem.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-07 14:37:51 +00:00
Juergen Gross d98feda5c7 Make lock profiling usable again
Using lock profiling (option lock_profile in xen/Rules.mk) resulted in
build errors.
Changes:
- Include public/sysctl.h in spinlock.h when using lock profiling.
- Allocate profile data in an own structure to avoid struct domain
  becoming larger then one page

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-11-07 14:36:44 +00:00
Juergen Gross b07e31c4ab docs: Correct man page of xl regarding cpu-pools
Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-11-02 17:09:09 +00:00
Juergen Gross 69698ae657 tools/libfsimage: Avoid relative XEN_ROOT specification
XEN_ROOT must be set to an absolute path to avoid out of the tree
references

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-10-07 09:35:12 +01:00
Juergen Gross 4dd27c01c3 Avoid race in schedule() when switching schedulers
Selecting the scheduler to call must be done under lock. Otherwise a
race might occur when switching schedulers in a cpupool

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-09-17 16:19:26 +01:00
Juergen Gross 2411017e28 libxc: Enable cpuid performance counter leaf for HVM
In HVM domains the usable performance counters can be checked
automatically only, if cpuid leaf 0x0000000a is accessible.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-09-15 15:26:07 +01:00
Juergen Gross ce907519dd Use same data array for INTEL and AMD cpufreq handling
The AMD and INTEL specific parts of cpufreq handling used different
per-cpu data structures with nearly identical semantics.  Fold the two
structures into one by adding a generic architecture data item.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2011-06-16 16:12:20 +01:00
Juergen Gross 825bc99c9d tools: xenstored: make usage info of xenstored accurate
The usage printed for xenstored was not in sync with the parameters
defined in the code.

Signed-off-by: juergen.gross@ts.fujitsu.com
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-31 19:27:40 +01:00
Juergen Gross e1255ac77e Avoid endless loop for vcpu migration.
Only call SCHED_OP(pick_cpu) if a previously picked cpu is not
suitable on the current iteration of the retry loop.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-03-15 10:14:27 +00:00
Juergen Gross 2e13a886e5 Avoid possible live-lock in vcpu_migrate
If vcpu_migrate is called for two vcpus active on different cpus
resulting in swapping the cpus, a live-lock could occur as both
instances try to take the scheduling lock of the physical cpus in
opposite order.

To avoid this problem the locks are always taken in the same order
(sorted by the address of the lock).

Signed-off-by: Jueregn Gross <juergen.gross@ts.fujitsu.com>
2011-02-28 15:09:33 +00:00
Juergen Gross 53582e3da0 cpupool: Avoid race when moving cpu between cpupools
Moving cpus between cpupools is done under the schedule lock of the
moved cpu.  When checking a cpu being member of a cpupool this must be
done with the lock of that cpu being held.  Hot-unplugging of physical
cpus might encounter the same problems, but this should happen only
very rarely.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-02-25 11:28:15 +00:00
Juergen Gross a9dd01431a xl cpupool-numa-split: reduce number of Dom0 vcpus
When reducing the number of physical cpus available for Domain-0 by xl
cpupool-numa-split, reduce the number of vcpus accordingly.

Signed-off-by: juergen.gross@ts.fujitsu.com
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-17 19:39:13 +00:00
Juergen Gross fb37da1031 xl: Support more than 32 vcpus for xl vcpu-set
xl vcpu-set currently uses a 32 bit mask for specifying which cpus are to be
set online. This restricts the number of cpus supported by this command.

The patch switches to libxl_cpumap, the interface of libxl_set_vcpuonline()
is changed accordingly.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-14 16:56:20 +00:00
Juergen Gross b948a2f41a xl: correct xl cpupool-create with extra parameters
xl cpupool-create won't take always extra parameters specified on the command
line, as a 0-byte is missing at the end of the configuration file contents.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-14 16:55:00 +00:00
Juergen Gross 32e7954462 Cpupools: vcpu affinity handling
If a vcpu is pinned to multiple physical cpus, the pinning is not
removed if all those physical cpus are removed from the cpupool. When
disabling the scheduler on a cpu, the affinity mask must be checked
against the cpumask of the cpupool.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2011-02-10 09:02:50 +00:00
Juergen Gross 852c37f5a8 xl: fix broken cpupool-numa-split
The implementation of xl cpupool-numa-split is broken.  It adds nodes
to the wrong pool.  This was probably a copy and paste error which
happened when libxl_cpupool_cpuadd_node() was introduced.

Reported-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-28 17:41:15 +00:00
Juergen Gross 223965ab11 Support new xl command cpupool-numa-split
New xl command cpupool-numa-split which will create one cpupool for each
numa node of the machine. Can be called only if no other cpupools than Pool 0
are defined. After creation the cpupools can be managed as usual.

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-09 11:50:53 +01:00
Juergen Gross d567ebfef1 Support renaming of cpupools
Add a new library function libxl_cpupool_rename() and a new xl command
xl cpupool-rename to support renaming of cpupools.

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-09 13:37:32 +01:00
Juergen Gross 4f4f69baa5 Extend cpupools to support numa
The user interfaces for cpupools are extended to support numa machines:
- xl cpupool-create supports now specifying a node list instead of a cpu list.
  The new cpupool will be created with all free cpus of the specified numa
  nodes.
- xl cpupool-cpu-remove and xl cpupool-cpu-add can take a node number instead
  of a cpu number. Using 'node:1' for the cpu parameter will, depending on
  the operation, either remove all cpus of node 1 in the specified cpupool,
  or add all free cpus of node 1 to the cpupool.

libxl is extended with the following functions to support this feature:
int libxl_cpupool_cpuadd_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus)
int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus)

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-09 11:26:37 +01:00
Juergen Gross 1583cc1c1e support topolgy info in xl info
Adds option -n/--numa to xl info command to print topology information.
No numa information up to now, as I've no machine which will give this info
via xm info (could be a bug in xm, however).

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-09 11:23:20 +01:00
Juergen Gross 93039a68a5 Support getting topology info in libxl
Added new function libxl_get_topologyinfo() to obtain this information from
hypervisor.

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
2010-12-09 11:21:30 +01:00
Juergen Gross 18ed5fb3b5 add missing libxl__free_all() calls
In various libxl functions libxl__free_all() was missing before return

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-12-09 14:50:56 +01:00
Juergen Gross 8e6048545a tools/python: Rebuild python extensions if depends have changed
Adds depends information for building python extensions.
The extensions depend on the library binaries they are using.

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-10 18:13:15 +00:00
Juergen Gross 9d679c393b tools: Add xl python bindings for cpumap
Signed-off-by: juergen.gross@ts.fujitsu.com
2010-11-23 19:35:09 +00:00
Juergen Gross 9180abe568 tools: change cpumaps to uint8_t
Cpumap types in tools (libxc and libxl) are changed to be based on bytes like
in the interface to the hypervisor.
To make handling easier the size of used cpumaps is always based on the
number of physical cpus supported by the hypervisor. This eliminates the need
to keep track of the cpumap size in external interfaces.
In libxl a macro for cycling through a cpumap is added (libxl_for_each_cpu).

Interfaces changed:
libxl_set_vcpuaffinity()
libxl_cpumap_alloc()
xc_vcpu_setaffinity()
xc_vcpu_getaffinity()
xc_cpupool_freeinfo()

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-03 12:10:46 +00:00
Juergen Gross e57101211f avoid numa placement of cpus with active cpupools
When using cpupools don't pin vcpus to numa nodes as this might
conflict with the cpupool definition.
numa placement should be handled by cpupool configuration instead.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-10-28 12:22:09 +01:00
Juergen Gross 49fa0e868f tools: cpupools: add example cpupool config file
Adds an example configuration file for xm/xl pool-create

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-10-21 18:36:57 +01:00
Juergen Gross f66601c562 tools: cpupools: xl: commands and library changes
Support of cpu pools in libxl and xl:
  library functions
  xl cpupool-create
  xl cpupool-list
  xl cpupool-destroy
  xl cpupool-cpu-add
  xl cpupool-cpu-remove
  xl cpupool-migrate
Renamed all cpu pool related names to *cpupool*

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-10-21 18:36:22 +01:00
Juergen Gross 18dd3dbdf2 tools: cpupools: Rename cpu-pool commands in xm to cpupool-*
The xm commands pool-* are renamed to cpupool-*
The old pool-* commands are defined as aliases.

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

--HG--
rename : tools/python/xen/xm/pool-create.py => tools/python/xen/xm/cpupool-create.py
rename : tools/python/xen/xm/pool-new.py => tools/python/xen/xm/cpupool-new.py
rename : tools/python/xen/xm/pool.py => tools/python/xen/xm/cpupool.py
2010-10-21 18:35:18 +01:00
Juergen Gross 63c5ef9841 tools: cpupools: Support arbitrary numbers of physical cpus
To be able to support arbitrary numbers of physical cpus it was necessary to
include the size of cpumaps in the xc-interfaces for cpu pools.
These were:
  definition of xc_cpupoolinfo_t
  xc_cpupool_getinfo()
  xc_cpupool_freeinfo()
xc_cpupool_getinfo() and xc_cpupool_freeinfo() are changed to allocate the
needed buffer and return it.

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-10-21 18:32:56 +01:00
Juergen Gross 33c3ef4f76 xl: correct vcpu-pin and vcpu-list parameter checking
attached patch corrects parameter checking of vcpu-pin and vcpu-list
sub-commands.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-09-16 18:29:26 +01:00
Juergen Gross 058f27228c libxl: fix memory leak in libxl_name_to_poolid
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-08-05 11:33:13 +01:00