Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 May 2018 06:11:25 +0000 (UTC)
From:      Matt Macy <mmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333601 - head/sys/dev/hwpmc
Message-ID:  <201805140611.w4E6BPtT003910@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805140611.w4E6BPtT003910>