From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1NqG-0005zL-Ud for qemu-devel@nongnu.org; Thu, 09 Jan 2014 17:12:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1Nq7-0001Uo-ET for qemu-devel@nongnu.org; Thu, 09 Jan 2014 17:12:44 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:52958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1Nq7-0001UT-87 for qemu-devel@nongnu.org; Thu, 09 Jan 2014 17:12:35 -0500 Received: by mail-pd0-f180.google.com with SMTP id q10so3722378pdj.25 for ; Thu, 09 Jan 2014 14:12:33 -0800 (PST) Message-ID: <52CF1ECC.3040208@ozlabs.ru> Date: Fri, 10 Jan 2014 09:12:28 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1389245648-10300-1-git-send-email-aik@ozlabs.ru> <87ppo0na45.fsf@pixel.localdomain> In-Reply-To: <87ppo0na45.fsf@pixel.localdomain> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v2] PPC: smp: autodetect numbers of threads per core List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mike Day , qemu-devel@nongnu.org Cc: Paul Mackerras , qemu-ppc@nongnu.org, Alexander Graf On 01/10/2014 08:00 AM, Mike Day wrote: > > Alexey Kardashevskiy 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. Is this the only concern and the rest is fine and can go to upstream? If so, I'll fix it and repost. >> + } >> + threads = smp_threads > 0 ? smp_threads : 1; >> + } else { >> + threads = threads > 0 ? threads : 1; >> + } >> if (cpus == 0) { >> cpus = cores * threads * sockets; >> } > -- Alexey