|
From: | Mike Day |
Subject: | Re: [Qemu-devel] [RFC PATCH v2] PPC: smp: autodetect numbers of threads per core |
Date: | Thu, 09 Jan 2014 16:00:58 -0500 |
User-agent: | Notmuch/0.16 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-redhat-linux-gnu) |
Alexey Kardashevskiy <address@hidden> writes: > /* compute missing values, prefer sockets over cores over threads */ > if (cpus == 0 || sockets == 0) { > sockets = sockets > 0 ? sockets : 1; > cores = cores > 0 ? cores : 1; > - threads = threads > 0 ? threads : 1; > + if (threads_max) { > + if (threads > 0) { > + fprintf(stderr, "Use either threads or threads_max\n"); > + exit(1); If you went ahead with the threads="max" string option you wouldn't need to check here for mutual excusivity and the user wouldn't need to worry about an extra command options. > + } > + threads = smp_threads > 0 ? smp_threads : 1; > + } else { > + threads = threads > 0 ? threads : 1; > + } > if (cpus == 0) { > cpus = cores * threads * sockets; > } -- Mike Day | "Endurance is a Virtue"
[Prev in Thread] | Current Thread | [Next in Thread] |