summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorJeff Furlong <jeff.furlong@wdc.com>2018-11-02 11:17:31 -0600
committerJens Axboe <axboe@kernel.dk>2018-11-02 11:17:31 -0600
commit290c64f219cd22cf67a94b6c5ba74a300ddc2ed3 (patch)
treeca36b4f3061587477455fd262b8123993315b7d5 /os
parent199710f5822cf22bf76107f26993a9468f93a422 (diff)
downloadfio-290c64f219cd22cf67a94b6c5ba74a300ddc2ed3.tar.gz
fio-290c64f219cd22cf67a94b6c5ba74a300ddc2ed3.tar.bz2
Fix Windows CPU count
Return the current activ CPUs rather than the maximum supported CPUs. Fixes: c479640d6208 ("Merge branch 'proc_group' of https://github.com/sitsofe/fio") Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'os')
-rw-r--r--os/os-windows-7.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/os/os-windows-7.h b/os/os-windows-7.h
index f5ddb8ef..0a6eaa3c 100644
--- a/os/os-windows-7.h
+++ b/os/os-windows-7.h
@@ -10,7 +10,7 @@ typedef struct {
/* Return all processors regardless of processor group */
static inline unsigned int cpus_online(void)
{
- return GetMaximumProcessorCount(ALL_PROCESSOR_GROUPS);
+ return GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
}
static inline void print_mask(os_cpu_mask_t *cpumask)
@@ -104,7 +104,7 @@ static inline int mask_to_group_mask(os_cpu_mask_t *cpumask, int *processor_grou
cpus_offset = 0;
group_size = 0;
while (!found && group < online_groups) {
- group_size = GetMaximumProcessorCount(group);
+ group_size = GetActiveProcessorCount(group);
dprint(FD_PROCESS, "group=%d group_start=%d group_size=%u search_cpu=%d\n",
group, cpus_offset, group_size, search_cpu);
if (cpus_offset + group_size > search_cpu)
@@ -271,7 +271,7 @@ static inline int fio_getaffinity(int pid, os_cpu_mask_t *mask)
dprint(FD_PROCESS, "current_groups=%d group_count=%d\n",
current_groups[0], group_count);
while (true) {
- group_size = GetMaximumProcessorCount(group);
+ group_size = GetActiveProcessorCount(group);
if (group_size == 0) {
log_err("fio_getaffinity: error retrieving size of "
"processor group %d\n", group);