Page MenuHomeFreeBSD

kern: run the PMC context-switch-in hook in fork_exit
Needs ReviewPublic

Authored by afscoelho_gmail.com on Thu, Sep 3, 9:32 PM.
Tags
None
Referenced Files
F174456221: D59361.id188460.diff
Sat, Oct 3, 9:26 AM
F174443346: D59361.id188245.diff
Sat, Oct 3, 6:29 AM
F174427708: D59361.id188097.diff
Sat, Oct 3, 3:21 AM
F174409322: D59361.id188097.diff
Sat, Oct 3, 12:08 AM
F174380802: D59361.id188245.diff
Fri, Oct 2, 7:48 PM
Unknown Object (File)
Thu, Oct 1, 5:03 AM
Unknown Object (File)
Wed, Sep 30, 1:06 AM
Unknown Object (File)
Mon, Sep 28, 8:36 PM
Subscribers

Details

Summary

A new thread reaches the CPU for the first time through fork_exit()
instead of sched_switch(), so the context-switch-in hook that
sched_switch() runs is skipped. An inherited PMC is then not
programmed onto the hardware until the child's first real context
switch, and hwpmc does not count the work of a short-lived child.

Run the hook from fork_exit() for a process that uses PMCs. This
mirrors the mi_switch() path that fork_exit() already emulates.

Sponsored by: AMD

Signed-off-by: Andre Silva <andasilv@amd.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76455
Build 73338: arc lint + arc unit

Event Timeline

Rebase on main (D60141 and D60185 are committed). No change.