From patchwork Fri Mar 26 21:48:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 48725 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8DFA7B7CCD for ; Sat, 27 Mar 2010 08:50:33 +1100 (EST) Received: from localhost ([127.0.0.1]:44773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvHQE-0008Pb-LX for incoming@patchwork.ozlabs.org; Fri, 26 Mar 2010 17:50:30 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvHNt-0006jQ-DR for qemu-devel@nongnu.org; Fri, 26 Mar 2010 17:48:05 -0400 Received: from [140.186.70.92] (port=35095 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvHNs-0006iN-0W for qemu-devel@nongnu.org; Fri, 26 Mar 2010 17:48:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvHNq-0004dV-Iw for qemu-devel@nongnu.org; Fri, 26 Mar 2010 17:48:03 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:59644) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvHNq-0004dL-BD for qemu-devel@nongnu.org; Fri, 26 Mar 2010 17:48:02 -0400 Received: by pwi9 with SMTP id 9so6358760pwi.4 for ; Fri, 26 Mar 2010 14:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=hdJBT8sN51nhtVBlE8qlR9BHzyF9FaMWmGlimlTO6Mw=; b=bJuV0e0yCMDXzp0KuabefhGwM6zmUMgoTCd8B8kViaw5by9gcnwc8BAuz5y77aV14w bsJYLT12z85aFjnr8FWC247oosScDWIS7UocUVLpadY9nghS9xXtF/af9i8BoBue6h3b q/2TgcAnmQRi/7UszK5ZcZ+O35LSfgzKPJzmA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=oaZ75K9UG0srx2BBmzVelNXPbgCeJFn+EYAHxGSZhwSISyud4OWnJg95ISpnKaCo6u Hvslv71ID+BrwgJCClzcVA1OavIMxK5qPHJDjtfPUpOYCq/TzNNN/XVgxTAAIgX4foO4 ehgNn7l4HgYqYmFBArKcbvkgIBIGSKK6xwz80= MIME-Version: 1.0 Received: by 10.141.51.13 with HTTP; Fri, 26 Mar 2010 14:48:01 -0700 (PDT) Date: Fri, 26 Mar 2010 23:48:01 +0200 Received: by 10.141.187.9 with SMTP id o9mr1582169rvp.211.1269640081108; Fri, 26 Mar 2010 14:48:01 -0700 (PDT) Message-ID: From: Blue Swirl To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 1/2] Refactor numa mode setting X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Blue Swirl --- vl.c | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/vl.c b/vl.c index f12363c..ca568b2 100644 --- a/vl.c +++ b/vl.c @@ -2927,6 +2927,20 @@ static bool tcg_cpu_exec(void) return tcg_has_work(); } +static void set_numa_modes(void) +{ + CPUState *env; + int i; + + for (env = first_cpu; env != NULL; env = env->next_cpu) { + for (i = 0; i < nb_numa_nodes; i++) { + if (node_cpumask[i] & (1 << env->cpu_index)) { + env->numa_node = i; + } + } + } +} + static int vm_can_run(void) { if (powerdown_requested) @@ -3735,7 +3749,6 @@ int main(int argc, char **argv, char **envp) const char *chroot_dir = NULL; const char *run_as = NULL; #endif - CPUState *env; int show_vnc_port = 0; int defconfig = 1; @@ -4851,13 +4864,7 @@ int main(int argc, char **argv, char **envp) sighandler_setup(); #endif - for (env = first_cpu; env != NULL; env = env->next_cpu) { - for (i = 0; i < nb_numa_nodes; i++) { - if (node_cpumask[i] & (1 << env->cpu_index)) { - env->numa_node = i; - } - } - } + set_numa_modes(); current_machine = machine;