From owner-svn-src-all@freebsd.org Mon May 14 01:08:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 448A0FDEE5D; Mon, 14 May 2018 01:08:48 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E915881083; Mon, 14 May 2018 01:08:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C721C152C3; Mon, 14 May 2018 01:08:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4E18lGV048852; Mon, 14 May 2018 01:08:47 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4E18lv0048851; Mon, 14 May 2018 01:08:47 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805140108.w4E18lv0048851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 14 May 2018 01:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333598 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 333598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2018 01:08:48 -0000 Author: mmacy Date: Mon May 14 01:08:47 2018 New Revision: 333598 URL: https://svnweb.freebsd.org/changeset/base/333598 Log: pmc: don't add pmc owner to list until setup is complete Once a pmc owner is added to the pmc_ss_owners list it is visible for all to see. We don't want this to happen until setup is complete. Reported by: mjg Approved by: sbruno Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon May 14 00:56:33 2018 (r333597) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon May 14 01:08:47 2018 (r333598) @@ -2733,13 +2733,6 @@ pmc_start(struct pmc *pm) */ if (mode == PMC_MODE_SS) { - if (po->po_sscount == 0) { - CK_LIST_INSERT_HEAD(&pmc_ss_owners, po, po_ssnext); - atomic_add_rel_int(&pmc_ss_count, 1); - PMCDBG1(PMC,OPS,1, "po=%p in global list", po); - } - po->po_sscount++; - /* * Log mapping information for all existing processes in the * system. Subsequent mappings are logged as they happen; @@ -2748,6 +2741,12 @@ pmc_start(struct pmc *pm) if (po->po_logprocmaps == 0) { pmc_log_all_process_mappings(po); po->po_logprocmaps = 1; + } + po->po_sscount++; + if (po->po_sscount == 1) { + atomic_add_rel_int(&pmc_ss_count, 1); + CK_LIST_INSERT_HEAD(&pmc_ss_owners, po, po_ssnext); + PMCDBG1(PMC,OPS,1, "po=%p in global list", po); } }