Page MenuHomeFreeBSD

mhorne (Mitchell Horne)
User

Projects (4)

User Details

User Since
Mar 22 2019, 4:46 AM (399 w, 3 d)

Recent Activity

Today

mhorne closed D61062: tests/sys/pmc: add PERF, RDPMC, row, sampling and unload tests.
Mon, Nov 16, 8:27 PM
mhorne committed rGd546356523f3: tests/sys/pmc: add PERF, RDPMC, row, sampling and unload tests.
Mon, Nov 16, 8:27 PM
mhorne added a comment to D61369: hwpmc_soft: count each row once.

I'm sorry, I don't understand the problem being addressed. It seems like "once per-CPU". Does some kind of mismatch occur between start/stop invocations?

Mon, Nov 16, 8:10 PM
mhorne added a comment to D61370: hwpmc: drain PMCs at unload.

How does this relate to your recent addition of pmc_unload()? In particular, should that function attempt to drain samples, or would it not help anything?

Mon, Nov 16, 8:09 PM
mhorne committed rG002594ccc0e2: pmc.soft(3): fixup table formatting.
Mon, Nov 16, 7:53 PM
mhorne committed rGbf7bb731d8a2: hwpmc: call the thread-create hook for Linux and kernel threads (authored by afscoelho_gmail.com).
Mon, Nov 16, 7:51 PM
mhorne closed D61524: hwpmc: call the thread-create hook for Linux and kernel threads.
Mon, Nov 16, 7:51 PM
mhorne accepted D61524: hwpmc: call the thread-create hook for Linux and kernel threads.

Following the location of the KASSERT, there is a noted TODO:

Mon, Nov 16, 7:47 PM

Fri, Nov 13

mhorne committed rGb35e92160849: libpmc: add more alderlake models (authored by anaelle.cazuc_stormshield.eu).
Fri, Nov 13, 6:43 PM
Herald added a reviewer for D49126: libpmc: add more alderlake models: ali_mashtizadeh.com.
Fri, Nov 13, 6:43 PM
mhorne committed rG7b76697a20d7: lock.1: align options + tag spdx (authored by ziaee).
Fri, Nov 13, 6:42 PM
mhorne committed rG2a868fd8342e: time.1: minor cleanup (alignment/macro/spdx) (authored by ziaee).
Fri, Nov 13, 6:41 PM
mhorne committed rG554b97e32db0: mmc_fdt: handle broken-cd property.
Fri, Nov 13, 6:41 PM
mhorne committed rGc9e6bc37a9ca: mq_open(2): document sysctl limit EINVAL and ENFILE conditions (authored by Kit Dallege <xaum.io@gmail.com>).
Fri, Nov 13, 6:41 PM
mhorne committed rGa4d5853c6734: amd64: use pc_is_full() helper function.
Fri, Nov 13, 6:41 PM
mhorne committed rG3bc37e2f7a14: dwc: fix DEBUG macro name.
Fri, Nov 13, 6:41 PM
mhorne committed rG25a9d3cef33b: hwpmc_amd: simplify counter descriptor definitions.
Fri, Nov 13, 6:41 PM
mhorne committed rG45fb6447f45b: hpwmc_amd.c: style improvements.
Fri, Nov 13, 6:41 PM
mhorne committed rG456bd1f0976a: hwpmc_core: remove two non-existent function prototypes.
Fri, Nov 13, 6:41 PM
Herald added a reviewer for D41273: hwpmc_amd: simplify counter descriptor definitions: ali_mashtizadeh.com.
Fri, Nov 13, 6:41 PM
mhorne committed rGad4a0d6102cd: hwpmc: tidy pcd_finalize methods.
Fri, Nov 13, 6:41 PM
Herald added a reviewer for D41272: hpwmc_amd.c: style improvements: ali_mashtizadeh.com.
Fri, Nov 13, 6:41 PM
mhorne committed rG00f021e63bb9: kern_reboot(9): belatedly bump .Dd.
Fri, Nov 13, 6:41 PM
Herald added a reviewer for D41271: hwpmc_core: remove two non-existent function prototypes: ali_mashtizadeh.com.
Fri, Nov 13, 6:41 PM
Herald added a reviewer for D41270: hwpmc: tidy pcd_finalize methods: ali_mashtizadeh.com.
Fri, Nov 13, 6:41 PM
mhorne added a comment to D59361: kern: run the PMC context-switch-in hook in fork_exit.

Thanks, my apologies it took so long to address. I merged the fix from the other review!

Fri, Nov 13, 2:36 PM
mhorne committed rG1bb8b1d99a6c: hwpmc: switch in process PMCs on a thread's first run (authored by afscoelho_gmail.com).
Fri, Nov 13, 2:32 PM
mhorne closed D60565: hwpmc: switch in process PMCs on a thread's first run.
Fri, Nov 13, 2:32 PM
mhorne accepted D60565: hwpmc: switch in process PMCs on a thread's first run.
Fri, Nov 13, 2:31 PM
mhorne updated subscribers of D61449: hwpmc: Fix use-after-free races between PMC release and context switches.

I am totally unfamiliar with this API until today. It seems like a big hammer, but maybe this is unavoidable for this destructive operation.

Fri, Nov 13, 2:25 PM

Thu, Nov 12

mhorne committed rG736dc39b0e7d: riscv: add QEMU marchid.
Thu, Nov 12, 4:24 PM
mhorne committed rG637fce654017: uart: Set the bus space tag before parsing hw.uart.console (authored by rick_sloservers.com).
Thu, Nov 12, 4:24 PM
mhorne committed rG4b9057dbb7c1: uart: Set the bus space tag before parsing hw.uart.console (authored by rick_sloservers.com).
Thu, Nov 12, 4:22 PM
mhorne committed rG2292e7a4cfaa: riscv: add QEMU marchid.
Thu, Nov 12, 4:22 PM
mhorne committed rGc37b83055406: hwpmc: refuse MOD_UNLOAD while PMC owners exist (authored by afscoelho_gmail.com).
Thu, Nov 12, 4:22 PM
mhorne closed D60561: hwpmc: refuse MOD_UNLOAD while PMC owners exist.
Thu, Nov 12, 4:21 PM
mhorne accepted D60561: hwpmc: refuse MOD_UNLOAD while PMC owners exist.
Thu, Nov 12, 4:18 PM
mhorne requested changes to D61457: pmc: Exit with EX_OK when the pmc record time limit ends the capture.

I agree with the premise of the fix, but the implementation does not seem right.

Thu, Nov 12, 3:51 PM
mhorne accepted D61459: tests/sys/pmc: Keep atf_fail reasons on a single line.

LGTM!

Thu, Nov 12, 3:34 PM
mhorne accepted D61458: tests/sys/pmc: Pass pmcstat -n before -P in pmc_callchain_ur_test.
Thu, Nov 12, 3:32 PM

Tue, Nov 10

mhorne requested changes to D60561: hwpmc: refuse MOD_UNLOAD while PMC owners exist.

Marking the status: outstanding feedback.

Tue, Nov 10, 4:27 PM
mhorne committed rG724a4374bd19: tests/sys/pmc/Makefile: whitespace.
Tue, Nov 10, 4:18 PM
mhorne committed rG546a76463123: tests/sys/pmc: add pidtrack, callchain, pmc(8), RAPL and AMD tests (authored by ojanerif_amd.com).
Tue, Nov 10, 4:15 PM
mhorne closed D59549: tests/sys/pmc: add pidtrack, callchain, pmc(8), RAPL and AMD tests.
Tue, Nov 10, 4:14 PM
mhorne accepted D59549: tests/sys/pmc: add pidtrack, callchain, pmc(8), RAPL and AMD tests.

For future reference: the request about preferred license format applies to all new files, not only the particular header I commented on. Here I will fix them up to move forward with merge, but please be mindful of this!

Tue, Nov 10, 4:03 PM
mhorne closed D60790: libpmc: Strip leading zeros from the cpuid model.
Tue, Nov 10, 4:00 PM
mhorne committed rGc5400dc5421c: libpmc: Strip leading zeros from the cpuid model (authored by ojanerif_amd.com).
Tue, Nov 10, 4:00 PM
mhorne accepted D60790: libpmc: Strip leading zeros from the cpuid model.

LGTM, I will try to merge today.

Tue, Nov 10, 3:40 PM
mhorne added a reviewer for D58698: pmc: Branch history interface: br.
Tue, Nov 10, 3:11 PM
mhorne added a comment to D58698: pmc: Branch history interface.

I think I'm getting a sense for how this will work.

Tue, Nov 10, 3:11 PM

Mon, Nov 9

mhorne committed rGbba06f0681bb: riscv: add QEMU marchid.
Mon, Nov 9, 6:06 PM
mhorne added a comment to D60790: libpmc: Strip leading zeros from the cpuid model.

Thanks, fair points. Some context before I change anything:

The strip only runs when the id has a vendor-family-model layout (two -). The arm64 (0x%016lx) and powerpc (%08x) ids have no -, so they come through unchanged, e.g. 0x00000000410fd030 stays as is. On x86, no Intel entry in the mapfile has a model below 10h, so Intel matching does not change either. Only the AMD/Hygon low models are affected.

Mon, Nov 9, 4:18 PM
mhorne committed rGe67b4c879ae1: hwpmc: release a PMC whose ID could not be copied out (authored by afscoelho_gmail.com).
Mon, Nov 9, 4:09 PM
mhorne committed rG0ab6ce9f1813: pmc(8): zero-initialize the event descriptor in stat mode (authored by afscoelho_gmail.com).
Mon, Nov 9, 4:09 PM
mhorne committed rGebecf6848945: hwpmc: release a PMC whose ID could not be copied out (authored by afscoelho_gmail.com).
Mon, Nov 9, 4:07 PM
mhorne committed rG494bc0464d90: pmc(8): zero-initialize the event descriptor in stat mode (authored by afscoelho_gmail.com).
Mon, Nov 9, 4:07 PM

Sun, Nov 8

mhorne requested changes to D60790: libpmc: Strip leading zeros from the cpuid model.

I don't trust this fully.

Sun, Nov 8, 6:17 PM
mhorne requested changes to D60771: hwpmc: keep AMD UMC counters from saturating.

This new array allocation is not necessary.

Sun, Nov 8, 5:50 PM
mhorne requested changes to D59549: tests/sys/pmc: add pidtrack, callchain, pmc(8), RAPL and AMD tests.

Please see my previous comment.

Sun, Nov 8, 5:43 PM
mhorne added a comment to D60561: hwpmc: refuse MOD_UNLOAD while PMC owners exist.

What is the consequence here, can the unload race cause a panic or memory leak? Or is it purely functional (lost samples)?

I ask because, there is an additional module state, MOD_QUIESCE. It immediately precedes MOD_UNLOAD in the linker_file_unload() path, and functions similarly, but its errors can be overridden by force (kldunload -f / LINKER_UNLOAD_FORCE).
MOD_QUIESCE might be the appropriate state for this cleanup.

See module(9), kldunload(2), kldunload(8) man pages for more information.

Thanks, the problem is more than lost samples. It is that a queued sample keeps a reference to its PMC until we process it.
Cleanup disables the hooks that process those samples, then waits for the references to reach zero. If samples remain in the queue, that wait can last forever. With INVARIANTS, it can panic with “waiting too long for pmc to be free” instead.
Yeah, the owner check is conservative, but I think it avoids this unsafe cleanup. Couldn't we have an issue moving the check to MOD_QUIESCE and then let -f proceed with samples still queued ? Couldn't cleanup disable sample processing before those samples release their PMC reference?

Sun, Nov 8, 5:26 PM

Fri, Nov 6

mhorne accepted D61254: README: Scrap and write a new one in Markdown.
Fri, Nov 6, 3:41 PM
mhorne added a comment to D61254: README: Scrap and write a new one in Markdown.

Nice stuff! Two comments, neither blocking at all.

Fri, Nov 6, 3:41 PM
mhorne added reviewers for D60771: hwpmc: keep AMD UMC counters from saturating: mhorne, pmc.
Fri, Nov 6, 3:29 PM
mhorne committed rGe5a48c8e0dd0: hwpmc: release a PMC whose ID could not be copied out (authored by afscoelho_gmail.com).
Fri, Nov 6, 3:23 PM
mhorne closed D60562: hwpmc: release a PMC whose ID could not be copied out.
Fri, Nov 6, 3:22 PM
mhorne accepted D60562: hwpmc: release a PMC whose ID could not be copied out.

Very nice.

Fri, Nov 6, 3:19 PM
mhorne added a comment to D60561: hwpmc: refuse MOD_UNLOAD while PMC owners exist.

What is the consequence here, can the unload race cause a panic or memory leak? Or is it purely functional (lost samples)?

Fri, Nov 6, 3:17 PM
mhorne closed D60766: tests: add a regression test for the orphaned IBS NMI.
Fri, Nov 6, 2:51 PM
mhorne committed rGfdfb611461ae: tests: add a regression test for the orphaned IBS NMI (authored by ojanerif_amd.com).
Fri, Nov 6, 2:51 PM
mhorne closed D60765: cpuctl, x86: claim IBS NMIs orphaned by control MSR writes.
Fri, Nov 6, 2:51 PM
mhorne committed rGf5304e44ff50: cpuctl, x86: claim IBS NMIs orphaned by control MSR writes (authored by ojanerif_amd.com).
Fri, Nov 6, 2:51 PM
mhorne accepted D61133: hwpmc: Decline the AMD PerfMonV2 path when GLOBAL_CTL is absent.
Fri, Nov 6, 2:35 PM

Thu, Nov 5

mhorne requested changes to D61062: tests/sys/pmc: add PERF, RDPMC, row, sampling and unload tests.
Thu, Nov 5, 2:11 PM
mhorne committed rGa97914284c2e: pmc(8): zero-initialize the event descriptor in stat mode (authored by afscoelho_gmail.com).
Thu, Nov 5, 1:57 PM
mhorne closed D59364: pmc(8): zero-initialize the event descriptor in stat mode.
Thu, Nov 5, 1:57 PM
mhorne accepted D59364: pmc(8): zero-initialize the event descriptor in stat mode.
Thu, Nov 5, 1:53 PM
mhorne closed D60770: hwpmc: use the UMC enable bit with PerfMonV2.
Thu, Nov 5, 1:46 PM
mhorne committed rGabd7dfa09a0e: hwpmc: use the UMC enable bit with PerfMonV2 (authored by ojanerif_amd.com).
Thu, Nov 5, 1:46 PM
mhorne accepted D60770: hwpmc: use the UMC enable bit with PerfMonV2.
Thu, Nov 5, 1:29 PM
mhorne accepted D61133: hwpmc: Decline the AMD PerfMonV2 path when GLOBAL_CTL is absent.

LGTM. Please allow @afscoelho_gmail.com to confirm.

Thu, Nov 5, 1:25 PM

Wed, Nov 4

mhorne added a comment to D57381: riscv: add KASAN support.

@zishun.yi.dev_gmail.com @aokblast hi, I wonder if anything is blocking landing that LLVM PR upstream? That's the only thing preventing us from committing KASAN support for riscv.

Hi, sorry that I totally miss this. I just enable auto-merge in upstream now. It will be merged after CI sucessfully runnung.

Wed, Nov 4, 6:30 PM
mhorne added a comment to D59549: tests/sys/pmc: add pidtrack, callchain, pmc(8), RAPL and AMD tests.

A couple cosmetic notes only.

Wed, Nov 4, 6:18 PM
mhorne committed rGa01ea5156198: libpmc: Map AMD Family 1Ah models 00h-0Fh to amdzen5 (authored by ojanerif_amd.com).
Wed, Nov 4, 5:55 PM
mhorne closed D60625: libpmc: Map AMD Family 1Ah models 00h-0Fh to amdzen5.
Wed, Nov 4, 5:54 PM
mhorne committed rG869bb2bbb780: hwpmc: use the PerfMonV2 DF encoding on Family 19h (authored by ojanerif_amd.com).
Wed, Nov 4, 5:48 PM
mhorne closed D60769: hwpmc: use the PerfMonV2 DF encoding on Family 19h.
Wed, Nov 4, 5:48 PM
mhorne committed rG32beb16881ad: hwpmc(4): stop overwalking past _start on amd64 user callchains (authored by nickbanks_netflix.com).
Wed, Nov 4, 5:40 PM
mhorne committed rG199a50dc63e6: hwpmc: fix false callchain assertion on the PMC_UR ring (authored by afscoelho_gmail.com).
Wed, Nov 4, 5:40 PM
mhorne committed rG1504307c4891: hwpmc: fix false runcount assertion in user callchain capture (authored by afscoelho_gmail.com).
Wed, Nov 4, 5:40 PM
mhorne committed rG9db8ae83e62e: uart: Set the bus space tag before parsing hw.uart.console (authored by rick_sloservers.com).
Wed, Nov 4, 5:33 PM

Tue, Nov 3

mhorne added a comment to D61141: amd64/vmm: Don't advertise AMD PerfMonV2 or performance counters.

This is fine, but it won't help older versions of FreeBSD which use vmm to boot a newer FreeBSD guest. I think this will still need a workaround in hwpmc, gated on vm_guest == VM_GUEST_BHYVE.

That sounds a bit like a hack though, no? Wouldn't it make more sense to either MFC this (and any other similar patches) the older still-supported versions of FreeBSD, or commit D61133 along with this one?

It is a hack, but such is life. Certainly this commit should be MFCed to stable/15 and 14 at minimum. I guess, since one needs to load hwpmc.ko to trigger the problem, it's not so likely to annoy users.

Tue, Nov 3, 3:14 PM
mhorne committed rG662deb47077d: hwpmc/amd: prime UMC perfmon block before programming counter registers (authored by ojanerif_amd.com).
Tue, Nov 3, 2:45 PM
mhorne committed rG4b8e4e6d5605: riscv: Map the DTB when it is outside the kernel's 1GB region (authored by rick_sloservers.com).
Tue, Nov 3, 2:24 PM
mhorne committed rG3dba72dfef75: libpmc: Fix AMD L3 counter parameter parsing (authored by ali_mashtizadeh.com).
Tue, Nov 3, 2:21 PM
mhorne committed rGe7c7fed0e369: libpmc/pmu-events: Add support for new json fields (authored by bnovkov).
Tue, Nov 3, 2:20 PM
mhorne committed rG8f1f763f713c: jevents: include file path in whitelist error message.
Tue, Nov 3, 2:20 PM
mhorne committed rG60edd118e713: libpmc: Explicitly whitelist json fields (authored by ali_mashtizadeh.com).
Tue, Nov 3, 2:20 PM
mhorne committed rG8b55ee60829f: libpmc: Import AMD Zen 6 PMU events. (authored by Ali Mashtizadeh <mashti@uwaterloo.ca>).
Tue, Nov 3, 2:19 PM
mhorne committed rG58d080ea724f: libpmc: Import AMD Zen 5 PMU events. (authored by ali_mashtizadeh.com).
Tue, Nov 3, 2:19 PM

Fri, Oct 30

mhorne committed rGc56963b0fa67: x86: add AMD RAPL MSR definitions to specialreg.h (authored by afscoelho_gmail.com).
Fri, Oct 30, 2:29 PM