From owner-svn-src-user@FreeBSD.ORG Sun May 12 02:10:16 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 18F6CB78; Sun, 12 May 2013 02:10:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0C0455DF; Sun, 12 May 2013 02:10:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4C2AFiM076601; Sun, 12 May 2013 02:10:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4C2AFpt076600; Sun, 12 May 2013 02:10:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305120210.r4C2AFpt076600@svn.freebsd.org> From: Attilio Rao Date: Sun, 12 May 2013 02:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r250546 - user/attilio/jeff-numa/sys/x86/acpica X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 May 2013 02:10:16 -0000 Author: attilio Date: Sun May 12 02:10:15 2013 New Revision: 250546 URL: http://svnweb.freebsd.org/changeset/base/250546 Log: Add the code to setup the correct number of probed memory domains. Sponsored by: EMC / Isilon storage division Obtained from: jeff Modified: user/attilio/jeff-numa/sys/x86/acpica/srat.c Modified: user/attilio/jeff-numa/sys/x86/acpica/srat.c ============================================================================== --- user/attilio/jeff-numa/sys/x86/acpica/srat.c Sun May 12 01:58:04 2013 (r250545) +++ user/attilio/jeff-numa/sys/x86/acpica/srat.c Sun May 12 02:10:15 2013 (r250546) @@ -244,33 +244,34 @@ static int renumber_domains(void) { int domains[VM_PHYSSEG_MAX]; - int ndomain, i, j, slot; + int i, j, slot; /* Enumerate all the domains. */ - ndomain = 0; + vm_ndomain = 0; for (i = 0; i < num_mem; i++) { /* See if this domain is already known. */ - for (j = 0; j < ndomain; j++) { + for (j = 0; j < vm_ndomain; j++) { if (domains[j] >= mem_info[i].domain) break; } - if (j < ndomain && domains[j] == mem_info[i].domain) + if (j < vm_ndomain && domains[j] == mem_info[i].domain) continue; /* Insert the new domain at slot 'j'. */ slot = j; - for (j = ndomain; j > slot; j--) + for (j = vm_ndomain; j > slot; j--) domains[j] = domains[j - 1]; domains[slot] = mem_info[i].domain; - ndomain++; - if (ndomain > MAXMEMDOM) { + vm_ndomain++; + if (vm_ndomain > MAXMEMDOM) { + vm_ndomain = 1; printf("SRAT: Too many memory domains\n"); return (EFBIG); } } /* Renumber each domain to its index in the sorted 'domains' list. */ - for (i = 0; i < ndomain; i++) { + for (i = 0; i < vm_ndomain; i++) { /* * If the domain is already the right value, no need * to renumber.