search for: num_online_cpus

Displaying 20 results from an estimated 123 matches for "num_online_cpus".

2006 Jul 31
1
[PATCH 5/6] xen, tools: calculate nr_cpus via num_online_cpus
Once Xen calculates nr_nodes properly, all nr_cpu calculations based on nr_nodes * sockets_per_node * cores_per_socket * threads_per_core are broken. The easy fix is to replace those calculations with a new field, nr_cpus in physinfo which is calculated by num_online_cpus(). This patch does so and attempts to change all users over to nr_cpus field in physinfo. This patch touches arch/ia64/xen/dom0_ops.c, but I''ve not done any IA64 testing with this patch applied. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9...
2007 Oct 19
4
[PATCH] nr_cpus calculation problem due to incorrect sockets_per_node
...n this case, since Xen cuts off recognized CPUs at 32, the machine appears to have 16 CPUs on the first and second nodes and none on the remaining nodes. Given this asymmetry, the calculation of sockets_per_node (which is later used to calculate nr_cpus) is incorrect: pi->sockets_per_node = num_online_cpus() /(num_online_nodes() * pi->cores_per_socket * pi->threads_per_core); The most straightforward solution is to remove sockets_per_node, and instead determine nr_cpus directly from num_online_cpus. This patch has been tested on x86_64 NUMA machines. -- Elizabeth Kon (Beth) IBM Linux Tech...
2016 Nov 25
7
[PATCH net-next] virtio-net: enable multiqueue by default
...b/drivers/net/virtio_net.c @@ -1886,8 +1886,11 @@ static int virtnet_probe(struct virtio_device *vdev) if (vi->any_header_sg) dev->needed_headroom = vi->hdr_len; - /* Use single tx/rx queue pair as default */ - vi->curr_queue_pairs = 1; + /* Enable multiqueue by default */ + if (num_online_cpus() >= max_queue_pairs) + vi->curr_queue_pairs = max_queue_pairs; + else + vi->curr_queue_pairs = num_online_cpus(); vi->max_queue_pairs = max_queue_pairs; /* Allocate/initialize the rx/tx queues, and invoke find_vqs */ @@ -1918,6 +1921,8 @@ static int virtnet_probe(struct virtio_...
2016 Nov 25
7
[PATCH net-next] virtio-net: enable multiqueue by default
...b/drivers/net/virtio_net.c @@ -1886,8 +1886,11 @@ static int virtnet_probe(struct virtio_device *vdev) if (vi->any_header_sg) dev->needed_headroom = vi->hdr_len; - /* Use single tx/rx queue pair as default */ - vi->curr_queue_pairs = 1; + /* Enable multiqueue by default */ + if (num_online_cpus() >= max_queue_pairs) + vi->curr_queue_pairs = max_queue_pairs; + else + vi->curr_queue_pairs = num_online_cpus(); vi->max_queue_pairs = max_queue_pairs; /* Allocate/initialize the rx/tx queues, and invoke find_vqs */ @@ -1918,6 +1921,8 @@ static int virtnet_probe(struct virtio_...
2007 Sep 08
4
[PATCH] Unified shutdown code
...; ; ) - safe_halt(); - } + if ( type != TEARDOWN_TYPE_EARLY ) + local_irq_enable(); /* * Stop all CPUs and turn off local APICs and the IO-APIC, so * other OSs see a clean IRQ state. */ - smp_send_stop(); - disable_IO_APIC(); + printk("num_online_cpus=%d\n", num_online_cpus()); + if ( num_online_cpus() > 1 ) + smp_send_stop(); + + if ( type != TEARDOWN_TYPE_EARLY ) + disable_IO_APIC(); + hvm_cpu_down(); + + /* BSP needs to wait until all APs have gone through shutdown (disabled */ + /* VMX, etc.) before TXT...
2008 Jul 16
2
[PATCH] stopmachine: add stopmachine_timeout v2
...rnel/sysctl.c | 15 +++++++++++++ 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 5b72c2b..2968b8a 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -35,15 +35,18 @@ struct stop_machine_data { }; /* Like num_online_cpus(), but hotplug cpu uses us, so we need this. */ -static unsigned int num_threads; +static atomic_t num_threads; static atomic_t thread_ack; +static cpumask_t prepared_cpus; static struct completion finished; static DEFINE_MUTEX(lock); +unsigned long stopmachine_timeout = 200; /* msecs, arbitra...
2008 Jul 16
2
[PATCH] stopmachine: add stopmachine_timeout v2
...rnel/sysctl.c | 15 +++++++++++++ 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 5b72c2b..2968b8a 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -35,15 +35,18 @@ struct stop_machine_data { }; /* Like num_online_cpus(), but hotplug cpu uses us, so we need this. */ -static unsigned int num_threads; +static atomic_t num_threads; static atomic_t thread_ack; +static cpumask_t prepared_cpus; static struct completion finished; static DEFINE_MUTEX(lock); +unsigned long stopmachine_timeout = 200; /* msecs, arbitra...
2016 Nov 25
0
[PATCH net-next] virtio-net: enable multiqueue by default
...Horman <nhorman at redhat.com> > Cc: Jeremy Eder <jeder at redhat.com> > Cc: Marko Myllynen <myllynen at redhat.com> > Cc: Maxime Coquelin <maxime.coquelin at redhat.com> > Signed-off-by: Jason Wang <jasowang at redhat.com> OK at some level but all uses of num_online_cpus() like this are racy versus hotplug. I know we already have this bug but shouldn't we fix it before we add more? > --- > drivers/net/virtio_net.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_ne...
2008 Jul 17
1
[PATCH] stopmachine: add stopmachine_timeout v4
...chine_run: freeze the machine on all CPUs and run this function * @fn: the function to run diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 5b72c2b..9059b9e 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -35,15 +35,18 @@ struct stop_machine_data { }; /* Like num_online_cpus(), but hotplug cpu uses us, so we need this. */ -static unsigned int num_threads; +static atomic_t num_threads; static atomic_t thread_ack; +static cpumask_t prepared_cpus; static struct completion finished; static DEFINE_MUTEX(lock); +unsigned long stopmachine_timeout; /* msecs, default is 0...
2008 Jul 17
1
[PATCH] stopmachine: add stopmachine_timeout v4
...chine_run: freeze the machine on all CPUs and run this function * @fn: the function to run diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 5b72c2b..9059b9e 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -35,15 +35,18 @@ struct stop_machine_data { }; /* Like num_online_cpus(), but hotplug cpu uses us, so we need this. */ -static unsigned int num_threads; +static atomic_t num_threads; static atomic_t thread_ack; +static cpumask_t prepared_cpus; static struct completion finished; static DEFINE_MUTEX(lock); +unsigned long stopmachine_timeout; /* msecs, default is 0...
2008 Aug 08
1
Dom0 vCPU restriction
Is there any technical reason for restricting dom0_max_vcpus to be no greater than num_online_cpus()? Since Dom0''s vCPU-s can be pinned later to a subset of physical CPUs anyway, allowing more vCPU-s from the beginning would seem to be only consistent. Thanks, Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensour...
2014 Sep 15
1
[PATCH 2/2] virtio-rng: fix stuck in catting hwrng attributes
...k, it is a bug elsewehere. > Problem only occurred in non-smp guest, we can improve it to: > > if(!is_smp()) > schedule_timeout_interruptible(10); > > is_smp() is only available for arm arch, we need a general one. (It is num_online_cpus() > 1.)
2014 Sep 15
1
[PATCH 2/2] virtio-rng: fix stuck in catting hwrng attributes
...k, it is a bug elsewehere. > Problem only occurred in non-smp guest, we can improve it to: > > if(!is_smp()) > schedule_timeout_interruptible(10); > > is_smp() is only available for arm arch, we need a general one. (It is num_online_cpus() > 1.)
2008 Jul 14
1
[PATCH] stopmachine: add stopmachine_timeout
On Monday 14 July 2008 21:51:25 Christian Borntraeger wrote: > Am Montag, 14. Juli 2008 schrieb Hidetoshi Seto: > > + /* Wait all others come to life */ > > + while (cpus_weight(prepared_cpus) != num_online_cpus() - 1) { > > + if (time_is_before_jiffies(limit)) > > + goto timeout; > > + cpu_relax(); > > + } > > + > > Hmm. I think this could become interesting on virtual machines. The > hypervisor might be to busy to schedule a specific cpu at certain load > sce...
2008 Jul 14
1
[PATCH] stopmachine: add stopmachine_timeout
On Monday 14 July 2008 21:51:25 Christian Borntraeger wrote: > Am Montag, 14. Juli 2008 schrieb Hidetoshi Seto: > > + /* Wait all others come to life */ > > + while (cpus_weight(prepared_cpus) != num_online_cpus() - 1) { > > + if (time_is_before_jiffies(limit)) > > + goto timeout; > > + cpu_relax(); > > + } > > + > > Hmm. I think this could become interesting on virtual machines. The > hypervisor might be to busy to schedule a specific cpu at certain load > sce...
2016 Nov 28
1
[PATCH net-next] virtio-net: enable multiqueue by default
...at.com> >> Cc: Jeremy Eder <jeder at redhat.com> >> Cc: Marko Myllynen <myllynen at redhat.com> >> Cc: Maxime Coquelin <maxime.coquelin at redhat.com> >> Signed-off-by: Jason Wang <jasowang at redhat.com> > > OK at some level but all uses of num_online_cpus() > like this are racy versus hotplug. > I know we already have this bug but shouldn't we fix it > before we add more? This is more being used like a heuristic in this scenerio, and in fact I would say one would keep the code this way even once proper hotplug handlers are installed to...
2016 Nov 28
1
[PATCH net-next] virtio-net: enable multiqueue by default
...at.com> >> Cc: Jeremy Eder <jeder at redhat.com> >> Cc: Marko Myllynen <myllynen at redhat.com> >> Cc: Maxime Coquelin <maxime.coquelin at redhat.com> >> Signed-off-by: Jason Wang <jasowang at redhat.com> > > OK at some level but all uses of num_online_cpus() > like this are racy versus hotplug. > I know we already have this bug but shouldn't we fix it > before we add more? This is more being used like a heuristic in this scenerio, and in fact I would say one would keep the code this way even once proper hotplug handlers are installed to...
2005 Oct 10
13
[PATCH] 0/2 VCPU creation and allocation
I''ve put together two patches. The first introduces a new dom0_op, set_max_vcpus, which with an associated variable and a check in the VCPUOP handler fixes [1]bug 288. Also included is a new VCPUOP, VCPUOP_create, which handles all of the vcpu creation tasks and leaves initialization and unpausing to VCPUOP_initialize. The separation allows for build-time allocation of vcpus which
2007 Oct 23
2
[PATCH][cpufreq] Xen support for the ondemand governor [2/2] (linux)
...s_calc_load(struct cpu_dbs_info_s *this_dbs_info) +{ + int load = 0; + struct xen_platform_op op; + uint64_t idletime[NR_CPUS]; + uint64_t totaltime[NR_CPUS]; + struct cpufreq_policy *policy; + unsigned int j; + + op.cmd = XENPF_getidletime; + op.u.getidletime.max_cpus = num_online_cpus(); + set_xen_guest_handle(op.u.getidletime.idletime, idletime); + set_xen_guest_handle(op.u.getidletime.totaltime, totaltime); + HYPERVISOR_platform_op(&op); + + policy = this_dbs_info->cur_policy; + for_each_cpu_mask(j, policy->cpus) { + cputime64_t total_idle_ticks...
2013 Nov 11
1
[PATCH] x86/idle: reduce contention on ACPI register accesses
...3,8 +563,8 @@ static void acpi_processor_idle(void) { /* Enable bus master arbitration */ spin_lock(&c3_cpu_status.lock); - acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); - c3_cpu_status.count--; + if ( c3_cpu_status.count-- == num_online_cpus() ) + acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); spin_unlock(&c3_cpu_status.lock); } @@ -821,12 +821,10 @@ static int check_cx(struct acpi_processo return -EINVAL; /* All the logic here assumes flags.bm_check is same across all...