* [PATCH] fix windows cpu count
@ 2018-11-02 16:44 Jeff Furlong
2018-11-02 16:54 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Furlong @ 2018-11-02 16:44 UTC (permalink / raw)
To: fio
This patch resolves c479640d6208236744f0562b1e79535eec290e2b where the CPU count returns max possible supported CPUs, and instead returns current active CPUs.
diff --git a/os/os-windows-7.h b/os/os-windows-7.h index f5ddb8e..0a6eaa3 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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fix windows cpu count
2018-11-02 16:44 [PATCH] fix windows cpu count Jeff Furlong
@ 2018-11-02 16:54 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2018-11-02 16:54 UTC (permalink / raw)
To: Jeff Furlong, fio
On 11/2/18 10:44 AM, Jeff Furlong wrote:
> This patch resolves c479640d6208236744f0562b1e79535eec290e2b where the
> CPU count returns max possible supported CPUs, and instead returns
> current active CPUs.
I'd like to apply this patch, but your mailer has completely
botched it up. It's damaging white space (turning tabs into
spaces), and breaking up lines that it thinks are too long.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-03 1:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-02 16:44 [PATCH] fix windows cpu count Jeff Furlong
2018-11-02 16:54 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.