svn commit: r333601 - head/sys/dev/hwpmc
Matt Macy
mmacy at FreeBSD.org
Mon May 14 06:15:01 UTC 2018
Author: mmacy
Date: Mon May 14 06:11:25 2018
New Revision: 333601
URL: https://svnweb.freebsd.org/changeset/base/333601
Log:
hwpmc: don't reference domain index with no memory backing it
On multi-socket the domain will be correctly set for a given CPU
regardless of whether or not NUMA is enabled.
Approved by: sbruno
Modified:
head/sys/dev/hwpmc/hwpmc_logging.c
Modified: head/sys/dev/hwpmc/hwpmc_logging.c
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_logging.c Mon May 14 05:21:18 2018 (r333600)
+++ head/sys/dev/hwpmc/hwpmc_logging.c Mon May 14 06:11:25 2018 (r333601)
@@ -63,8 +63,10 @@ __FBSDID("$FreeBSD$");
#ifdef NUMA
#define NDOMAINS vm_ndomains
+#define curdomain PCPU_GET(domain)
#else
#define NDOMAINS 1
+#define curdomain 0
#define malloc_domain(size, type, domain, flags) malloc((size), (type), (flags))
#define free_domain(addr, type) free(addr, type)
#endif
@@ -259,7 +261,7 @@ pmclog_get_buffer(struct pmc_owner *po)
KASSERT(po->po_curbuf[curcpu] == NULL,
("[pmclog,%d] po=%p current buffer still valid", __LINE__, po));
- domain = PCPU_GET(domain);
+ domain = curdomain;
MPASS(pmc_dom_hdrs[domain]);
mtx_lock_spin(&pmc_dom_hdrs[domain]->pdbh_mtx);
if ((plb = TAILQ_FIRST(&pmc_dom_hdrs[domain]->pdbh_head)) != NULL)
More information about the svn-src-head
mailing list