From patchwork Wed Jun 23 21:09:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 107687 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5NLPt7j017888 for ; Wed, 23 Jun 2010 21:25:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753328Ab0FWVZx (ORCPT ); Wed, 23 Jun 2010 17:25:53 -0400 Received: from outbound-va3.frontbridge.com ([216.32.180.16]:11589 "EHLO VA3EHSOBE008.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753176Ab0FWVZx (ORCPT ); Wed, 23 Jun 2010 17:25:53 -0400 Received: from mail171-va3-R.bigfish.com (10.7.14.235) by VA3EHSOBE008.bigfish.com (10.7.40.28) with Microsoft SMTP Server id 8.1.340.0; Wed, 23 Jun 2010 21:10:45 +0000 Received: from mail171-va3 (localhost.localdomain [127.0.0.1]) by mail171-va3-R.bigfish.com (Postfix) with ESMTP id E2E37153051F; Wed, 23 Jun 2010 21:10:44 +0000 (UTC) X-SpamScore: -4 X-BigFish: VPS-4(zz936eMzz1202hzzz32i2a8h61h) X-Spam-TCS-SCL: 0:0 Received: from mail171-va3 (localhost.localdomain [127.0.0.1]) by mail171-va3 (MessageSwitch) id 1277327444419672_31210; Wed, 23 Jun 2010 21:10:44 +0000 (UTC) Received: from VA3EHSMHS013.bigfish.com (unknown [10.7.14.250]) by mail171-va3.bigfish.com (Postfix) with ESMTP id 5778111B8046; Wed, 23 Jun 2010 21:10:44 +0000 (UTC) Received: from ausb3extmailp02.amd.com (163.181.251.22) by VA3EHSMHS013.bigfish.com (10.7.99.23) with Microsoft SMTP Server (TLS) id 14.0.482.44; Wed, 23 Jun 2010 21:10:40 +0000 Received: from ausb3twp01.amd.com (ausb3twp01.amd.com [163.181.250.37]) by ausb3extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with SMTP id o5NLEHbD019002; Wed, 23 Jun 2010 16:14:20 -0500 X-WSS-ID: 0L4HK5L-01-AKY-02 X-M-MSG: Received: from sausexhtp01.amd.com (sausexhtp01.amd.com [163.181.3.165]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 281631028920; Wed, 23 Jun 2010 16:10:33 -0500 (CDT) Received: from storexhtp01.amd.com (172.24.4.3) by sausexhtp01.amd.com (163.181.3.165) with Microsoft SMTP Server (TLS) id 8.2.254.0; Wed, 23 Jun 2010 16:10:34 -0500 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp01.amd.com (172.24.4.3) with Microsoft SMTP Server id 8.2.254.0; Wed, 23 Jun 2010 17:10:32 -0400 Received: from localhost.localdomain (tronje.osrc.amd.com [165.204.15.48]) by gwo.osrc.amd.com (Postfix) with ESMTP id 3552C49C174; Wed, 23 Jun 2010 22:10:32 +0100 (BST) From: Andre Przywara To: CC: , , Andre Przywara Subject: [PATCH 2/3] NUMA: add parsing of host NUMA pin option Date: Wed, 23 Jun 2010 23:09:36 +0200 Message-ID: <1277327377-29629-3-git-send-email-andre.przywara@amd.com> X-Mailer: git-send-email 1.6.4 In-Reply-To: <1277327377-29629-1-git-send-email-andre.przywara@amd.com> References: <1277327377-29629-1-git-send-email-andre.przywara@amd.com> MIME-Version: 1.0 X-Reverse-DNS: ausb3extmailp02.amd.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 23 Jun 2010 21:25:56 +0000 (UTC) diff --git a/sysemu.h b/sysemu.h index 6018d97..1b3f77b 100644 --- a/sysemu.h +++ b/sysemu.h @@ -139,6 +139,7 @@ extern long hpagesize; extern int nb_numa_nodes; extern uint64_t node_mem[MAX_NODES]; extern uint64_t node_cpumask[MAX_NODES]; +extern int node_pin[MAX_NODES]; #define MAX_OPTION_ROMS 16 extern const char *option_rom[MAX_OPTION_ROMS]; diff --git a/vl.c b/vl.c index 0ee963c..02e0bed 100644 --- a/vl.c +++ b/vl.c @@ -234,6 +234,7 @@ int boot_menu; int nb_numa_nodes; uint64_t node_mem[MAX_NODES]; uint64_t node_cpumask[MAX_NODES]; +int node_pin[MAX_NODES]; static QEMUTimer *nographic_timer; @@ -771,6 +772,22 @@ static void numa_add(const char *optarg) node_cpumask[nodenr] = value; } nb_numa_nodes++; + } else if (!strcmp(option, "pin")) { + if (get_param_value(option, 128, "nodeid", optarg) == 0) { + fprintf(stderr, "error: need nodeid for -numa pin,...\n"); + exit(1); + } else { + nodenr = strtoull(option, NULL, 10); + if (nodenr >= nb_numa_nodes) { + fprintf(stderr, "nodeid exceed specified NUMA nodes\n"); + exit(1); + } + } + if (get_param_value(option, 128, "host", optarg) == 0) { + node_pin[nodenr] = -1; + } else { + node_pin[nodenr] = strtoull(option, NULL, 10); + } } return; } @@ -1873,6 +1890,7 @@ int main(int argc, char **argv, char **envp) for (i = 0; i < MAX_NODES; i++) { node_mem[i] = 0; node_cpumask[i] = 0; + node_pin[i] = -1; } assigned_devices_index = 0;