aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/cpupool.c
Commit message (Collapse)AuthorAgeFilesLines
* cpupools: update domU's node-affinity on the cpupool_unassign_cpu() pathDario Faggioli2013-09-301-0/+6
| | | | | | | | | that is, when a cpu is remove from a pool, as it is happening already on the cpupool_assign_cpu_*() path (i.e., when a cpu is added to a pool). Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* cpupool: prevent a domain from moving itselfDaniel De Graaf2013-04-231-6/+2
| | | | | | | | | In the XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN operation, the existing check for domid == 0 should be checking that a domain does not attempt to modify its own cpupool; fix this by using rcu_lock_remote_domain_by_id. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* x86/S3: Fix cpu pool scheduling after suspend/resumeBen Guthro2013-04-191-11/+45
| | | | | | | | | | | | | | | | | | | | | | | | | This review is another S3 scheduler problem with the system_state variable introduced with the following changeset: http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=269f543ea750ed567d18f2e819e5d5ce58eda5c5 Specifically, the cpu_callback function that takes the CPU down during suspend, and back up during resume. We were seeing situations where, after S3, only CPU0 was in cpupool0. Guest performance suffered greatly, since all vcpus were only on a single pcpu. Guests under high CPU load showed the problem much more quickly than an idle guest. Removing this if condition forces the CPUs to go through the expected online/offline state, and be properly scheduled after S3. This also includes a necessary partial change proposed earlier by Tomasz Wroblewski here: http://lists.xen.org/archives/html/xen-devel/2013-01/msg02206.html It should also resolve the issues discussed in this thread: http://lists.xen.org/archives/html/xen-devel/2012-11/msg01801.html Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* xen, libxc: rename xenctl_cpumap to xenctl_bitmapDario Faggioli2013-04-171-2/+2
| | | | | | | | | | | | | | | | | | More specifically: 1. replaces xenctl_cpumap with xenctl_bitmap 2. provides bitmap_to_xenctl_bitmap and the reverse; 3. re-implement cpumask_to_xenctl_bitmap with bitmap_to_xenctl_bitmap and the reverse; Other than #3, no functional changes. Interface only slightly afected. This is in preparation of introducing NUMA node-affinity maps. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Keir Fraser <keir@xen.org>
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* make domain_create() return a proper error codeJan Beulich2012-09-031-2/+6
| | | | | | | | | | | | | | While triggered by the XSA-9 fix, this really is of more general use; that fix just pointed out very sharply that the current situation with all domain creation failures reported to user (tools) space as -ENOMEM is very unfortunate (actively misleading users _and_ support personnel). Pull over the pointer <-> error code conversion infrastructure from Linux, and use it in domain_create() and all it callers. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* Introduce system_state variable.Keir Fraser2012-03-221-0/+5
| | | | | | | | | | Use it to replace x86-specific early_boot boolean variable. Also use it to detect suspend/resume case during cpu offline/online to avoid unnecessarily breaking vcpu and cpupool affinities. Signed-off-by: Keir Fraser <keir@xen.org> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* reflect cpupool in numa node affinityJuergen Gross2012-01-241-0/+9
| | | | | | | | | 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>
* sched_sedf: Avoid panic when adjusting sedf parametersJuergen Gross2011-11-181-3/+3
| | | | | | | | | | 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>
* eliminate first_cpu() etcJan Beulich2011-11-081-1/+1
| | | | | | | | This includes the conversion from for_each_cpu_mask() to for_each-cpu(). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
* eliminate cpu_clear()Jan Beulich2011-11-081-2/+2
| | | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
* eliminate cpu_set()Jan Beulich2011-11-081-4/+4
| | | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
* eliminate cpu_test_xyz()Jan Beulich2011-11-081-2/+2
| | | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
* cpupools: allocate CPU masks dynamicallyJan Beulich2011-10-211-13/+20
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* eliminate cpumask accessors referencing NR_CPUSJan Beulich2011-10-211-1/+1
| | | | | | | ... in favor of using the new, nr_cpumask_bits-based ones. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* introduce and use nr_cpu_ids and nr_cpumask_bitsJan Beulich2011-10-211-2/+2
| | | | | | | | | | | | | | | The former is the runtime equivalent of NR_CPUS (and users of NR_CPUS, where necessary, get adjusted accordingly), while the latter is for the sole use of determining the allocation size when dynamically allocating CPU masks (done later in this series). Adjust accessors to use either of the two to bound their bitmap operations - which one gets used depends on whether accessing the bits in the gap between nr_cpu_ids and nr_cpumask_bits is benign but more efficient. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* use xzalloc in common codeJan Beulich2011-10-041-2/+1
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* xen: remove extern function declarations from C files.Tim Deegan2011-05-261-2/+0
| | | | | | | | Move all extern declarations into appropriate header files. This also fixes up a few places where the caller and the definition had different signatures. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* cpupool: Fix __cpupool_find_by_id(), clean up accessor functions.Keir Fraser2011-02-091-8/+18
| | | | | | | | | | Firstly, __cpupool_find_by_id() would dereference NULL, at the end of an exact search if the search loop exited with *q==NULL. Fix this. Secondly, provide suitable accessor functions so that no caller needs to use the __-prefixed versions which take a boolean flag. Signed-off-by: Keir Fraser <keir@xen.org>
* cpupool: Strict parameter checking for cpupool operationsKeir Fraser2011-02-091-2/+2
| | | | | | | | Some cpupool actions didn't check the cpupool_id exactly. For some actions this doesn't make any sense, so refuse those actions if the specified cpupool doesn't exist. Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* cpupool: Correct cpupool diag printingKeir Fraser2011-02-071-4/+5
| | | | | | | | Some of the cpupool_dprintk() calls are using undefined or uninitialized variables. Correct the argument lists to be able to define cpupool_printk as printk. Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* cpupool: Check for memory allocation failure on switching schedulersKeir Fraser2011-02-061-2/+19
| | | | | | | | When switching schedulers on a physical cpu due to a cpupool operation check for a potential memory allocation failure and stop the operation gracefully. Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* cpupool: Simplify locking, use refcounts for cpupool liveness.Keir Fraser2010-11-261-34/+44
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* Fix sched_adjust_global() and clean up surrounding code.Keir Fraser2010-06-171-22/+53
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* cpupools: Quieten debug messages.Keir Fraser2010-05-191-27/+27
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* cpupool: Fix CPU hotplug after recent changes.Keir Fraser2010-05-171-47/+7
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Implement cpu hotplug notifiers. Use them.Keir Fraser2010-05-141-26/+50
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* domctl: Fix cpumap/cpumask conversion functions to return an error code.Keir Fraser2010-05-121-6/+4
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* cpupools: Fix cpupool sysctl locking.Keir Fraser2010-05-061-6/+5
| | | | Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* cpupool: Control interface should be a sysctl rather than a domctl.Keir Fraser2010-05-041-12/+12
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* cpupools: optimise domain creation if pool movement is a no-opKeir Fraser2010-04-231-0/+6
| | | | Signed-off by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* cpupools [1/6]: hypervisor changesKeir Fraser2010-04-211-0/+604
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>